Advertisement:

Author Topic: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page  (Read 100185 times)

Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #40 on: September 29, 2009, 03:14:20 PM »
Sure, and thanks!

In 1.1.10, the Upload button is placed just to the right of the BBC buttons and just above the smilies:




But in 2.x, it's located above the subject line.  I can live with it, but others may prefer it to be similar to 1.1.10.  Try as I might, I can't seem to land it there. 





My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.

Offline Joey Smith™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,356
  • Gender: Male
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #41 on: September 29, 2009, 05:04:52 PM »
Ok, if you will post all the edits you are using then I can try to test it out and see if can come up with a fix. I know some of the edits may already be in this topic but I have a lot going on today and it will be easier to answer your question if I get the exact edits you have made for this (including any mods you may have installed along with this to add this to the forum).

Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #42 on: September 29, 2009, 06:32:08 PM »
Thanks for checking it out, Tyrsson and absolutely no hurry, at all.   :)

In RC1.2, Themes/Post.template.php I found:

Code: [Select]
{
echo '
<tr>
<td align="right"></td>
<td valign="middle">
', template_control_richedit($context['post_box_name'], 'bbc'), '
</td>
</tr>';


And added AFTER:

Code: [Select]
echo '&nbsp;&nbsp;<a onclick="window.open(\'URL FOR YOUR TINYPIC HTML FILE HERE\',\'POPUP\',\'width=280,height=540,scrollbars=0\');return false;" href="#"><img src="URL FOR THE IMAGE BUTTON HERE" border="0"></a>';
(I placed my own url for the tinypic.html file and the image in this code.)

On the first page/post of this thread, there is also the tinypic.html file to place in the forum's root and the uploadimage.gif to put in Themes/(theme)/images.  (I use default). 

Most of these mods were added after this TinyPic Tip but none of them use the Post.template.php.

My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.

Offline bombasa

  • Semi-Newbie
  • *
  • Posts: 11
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #43 on: November 03, 2009, 02:39:56 PM »
First of all i would like to thank the author of this trick ;) and gbsothere for porting it to smf 2.0

I think i did fix it on smf 2.0 RC1.2 :

In Post.template.php :

Find :

Code: [Select]
{
echo '
<tr>
<td align="right"></td>
<td valign="middle">
', template_control_richedit($context['post_box_name'], 'bbc'), '
</td>
</tr>';
}

And add after :

Code: [Select]
{
echo '
<tr>
<td align="right"></td>
<td valign="middle">
<a onclick="window.open(\'URL OF TINYPIC.HTML\',\'POPUP\',\'width=280,height=540,scrollbars=0\');return false;" href="#"><img src="URL OF THE GIF HERE" border="0"></a></td>
</tr>';
}


Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #44 on: November 05, 2009, 05:42:50 PM »
bombasa, it works beautifully and thanks so much for posting it.

 :)


(Note for new viewers:  Bombasa's code is for 2.0.  The code for 1.x is found on the first post but the code alone isn't enough, you must download the attached tinypic.html file and uploadimage.gif.)
 
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.

Offline DaBoss48

  • Semi-Newbie
  • *
  • Posts: 20
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #45 on: November 09, 2009, 03:51:17 AM »
I added this like bombasa showed but only his is for 2.0 RC1.2 and I am on RC2. It works on RC2 only problem is that the button is placed right next to the Post and Preview buttons. I am wondering if somebody can fix it so the button can be right next to the smileys again? Thank You!

Offline jani01

  • Jr. Member
  • **
  • Posts: 100
    • Pakistan Biggest MP3 songs Portal
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #46 on: November 09, 2009, 08:42:34 AM »
really great effort.

thanks for this.

Offline DaBoss48

  • Semi-Newbie
  • *
  • Posts: 20
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #47 on: November 10, 2009, 10:38:31 PM »
Does anybody know how to make this work for 2.0 RC2? Please if you do then please tell us  :)

Offline bombasa

  • Semi-Newbie
  • *
  • Posts: 11
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #48 on: November 30, 2009, 11:05:10 AM »
Finally !!! I did it !

I managed to get it working with the help of this awsome MOD

