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
Return to the default flat view Create a new topic Submit Reply
Embedded Tinypic Uploader [message #161064] Thu, 12 November 2009 20:16 Go to previous message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma:
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

[Message index]
 
Read Message
Read Message
Read Message icon6.gif
Read Message
Read Message
Read Message icon6.gif
Read Message
Read Message icon6.gif
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: Sun Nov 24 22:38:51 GMT 2024

Total time taken to generate the page: 0.05063 seconds