Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Pause on January 25, 2005, 10:05:16 PM

Title: Image Upload from your board
Post by: Pause on January 25, 2005, 10:05:16 PM
Well, if your board is the sort that has a lot of people posting images, you don't really want your bandwidth getting wasted do you? So here are instructions on how to make it so that images can be linked from somewhere else, but uploaded from your board

Credit to ImageShack.us for permission to post this.


These instructions will help you to install ImageShack into the reply and post-new-thread sections of your Simple Machines Forum, thus giving your visitors the ability to upload images directly. After upload, they may paste the images directly into their post box.

Skip Step 1 if you are using the default theme: Your bgcolor is 1E1E1E and your txtcolor is 000000.

Step 1: Finding the background and text colors of your forum so that you may assign them to your iframe and have complete integration.

   1. Go to the reply or post-new-topic page.
   2. Hit print-screen. Open up a graphics-editing program such as Adobe Photoshop(tm).
   3. Open a new document and paste the print-screen data into it.
   4. Use the color selection tool to find the hexadecimal value of the color UNDER the posting box and ABOVE the "Post" button: Click the eyedropper tool.
      Move it to the area mentioned above and click on the picture.
      In your software's toolbar, a new color loads.
      Click on this color, and you will see a hexadecimal value for bgcolor. You can also zoom in and find the color of your text this way.

Step 2: Pasting the 'ImageShack on your Site' form inside your forum.

The file that you will be working with are located in the following directory:

/home/USER_NAME/www/YOUR_FORUM_DIRECTORY/Themes/default/

If you are using different template (not default), please go to the directory associated with THAT different template.

Some templates do not have a Post.template.php file. Also, make sure to backup your files before doing any modifications to them.

1. Open Post.template.php . You can do this by using ftp to download the file Post.template.php , and then uploading it back once you are finished editing it.

2. search for the following instance:
echo '
<script language="JavaScript" type="text/javascript"><!--
swapOptions();
// --></script>';



3. Add After:
echo '<iframe src="http://www.imageshack.us/iframe.php?bgcolor=FFFFFF&txtcolor=111111&type=blank" scrolling="no" frameborder="0" width="280" height="70"> You must have an iframe-compatable browser to view the ImageShack.us upload form.</iframe>';

4. Save your changes. Login to your forum. Either click "Post New Thread" or reply to an existing thread in order to test out your new Image Hosting Service!
Title: Re: Image Upload from your board
Post by: raedzaro on March 26, 2005, 06:04:37 AM
Thanks but how can Make it for Avatars?
Title: Re: Image Upload from your board
Post by: Gobo on November 25, 2005, 06:20:37 PM
hi
thanks for the useful tip just what I needed

I just wanted to mention though that instead of making the color picking such a complicated task use this FREE utility called TribalXColor Picker

its small and works awesome...a very small window appear op top of all other apps and all u have to do is drag the color picker from its color picker square on to ANY thing which is on the screen and it will display its HEX codes as well as RGB and others

This is a MUST have for all people who deal with HEX color codes

http://dl.winsite.com/bin/Info?12500000038210

download available at winsite

Enjoy
Title: Re: Image Upload from your board
Post by: nitecrawler on May 28, 2006, 03:27:51 AM
If you are using Firefox, then you can use Colorzilla extension for picking up the colour from any page. Just a mouse click is enough! :)
Title: Re: Image Upload from your board
Post by: LCar on June 07, 2007, 05:43:40 PM
I'm new to SMF and this post helped me a lot!
Is there a way to use www.servimg.com instead of imageshack.us?
It's because www.servimg.com has a 2mb limit instead of 1.5 of imageshack.us.
Hope you can help me.
Thanks in advance!
Cheers
Title: Re: Image Upload from your board
Post by: brandonroy on January 24, 2009, 03:49:06 AM
I cannot get this uploader above the post/preview buttons for the life of me! No matter where I pput the code in post.template.php It always either goes aboce the topic summary or at the very top of the post page above the subject box
Title: Re: Image Upload from your board
Post by: enjoy1985 on January 25, 2009, 10:22:49 PM
 nice tip
thanks you.
Title: Re: Image Upload from your board
Post by: FlixyaFriend on February 05, 2009, 02:30:24 PM

thanks for the useful tip  ;D
Title: Re: Image Upload from your board
Post by: Rumbaar on March 10, 2009, 11:08:04 PM
Note brandonroy, that this tip was written in 2005, I'm sure the template layouts have changed since then.  You might have to tweak the code to match current template layouts.
Title: Re: Image Upload from your board
Post by: willerby on January 05, 2010, 03:36:49 AM
Do these edits work for SMF RC2? Have just about had it with Simple Image Upload mod...

W
Title: Re: Image Upload from your board
Post by: Arantor on January 05, 2010, 04:02:50 AM
I highly doubt it will work; the code is over 4 years old, and the 2.0 theme code is all replaced compared to 1.1.
Title: Re: Image Upload from your board
Post by: RikĀ© on January 05, 2010, 04:47:13 AM
Hi  8)

There already is the Simple ImageShack mod, only for SMF1.
But i'm working on version 3 which will be released for SMF 1.1.x this week.
Then i'll start coding v3.1.0 for SMF2.
SIS v3 will have the option to add tags, upload into ImageShack account and more.

If you want to see the beta in action just register @ http://SimpleTweaks.co.nr and pm me

-RikĀ©
Title: Re: Image Upload from your board
Post by: willerby on January 05, 2010, 12:43:26 PM
Thanks Rik. If you need a beta tester for SMF2 RC2 I'd be happy to get involved. A simple, reliable, external image hosting service seems to be impossible to obtain for RC2.

I have older generation members who just want to upload an image to their posts and as they have no idea how to resize or create flickr, photobucket etc accounts I am currenly at a loss.

Attachments are ok but killing my server!

Title: Re: Image Upload from your board
Post by: GrumpiGrampi on January 05, 2010, 02:32:31 PM
I just wanted to say that I am in the same boat as you, as my forum also caters primarily to the older generation. Let me know if you find a solution.
Title: Re: Image Upload from your board
Post by: willerby on January 07, 2010, 03:59:48 PM
I thought I'd give this code a go on my test RC2 forum and it works fine.

Edits are still to post.template.php and I chose to put it above the attachments section eg.

Search for
// If this post already has attachments on it - give information about them.


Add BEFORE:
//IMAGESHACK
echo '<iframe src="http://www.imageshack.us/iframe.php?bgcolor=FFFFFF&txtcolor=111111&type=blank" scrolling="no" frameborder="0" width="280" height="70"> You must have an iframe-compatable browser to view the ImageShack.us upload form.</iframe>';


I only decided against using it as I'm waiting for Rik's simpler imageshack mod for RC2 - this one uploads the image to imageshack and opens it in a new browser window. Users then copy and paste from a range of url, html and bbc options under the image and insert that into their post.

Unfortunately that last step would confuse half my users  ::)

Nice code for other forums though and works neatly...
Title: Re: Image Upload from your board
Post by: CultureGlue on January 12, 2010, 09:54:56 AM
looks usefull.. uhm.. it is