FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Embedded Tinypic Uploader  () 2 Votes
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Embedded Tinypic Uploader [message #161064] Thu, 12 November 2009 20:16 Go to next message
nozafc is currently offline  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

http://i36.tinypic.com/2vjy0rc.gif

but one of my users made this

http://i34.tinypic.com/2s9r9tz.gif

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 922 times)

[Updated on: Thu, 12 November 2009 20:38]

Report message to a moderator

Re: Embedded Tinypic Uploader [message #161065 is a reply to message #161064] Thu, 12 November 2009 20:24 Go to previous messageGo to next message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma: 0
Member
Screenshots

Before the TP button is pressed

http://i38.tinypic.com/erxwk1.jpg

After pressing

http://i34.tinypic.com/2vinr61.jpg

After uploading

http://i36.tinypic.com/156fos4.jpg

[Updated on: Thu, 12 November 2009 20:25]

Report message to a moderator

Re: Embedded Tinypic Uploader [message #161066 is a reply to message #161064] Thu, 12 November 2009 20:31 Go to previous messageGo to next message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma: 0
Member
Also you can customize the tinypic box as well if you want other options (ie instead of giving the BBCode as the result you can have it as a link or html etc , or you can have the box always open instead of a button to open it)

http://tinypic.com/developer.php

Simply set your preferences then copy the code at the bottom and put it in-between the tinypic section ie

{SECTION: tinypic}
TINYPIC CODE GOES HERE
{SECTION: END}



Re: Embedded Tinypic Uploader [message #161103 is a reply to message #161066] Sat, 14 November 2009 13:39 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
We actually need a "modding" system that can automatically apply template changed to install MODs like this. I'm just thinking, how are other forum handling this? Can we do something similar?
icon6.gif  Re: Embedded Tinypic Uploader [message #161104 is a reply to message #161103] Sat, 14 November 2009 19:02 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
Not sure about how other forums handle it, I have enough difficulty understanding FUDforum to worry about others I will leave that to those of you with more in-depth knowledge.

However I can provide the buttons to match FUDforum's current themes
The default button is already posted above, and here are 2 more for forest green and slate blue.

index.php?t=getfile&id=5782&private=0 index.php?t=getfile&id=5783&private=0 index.php?t=getfile&id=5784&private=0 index.php?t=getfile&id=5785&private=0



Entire 16 color sets can be found in Needful Things




"I'm a Witcher, I solve human problems; not always using a sword!"
icon6.gif  Re: Embedded Tinypic Uploader [message #161121 is a reply to message #161065] Sun, 15 November 2009 22:13 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
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

http://i36.tinypic.com/2vjy0rc.gif

but one of my users made this

http://i34.tinypic.com/2s9r9tz.gif

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 Go to previous messageGo to next message
nozafc is currently offline  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

icon6.gif  Re: Embedded Tinypic Uploader [message #161148 is a reply to message #161130] Tue, 17 November 2009 17:39 Go to previous message
The Witcher is currently offline  The Witcher   United States
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!"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: RSS or Atom feed link in XML Aggregation
Next Topic: Added external_fud_session_status($str) to forum_login.php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 02:12:03 GMT 2024

Total time taken to generate the page: 0.03097 seconds