News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Simple Image Upload

Started by Sium, March 02, 2009, 12:01:05 PM

Previous topic - Next topic

def

Simple Image Upload does not work with SimpleSEF. As noted above, with PrettyURL too.
To correct interaction with SimpleSEF, you must

found in the file Themes/default/GenericControls.template.php string containing hxxp:postimage.org [nonactive].
In this string should be replaced
escape (document.location.href)
on
escape (\''. $ scripturl. '? topic ='. $ context ['current_topic']. '.0 \')

Possibly this may help and with PrettyURL

Inti31

#121
Hey, that works fine with RC5 - I just modifed the link language to german, that's all.

Thx Inti31
my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

mariusfv

I do not understand how this mod is compatible with RC5, I've used this mod on 1.1.11-1.1.13  without problems, I install this on RC5 without problems but when i try to add image always I get a 404 ERROR.

I check and addform.html is on forum root directory, I don't have Pretty url and SEF url installed(I had installed this mods but I've uninstall them without errors).
Have someone a solution for this 404 error or isn't compatible with RC5 ?...it upload the image but after redirect I get 404 not found.
All users love this mod ... is so easy to use.
Please help.

Sium

New version released!

I changed the algorithm, if you found bugs please write here

Quote from: def on April 03, 2011, 01:52:08 PM
Simple Image Upload does not work with SimpleSEF. As noted above, with PrettyURL too.

Fixed

Quote from: Inti31 on April 04, 2011, 05:03:56 PM
Hey, that works fine with RC5 - I just modifed the link language to german, that's all.

Thx Inti31

Tested on the latest SMF versions, everything works
Image Hosting [nofollow] - Simple Image Upload Mod [nofollow]

Sium

#124
Manual Installation:


#
#-----[ OPEN ]---------------------------------------------
#

./Themes/default/index.template.php

#
#-----[ FIND ]---------------------------------------------
#

</head>

#
#-----[ REPLACE WITH ]---------------------------------------------
#

<script language="javascript" type="text/javascript">
<!--

// MOD Title: Simple Image Upload
// MOD Author: Sium < [email protected] > (N/A) http://www.postimage.org/
// MOD Version: 1.3.0

var postimage_lang="english";
var postimage_add_text="Add image to post";
var postimage_textarea_ignore_name=/username_list|search/i;

function postimage_query_string(postimage_search_name)
{
postimage_query=window.location.search.substring(1).split("&");
for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++)
{
postimage_string_data=postimage_query[postimage_i].split("=");
if(postimage_string_data[0]==postimage_search_name)
{
return unescape(postimage_string_data[1]);
}
}
}
function postimage_add_code()
{
if(opener)
{
var postimage_text=postimage_query_string("postimage_text");
if(postimage_text)
{
var postimage_id=postimage_query_string("postimage_id");
var postimage_area=opener.document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(postimage_i==postimage_id)
{
break;
}
}
if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled)
{
opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
}
else
{
postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
}
opener.focus();
window.close();
}
}
}
function postimage_insert()
{
var postimage_area=document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(!postimage_area[postimage_i].name.match(postimage_textarea_ignore_name))
{
var postimage_new_div=document.createElement("div");
postimage_new_div.innerHTML="<br />&nbsp;&bull;&nbsp;<a href=\"javascript:void(0);\" onclick=\"window.open(\'http://www.postimage.org/index.php?mode=smf&amp;lang="+postimage_lang+"&amp;areaid="+postimage_i+"&amp;forumurl=\' + escape(document.location.href), \'postimage\', \'resizable=yes,width=500,height=400\');return false;\"><b>"+postimage_add_text+"</b></a><br /><br />";
postimage_area[postimage_i].parentNode.insertBefore(postimage_new_div,postimage_area[postimage_i]);
}
}
}
postimage_add_code();
window.onload=postimage_insert;
//-->
</script>
</head>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
Image Hosting [nofollow] - Simple Image Upload Mod [nofollow]

City Builder

#125
In RC4 this messes up the areas of the forum where you try to select a username by typing it in and having the server bring up the possible list of names you are trying to find in your memberbase, like typing in a name for sending mail etc.

At least it does on mine.  It basically prevents that from working.

Any clues how to fix this problem?

Quote from: Sium on May 16, 2011, 10:15:40 PM
Manual Installation:

#
#-----[ OPEN ]---------------------------------------------
#

./Themes/default/index.template.php

#
#-----[ FIND ]---------------------------------------------
#

</head>

#
#-----[ REPLACE WITH ]---------------------------------------------
#

<script language="javascript" type="text/javascript">
<!--

// MOD Title: Simple Image Upload
// MOD Author: Sium < [email protected] > (N/A) http://www.postimage.org/
// MOD Version: 1.3.0

var postimage_lang="english";
var postimage_add_text="Add image to post";
var postimage_textarea_ignore_name=/username_list|search/i;

function postimage_query_string(postimage_search_name)
{
postimage_query=window.location.search.substring(1).split("&");
for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++)
{
postimage_string_data=postimage_query[postimage_i].split("=");
if(postimage_string_data[0]==postimage_search_name)
{
return unescape(postimage_string_data[1]);
}
}
}
function postimage_add_code()
{
if(opener)
{
var postimage_text=postimage_query_string("postimage_text");
var postimage_id=postimage_query_string("postimage_id");
var postimage_area=opener.document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(postimage_i==postimage_id)
{
break;
}
}
if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled)
{
opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
}
else
{
postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
}
opener.focus();
window.close();
}
}
function postimage_insert()
{
var postimage_area=document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(!postimage_area[postimage_i].name.match(postimage_textarea_ignore_name))
{
var postimage_new_div=document.createElement("div");
postimage_new_div.innerHTML="<br />&nbsp;&bull;&nbsp;<a href=\"javascript:void(0);\" onclick=\"window.open(\'http://www.postimage.org/s1/index.php?mode=smf&amp;lang="+postimage_lang+"&amp;areaid="+postimage_i+"&amp;forumurl=\' + escape(document.location.href), \'postimage\', \'resizable=yes,width=500,height=400\');return false;\"><b>"+postimage_add_text+"</b></a><br /><br />";
postimage_area[postimage_i].parentNode.insertBefore(postimage_new_div,postimage_area[postimage_i]);
}
}
}
postimage_add_code();
window.onload=postimage_insert;
//-->
</script>
</head>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#


wiecher

#126
I get a popup and after the  photo  uploading it disappears again

Sium

#127
Quote from: wiecher on May 17, 2011, 06:07:05 AM
I get a popup and after the  photo  uploading it disappears again

Send me the URL for testing

QuoteAny clues how to fix this problem?

What browser do you use?

I do not see any errors on my forum, take a screenshot or write a forum URL via PM
Image Hosting [nofollow] - Simple Image Upload Mod [nofollow]

lord alibaski

Nice mod m8

I used the manual option

<script language="javascript" type="text/javascript">
<!--

// MOD Title: Simple Image Upload
// MOD Author: Sium < [email protected] > (N/A) http://www.postimage.org/
// MOD Version: 1.3.0

var postimage_lang="english";
var postimage_add_text="Add image to post";
var postimage_textarea_ignore_name=/username_list|search/i;

function postimage_query_string(postimage_search_name)
{
postimage_query=window.location.search.substring(1).split("&");
for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++)
{
postimage_string_data=postimage_query[postimage_i].split("=");
if(postimage_string_data[0]==postimage_search_name)
{
return unescape(postimage_string_data[1]);
}
}
}
function postimage_add_code()
{
if(opener)
{
var postimage_text=postimage_query_string("postimage_text");
var postimage_id=postimage_query_string("postimage_id");
var postimage_area=opener.document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(postimage_i==postimage_id)
{
break;
}
}
if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled)
{
opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
}
else
{
postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
}
opener.focus();
window.close();
}
}
function postimage_insert()
{
var postimage_area=document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(!postimage_area[postimage_i].name.match(postimage_textarea_ignore_name))
{
var postimage_new_div=document.createElement("div");
postimage_new_div.innerHTML="<br />&nbsp;&bull;&nbsp;<a href=\"javascript:void(0);\" onclick=\"window.open(\'http://www.postimage.org/s1/index.php?mode=smf&amp;lang="+postimage_lang+"&amp;areaid="+postimage_i+"&amp;forumurl=\' + escape(document.location.href), \'postimage\', \'resizable=yes,width=500,height=400\');return false;\"><b>"+postimage_add_text+"</b></a><br /><br />";
postimage_area[postimage_i].parentNode.insertBefore(postimage_new_div,postimage_area[postimage_i]);
}
}
}
postimage_add_code();
window.onload=postimage_insert;
//-->
</script>
</head>