Well to apply the hack on 2.0 RC2, you should do the following :

Find : /Themes/default/GenericControls.template.php

Find :

Code: [Select]
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="', $editor_context['columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="', $context['browser']['is_ie8'] ? 'max-width: ' . $editor_context['width'] . '; min-width: ' . $editor_context['width'] : 'width: ' . $editor_context['width'], '; height: ', $editor_context['height'], ';', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '</textarea>
Add after :

Code: [Select]
<div>
<a onclick="window.open(\'url of html file\',\'POPUP\',\'width=280,height=540,scrollbars=0\');return false;" href="#"><img src="url of img file" border="0">
</div>

It should work

Edit : the new code position should prevent the popup window from being accessed while you click on the text area.
« Last Edit: December 05, 2009, 04:16:04 PM by bombasa »

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #49 on: December 06, 2009, 01:52:27 AM »
Finally !!! I did it !

I managed to get it working with the help of this awsome MOD

Well to apply the hack on 2.0 RC2, you should do the following :

Find : /Themes/default/GenericControls.template.php

Find :

Code: [Select]
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="', $editor_context['columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="', $context['browser']['is_ie8'] ? 'max-width: ' . $editor_context['width'] . '; min-width: ' . $editor_context['width'] : 'width: ' . $editor_context['width'], '; height: ', $editor_context['height'], ';', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '</textarea>
Add after :

Code: [Select]
<div>
<a onclick="window.open(\'url of html file\',\'POPUP\',\'width=280,height=540,scrollbars=0\');return false;" href="#"><img src="url of img file" border="0">
</div>

It should work

Edit : the new code position should prevent the popup window from being accessed while you click on the text area.


bro can u tell where will the button will appear to upload pics ?
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline bombasa

  • Semi-Newbie
  • *
  • Posts: 11
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #50 on: December 06, 2009, 10:26:07 AM »
It should be like that



This is still a temporary fix, if anyone has a better one, he can post it there.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #51 on: December 06, 2009, 10:38:10 AM »
bro no such icon for me


Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline bombasa

  • Semi-Newbie
  • *
  • Posts: 11
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #52 on: December 06, 2009, 04:39:51 PM »
You should upload the uploadimage.gif and tinypic.html from the first post : http://www.simplemachines.org/community/index.php?topic=288169.msg1894568#msg1894568 to your host then change the "url of html file" and "url of img file" with the current address of these files.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #53 on: December 06, 2009, 11:29:19 PM »
it worked .... thank you  :D thanx alot  :)
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #54 on: December 07, 2009, 01:49:57 AM »
i just found a bug ...... after implementing this site is unable to send pm's to users ...

plz see the pic below


Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #55 on: December 08, 2009, 04:56:31 AM »
bump  ::)
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #56 on: December 12, 2009, 01:57:06 AM »
i just found a bug ...... after implementing this site is unable to send pm's to users ...

plz see the pic below





hasn't anyone faced the prob as i have faced ???
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Mayhem30

  • Full Member
  • ***
  • Posts: 539
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #57 on: December 12, 2009, 11:41:53 PM »
Is it possible to modify the code so we can control what "resize" options are available to the users?

Offline Shadow1243

  • Semi-Newbie
  • *
  • Posts: 76
  • Gender: Male
    • DoktorTR.Net - Tıp Sitesi
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #58 on: January 24, 2010, 01:47:09 PM »
Still working?

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP/TRICK] Tinypic Image Upload Popup on Post/Reply Page
« Reply #59 on: February 05, 2010, 07:51:23 AM »
Made it working at last  ;D

open

/themes/default/post.template.php

Find:

Code: [Select]
// Finally, the submit buttons.

Add Before:

Code: [Select]
echo '<div>
      <a onclick="window.open(\'url of html file\',\'POPUP\',\'width=280,height=540,scrollbars=0\');return false;" href="#"><img

src="url of img file" border="0"></a>
</div>';

http://www.simplemachines.org/community/index.php?topic=288169.msg1894568#msg1894568 << get images from 1st post

i've tested on RC2 Default curve theme n its working absolutely fine ....

i check Private message problem also n it's also vanished ;)
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved