Embedded Tinypic Uploader [message #161064] |
Thu, 12 November 2009 20:16 |
nozafc
Messages: 75 Registered: April 2009
Karma: 0
|
Member |
|
|
Can't really take any credit for this as it's an API provided by TinyPic but if anybody wants to add an inline embedder to their forum they can take the following steps
In the msg.tmpl add the following near the top
{SECTION: tinypic}
<script type="text/javascript">
tinypic_layout = 'narrow';
tinypic_type = 'both';
tinypic_links = 'forum';
tinypic_language = 'en';
tinypic_search = 'false';
tinypic_autoload = false;
</script>
<script src="http://plugin.tinypic.com/j/plugin.js" type="text/javascript"></script>
<input type="button" value="TinyPic Plugin" onclick="javascript:showTinypicPlugin();"/>
{SECTION: END}
Then on line 113 which reads
<td class="GenText ar vb nw">{IF: $FUD_OPT_3 & 2}{ELSE}{TEMPLATE: threaded_view}{END}{TEMPLATE: new_thread}{IF: (!($frm->thread_opt & 1) || $perms & 4096)}{TEMPLATE: post_reply}{ENDIF}</td>
Change to this
<td class="GenText ar vb nw">{TEMPLATE: tinypic} {IF: $FUD_OPT_3 & 2}{ELSE}{TEMPLATE: threaded_view}{END}{TEMPLATE: new_thread}{IF: (!($frm->thread_opt & 1) || $perms & 4096)}{TEMPLATE: post_reply}{ENDIF}</td>
Then simply recompile your theme and the button will become available
You can customize the button by changing
<input type="button" value="TinyPic Plugin" onclick="javascript:showTinypicPlugin();"/>
to something like
<input type="image" src="http://i36.tinypic.com/2vjy0rc.gif" onclick="javascript:showTinypicPlugin();"/>
This will allow you to customize the button to suit your themes (obviously substituting http://i36.tinypic.com/2vjy0rc.gif to the image of your choice)
I use this button
but one of my users made this
Here is a link to a PSD
http://thegers.info/TINYPIC.rar
I've attached the msg.tmpl so you can see exactly what I mean
Also it could be quite easily adapted to work in the post section by editing post.tmpl
-
Attachment: msg.zip
(Size: 2.67KB, Downloaded 924 times)
[Updated on: Thu, 12 November 2009 20:38] Report message to a moderator
|
|
|
|
|
|
|
Re: Embedded Tinypic Uploader [message #161121 is a reply to message #161065] |
Sun, 15 November 2009 22:13 |
The Witcher
Messages: 675 Registered: May 2009 Location: USA
Karma: 3
|
Senior Member |
|
|
nozafc wrote on Thu, 12 November 2009 14:16
This will allow you to customize the button to suit your themes (obviously substituting http://i36.tinypic.com/2vjy0rc.gif to the image of your choice)
I use this button
but one of my users made this
Here is a link to a PSD
http://thegers.info/TINYPIC.rar
naudefj, nozafc
I readily admit that my knowledge of PHP etc is quite limited, and I am only vaguely familiar with tinypic, currently most of my users utilize Photo bucket accounts to post images, while others use image links from other sources (such as their own hosting accounts), and I am reluctant to allow attachment privileges to all users because I assume that with each attachment added the FUDforum program grows ever larger and some users add lots and lots of images.
This leads to a conundrum of sorts: On the one hand I wish to allow (even encourage) users to use images in their posts to express themselves; yet the users occasionally change, move or delete their images from their photo bucket accounts or allow their accounts to expire leaving dead image links behind in the forums posts.
I am aware that at least 3 or more of my users have passed away in the past 2 years which also leaves dead links in posts that I am reluctant to delete even though the images themselves are no longer available.
On the other hand I do not believe that allowing or having all users add attachments is a viable alternative since I believe the program would quickly become bloated.
So I was interested in your suggestion for an "Embedded Tinypic Uploader" as a viable alternative, but I do have some questions.
1st What is a PSD?
2nd It appears to me that your Mod above draws the tinypic button itself from tinypic.com as opposed to having it added to the thm directory where it would be rebuilt and added to new themes, wouldn't it be better to add the tinypic button to the thm directory to begin with?
3rd Do you believe this Modification would/could resolve the dead link problem mentioned above?
4th Also could you elaborate some on what you meant by
nozafc wrote on Thu, 12 November 2009 14:16
Also it could be quite easily adapted to work in the post section by editing post.tmpl
5th Do you believe this would be a viable option for future upgrades?
Thanks.
"I'm a Witcher, I solve human problems; not always using a sword!"
|
|
|
Re: Embedded Tinypic Uploader [message #161130 is a reply to message #161064] |
Mon, 16 November 2009 17:31 |
nozafc
Messages: 75 Registered: April 2009
Karma: 0
|
Member |
|
|
1. A PSD file is simply a native photoshop file. If you save files as jpg/gif etc then you lose the layer information contained within the file making it harder to change the original graphics (for slightly colour alterations it shouldn't really matter though)
2. Yes it would be better to have the button drawn inside the thm directory. I only used that as an example to be honest
3. I've no idea what TinyPic's image deletion policy is but I would reckon that as long as the images were SFW that they would stay a long time
4. Currently the button is attached to the thread view so that users can upload before creating a thread (ie the msg.tmpl file). If you followed a similar route but added the additions to the post.tmpl file you could embed the uploader inside the actual create/edit post view (ie where the Preview Message/Spell-check Message/Submit Reply buttons currently sit) The button graphic would obviously be different but the only other thing that would change would be the line that the {TEMPLATE: tinypic} part got added. I'll have a look tonight to find out exact where it would get inserted
[Updated on: Mon, 16 November 2009 17:33] Report message to a moderator
|
|
|
Re: Embedded Tinypic Uploader [message #161148 is a reply to message #161130] |
Tue, 17 November 2009 17:39 |
The Witcher
Messages: 675 Registered: May 2009 Location: USA
Karma: 3
|
Senior Member |
|
|
Ok Thanks! Clarifies a lot!
Doesn't matter where the button comes from I just wanted to make sure I understood correctly and that there wasn't a specific reason for downloading as opposed to physically adding it! A year or so ago I would not have understood the difference.
Looked into TinyPic's FAQ and it says that images associated with an account are not deleted but that those not associated with an account may be deleted after 90 days if not viewed.
I assume that since TinyPic provided the original plug-in and adverts it as an option for use on Blogs and Forums that using their http://plugin.tinypic.com plug-in would be considered as using an associated account and it makes sense that TinyPic would view it that way to encourage it's use; and since they own photo bucket as well I would expect they are looking into adding a plug-in for it as well.
The only thing better would be if it could automatically be associated with an account that is in turn associated with the forum but that just sounds convoluted.
.
I have not seen this particular option anywhere else but it looks like it would be quite useful (for my purposes any how), and I can see a variety of benefits and possibilities for it.
Having it in the edit view as well as the thread view would be better I believe.
"I'm a Witcher, I solve human problems; not always using a sword!"
|
|
|