Though when uploading an image and leaving it on "do not resize" when inserted the image actually gets resized to thumbnail size for some reason!!

City Builder

I think the do no resize, actually means do not resize the image on the server.

I'm using chrome, and I've tried it in Internet Explorer 8 as well, and the (I guess javascript) function to add a persons name to a PM or the like just doesn't work anymore if I leave this in place.

Sorry, I'm not sure what I would actually take a screenshot of,

UKShark

I normally use the following type of coding for banner images throughout my forum...

<a href="http://www.mysite.com"><img src="http://www.mysite.com/images/myimage.jpg" alt="My Banner" title="My Banner" /></a>

However it now appears follows when viewed...

[img alt=My Banner" title="My Banner]http://www.mysite.com/images/myimage.jpg[/img]

This has happened across the site since installing this mod and still happens when I uninstall it.

Any ideas how to fix it?

Inti31

#131
I like this mod! But I prefer the old method was used by v1.1.0 by modifying generictemplate.php

I added a second hoster - okay, that one does not allow to put the links automatically in the textarea, but: It's a second hoster.


<div>
&nbsp;&bull;&nbsp;<a href="javascript:void(0);" onclick="window.open(\'http://www.postimage.org/index.php?mode=smf&amp;lang=german&amp;forumurl=\' + escape(document.location.href), \'_imagehost\', \'resizable=yes,width=500,height=400\');return false;">Bild hinzuf&#252;gen (postimage.org)</a><br />&nbsp;&bull;&nbsp;<a href="javascript:void(0);" onclick="window.open(\'http://www.bilder-hochladen.net/index.php?mode=smf&amp;forumurl=\' + escape(document.location.href), \'_imagehost\', \'resizable=yes,width=850,height=700\');return false;">Bild hinzuf&#252;gen (bilder-hochladen.net)</a><br /><br />
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '</textarea>
</div>





2nd Hoster Upload-picture:


my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

Fat D

Did anyone get this to work with the WYSIWYG editor from SMF 2.0? It does not work at the forum I administrate, and switching back and forth between editors is hardly an elegant solution.

Also, may I suggest using addLoadEvent() instead of overloading window.onload? The latter breaks a few features (such as PM popup notifications) and some other extensions.

ModelBoatMayhem

I've just had to uninstall this mod AGAIN!!! Porn adverts despite selecting FAMILY SAFE - very annoyed!
That's my firm opinion.... but what do I know?!

UKShark

Quote from: UKShark on June 30, 2011, 08:31:08 AM
I normally use the following type of coding for banner images throughout my forum...

<a href="http://www.mysite.com"><img src="http://www.mysite.com/images/myimage.jpg" alt="My Banner" title="My Banner" /></a>

However it now appears follows when viewed...

[img alt=My Banner" title="My Banner]http://www.mysite.com/images/myimage.jpg[/img]

This has happened across the site since installing this mod and still happens when I uninstall it.

Any ideas how to fix it?

Could somebody please address my issue? It's been a problem for weeks now and I'm no closer to finding a solution :(

ModelBoatMayhem

Quote from: ModelBoatMayhem on July 06, 2011, 09:36:03 AM
I've just had to uninstall this mod AGAIN!!! Porn adverts despite selecting FAMILY SAFE - >:(

They've removed it again!    :D
That's my firm opinion.... but what do I know?!

Rain Forest

Will Post Image.org remove images after a while?

Andres.

Is there a way to make it work in SMF 2.0.1? Or is there any other mod that does the same? I have Pretty urls installed.
Thank you.

Hackathon

Quote from: Andres. on October 10, 2011, 01:12:43 PM
Is there a way to make it work in SMF 2.0.1? Or is there any other mod that does the same? I have Pretty urls installed.
Thank you.

Have you tried to manually install it?

Andres.

Quote from: Hackathon on October 10, 2011, 01:18:16 PM
Have you tried to manually install it?

Yes, but it doesn't work, I get the error page.

Advertisement: