Re: Automatic Image Upload with Thumbnails

Koos wrote:
beipink wrote:

A nice, very nice feature would be to put text next to the image, like in the magazines. To get that is quite easy, an example here below

Thanks for the idea - but it is already possible to to this. Just type your text right after inserting the code of the image - the text will then display next to the image.

How??

27 (edited by MattF 2007-04-04 12:14)

Re: Automatic Image Upload with Thumbnails

Firstly, top mod Koos. smile

Secondly, I think the format for adding text after the image is:

[url][img][img]"Type your text here"[url].


You may have to experiment and double check though. big_smile

28 (edited by Koos 2007-04-04 13:39)

Re: Automatic Image Upload with Thumbnails

beipink wrote:
Koos wrote:
beipink wrote:

A nice, very nice feature would be to put text next to the image, like in the magazines. To get that is quite easy, an example here below

Thanks for the idea - but it is already possible to to this. Just type your text right after inserting the code of the image - the text will then display next to the image.

How??

Like this:

[url=http://www.mydomain.com/forum/uploads/2_0002.JPG][img]http://www.mydomain.com/forum/uploads/thumbs/2_0002.JPG[/img][/url]Koos

example:
http://i168.photobucket.com/albums/u200 … etext1.png

The secret is not to hit the enter button. Use spacebar if you want to leave a gap between the image and text.
example:
http://i168.photobucket.com/albums/u200 … etext2.png

But I think you meant how to insert a paragraph next to an image. I don't think this is possible without editing the parser.

I tried your suggestion of editing the include/parser.php file - but it did not work for me.

29

Re: Automatic Image Upload with Thumbnails

Is there a way to delete the uploaded files when logged in as admin ?
I see no link for this.

Landen Meadows Residents Forum - http://www.landenmeadows.net

Re: Automatic Image Upload with Thumbnails

Koos wrote:

But I think you meant how to insert a paragraph next to an image. I don't think this is possible without editing the parser.

I tried your suggestion of editing the include/parser.php file - but it did not work for me.

That's what I mean body.
Well if you change the parser.php like I said in previous post you'll get it but it's not enough becaue u need to set if you want to align the photo right center or left!

If I got time I'll work it out how to modify the parser too

31 (edited by Koos 2007-04-11 14:53)

Re: Automatic Image Upload with Thumbnails

I have made another update. Version 1.2.2 is now available. I had to make some important fixes and changes. Here is what has changed since v1.2.1:

* totals now shown in the 'upload statistics' table
* added language support
* fixed: upload not saved if thumbnail can not be created
* fixed: PNG Image file interpretation problem in IE (ie6 sends image/x-png instead of image/png)
* other minor changes

A big thanks to FSX (Dutch), Super_baloo8 (French), lie2815 (German) and Thor (Swedish) for their translations.

32 (edited by axa 2007-04-11 00:19)

Re: Automatic Image Upload with Thumbnails

Update works just fine - although what am I missing here ? - I left the uploadimg_config.php untouched - yet still, users can upload files exceeding the 200 kb maximum.
Also - when logged in a a normal member with permission to upload, I tried to upload a 1.2 meg jpg to test the limits, and was prompted to download the file uploadimg.php ???!!!

Landen Meadows Residents Forum - http://www.landenmeadows.net

33 (edited by Koos 2007-04-11 11:29)

Re: Automatic Image Upload with Thumbnails

axa wrote:

Update works just fine - although what am I missing here ? - I left the uploadimg_config.php untouched - yet still, users can upload files exceeding the 200 kb maximum.

You might have a different version of php on your web server. Try the following:

On line 223 of uploadimg.php

replace

if (($size_limit == "yes") && ($limit_sizef < $imagefile_size)) { // file size must be less than $limit_sizef ****

with

if (($size_limit == "yes") && ($limit_sizef < $_FILES['imagefile']['size'])) { // file size must be less than $limit_sizef ****

Thanks for letting me know about this. It's actually better to use $_FILES['imagefile']['size']) - I have updated the v1.2.2 download file.

axa wrote:

Also - when logged in a a normal member with permission to upload, I tried to upload a 1.2 meg jpg to test the limits, and was prompted to download the file uploadimg.php ???!!!

I think this is a PHP memory issue. Read what I said about this here: http://punbb.org/forums/viewtopic.php?pid=90284#p90284

But the fact that you were prompted to download the file uploadimg.php is very strange - I can not explain than.

Re: Automatic Image Upload with Thumbnails

To get around people leeching bandwidth I have two ideas. The first being, if you believe that a user is purposely uploading images on your site to simply post them on other boards/sites you simply log in to your FTP and change the image to something like below:

http://www.chopaway.com/steal.jpg

Everywhere they have posted the image will automatically change, thus making the user look like a complete wanker, and giving your site free promotion. (Sidenote: Perhaps an auto watermark feature could be implemented to all uploaded images?)

If the user has seriously abused your good nature and posted dozens of photos on other boards the answer is simple. Delete the images from your board (if they are posted anywhere) and change them all into porn photos. The user will get banned from every other board he posted them on haha.
---
Could a small plugin be made for the admin section which automatically searches Google.com for :

http://www.yourdomain.com/boardroot/uploads/

Would this allow you to easily monitor which sites have images posted, that are hosted by your website?

35

Re: Automatic Image Upload with Thumbnails

It may have been posted already, but this link is pretty handy for adding code to your .htaccess to prohibit hotlinking images...

http://www.htaccesstools.com/hotlink-protection/

Landen Meadows Residents Forum - http://www.landenmeadows.net

Re: Automatic Image Upload with Thumbnails

axa wrote:

It may have been posted already, but this link is pretty handy for adding code to your .htaccess to prohibit hotlinking images...

http://www.htaccesstools.com/hotlink-protection/

The only problem with this method, as far as I can see though is that ANY image hosted on my site would immediately not appear on other websites I posted it on myself. For example, on some message boards I have my own signature image (which is hosted on my webspace).... this would automatically be blocked.

I work on two forums of the exact same subject matter and often have to post the same information on both forums. So when I come to post the information on the second forum, the image would be blocked by my .htaccess file ~ even though I want it to appear.

Does that make sense? I dont know much about how .htaccess works so there may be an easy way to get around this

Re: Automatic Image Upload with Thumbnails

.htaccess-based protection works on a per-directory basis, so as long as the directory that contains your signature image is not protected, you should be fine.

Looking for a certain modification for your forum? Please take a look here before posting.

38

Re: Automatic Image Upload with Thumbnails

I used to do this:

RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/ [NC]
RewriteRule .*\.(jpg|gif|bmp|png)$ hotlink.jpg [L]

I kept adding lines according to what my AWStats report looked like.

39

Re: Automatic Image Upload with Thumbnails

one thing i thought of is adding a watermark script to the system. that is a link back to your site.

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Automatic Image Upload with Thumbnails

what if YOU don't want your watermark to show on your site? wink

~James
FluxBB - Less is more

41

Re: Automatic Image Upload with Thumbnails

Dr J. there you go with that bubble busting... again!
Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Automatic Image Upload with Thumbnails

Dr.Jeckyl wrote:

what if YOU don't want your watermark to show on your site? wink

You might be able to write a rewrite rule / condition pair that upon hits from a "foreign" referrer passes the filename of the image as a parameter to a PHP script that automatically watermarks it. You'd need to implement some sort of caching to keep your server from being hammered.

If you have some sort of image upload system on your forum, you might instead modify it to save both an original image and watermarked image upon upload, and write a rewrite rule to reflect that.

Looking for a certain modification for your forum? Please take a look here before posting.

43

Re: Automatic Image Upload with Thumbnails

Hi koos and thx for your project! I was waiting a thing like that a LOT!

I have just a small problem with image with res like :600*900.

When width is > height i got some probleme:

L'image a été envoyée avec succès.

Warning: imagecreate() [function.imagecreate]: Invalid image dimensions in /home/www/61bf61bf2322e29da50b66a34dc41e18/web/forums/uploadimg.php on line 268

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/www/61bf61bf2322e29da50b66a34dc41e18/web/forums/uploadimg.php on line 275

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/www/61bf61bf2322e29da50b66a34dc41e18/web/forums/uploadimg.php on line 275

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/www/61bf61bf2322e29da50b66a34dc41e18/web/forums/uploadimg.php on line 275
....
...

Im playing around  with :

 if ($currwidth < $twidth ) {    // If the Current Image Width is Less than the Thumbnail Width ****

to something like

 if ($currwidth < $currheight ) {    // If the Current Image Width is Less than the Thumbnail Width ****

but as you can imagine it goes nowhere cause i dont know so much about php...
It will be gret if you can help me a little, btw THANKS!

44 (edited by Koos 2007-04-22 23:48)

Re: Automatic Image Upload with Thumbnails

onecut wrote:

Hi koos and thx for your project! I was waiting a thing like that a LOT!

I have just a small problem with image with res like :600*900.

When width is > height i got some probleme:

I discovered earlier this week that there is a small bug with the script calculating the thumbnail resize width and height.  Try the following to see if it will fix your problem. I will include this fix in the next version (v1.3.0).

#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

uploadimg.php

#
#---------[ 2. FIND (line: 246) ]-----------------------------------------------
#

      $currwidth = imagesx($simg);   // Current Image Width
      $currheight = imagesy($simg);   // Current Image Height
      if ($currheight > $currwidth) {   // If Height Is Greater Than Width
         $zoom = $twidth / $currheight;   // Length Ratio For Width
         $newheight = $theight;   // Height Is Equal To Max Height
         $newwidth = $currwidth * $zoom;   // Creates The New Width
      } else {    // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height)
        $zoom = $twidth / $currwidth;   // Length Ratio For Height
        $newwidth = $twidth;   // Width Is Equal To Max Width
        $newheight = $currheight * $zoom;   // Creates The New Height
      }

#
#---------[ 3. REPLACE WITH ]--------------------------------------------------
#

      $currwidth = imagesx($simg);   // Current Image Width
      $currheight = imagesy($simg);   // Current Image Height
      
         $zoomw = $currwidth/$twidth;
         $zoomh = $currheight/$theight;

            if ($zoomw > $zoomh) {
              $zoom = $zoomw;
                      }

            else {
              $zoom = $zoomh;
                }

           $newwidth = $currwidth/$zoom;
           $newheight = $currheight/$zoom;

45 (edited by Bjorn 2007-04-20 09:01)

Re: Automatic Image Upload with Thumbnails

Hi,

I dont get it to work, nothin happens?

Also if I try the statistics i get following error:
Warning: Invalid argument supplied for foreach() in d:\customers\kullberg.nu\wwwroot\forum\uploadimg_stats.php on line 533
Warning: Invalid argument supplied for foreach() in d:\customers\kullberg.nu\wwwroot\forum\uploadimg_stats.php on line 589

Can it be that nothin is uploaded?

My Server where the forum is:
gd

GD Support  enabled 
GD Version  bundled (2.0.28 compatible) 
FreeType Support  enabled 
FreeType Linkage  with freetype 
FreeType Version  2.1.9 
T1Lib Support  enabled 
GIF Read Support  enabled 
GIF Create Support  enabled 
JPG Support  enabled 
PNG Support  enabled 
WBMP Support  enabled 
XBM Support  enabled 



/Björn

46

Re: Automatic Image Upload with Thumbnails

thx a lot for quick answer.

It seems to works but i get a

"Warning: Division by zero in /home/www/xxxxxxxxxxxxx/web/forums/uploadimg.php on line 250"

message in the same time that i get the links (who are working).

thx, cu, onecut

47 (edited by Koos 2007-04-22 23:50)

Re: Automatic Image Upload with Thumbnails

Bjorn wrote:

Also if I try the statistics i get following error:
Warning: Invalid argument supplied for foreach() in d:\customers\kullberg.nu\wwwroot\forum\uploadimg_stats.php on line 533
Warning: Invalid argument supplied for foreach() in d:\customers\kullberg.nu\wwwroot\forum\uploadimg_stats.php on line 589

Thanks for letting me know. This happens because the uploads folder is still empty (nothing has been uploaded yet), so the "contents" arrays are empty. To fix this these arrays must be declared. I will include this fix in the next version (v1.3.0).

#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

uploadimg_stats.php

#
#---------[ 2. FIND (line: 75) ]-----------------------------------------------
#

$file_prefix = $pun_user['id']."_"; // the pun user id is used as the prefix for all uploaded files
$prefix_length = strlen($file_prefix);

#
#---------[ 3. AFTER, ADD ]--------------------------------------------------
#

$nuwearray = array();
$tmp_array = array();
Bjorn wrote:

Can it be that nothin is uploaded?

My Server where the forum is:
gd

GD Support  enabled 
GD Version  bundled (2.0.28 compatible) 
FreeType Support  enabled 
FreeType Linkage  with freetype 
FreeType Version  2.1.9 
T1Lib Support  enabled 
GIF Read Support  enabled 
GIF Create Support  enabled 
JPG Support  enabled 
PNG Support  enabled 
WBMP Support  enabled 
XBM Support  enabled 

/Björn

Can you also please get the following info for me (using  <? phpinfo() ?>)

At the very top of the page:
*PHP Version

Under Configuration - PHP Core:
(on or off?)
*safe_mode
*safe_mode_gid

*magic_quotes_gpc
*magic_quotes_runtime
*magic_quotes_sybase

At the bottom of the page:
Under Environment:
*TERM

Did you remember to CHMOD the uploads and uploads/thumbs directories to 777?

What happens right after trying to upload an image? Do you get an error message?


onecut wrote:

thx a lot for quick answer.

It seems to works but i get a

"Warning: Division by zero in /home/www/xxxxxxxxxxxxx/web/forums/uploadimg.php on line 250"

message in the same time that i get the links (who are working).

thx, cu, onecut

Did you change anything in the uploadimg_config.php file?

It seems the problem is with the following two lines:

         $zoomw = $currwidth/$twidth;
         $zoomh = $currheight/$theight;

if $twidth and $theight is not set in the uploadimg_config.php file - you will get a 'Division by zero' error.

try replacing the above with

         $zoomw = $currwidth/150;
         $zoomh = $currheight/150;

to see if it fixes the problem.

48 (edited by Bjorn 2007-04-20 11:00)

Re: Automatic Image Upload with Thumbnails

Can you also please get the following info for me (using  <? phpinfo() ?>)

At the very top of the page:
*PHP Version

Under Configuration - PHP Core:
(on or off?)
*safe_mode
*safe_mode_gid

*magic_quotes_gpc
*magic_quotes_runtime
*magic_quotes_sybase

At the bottom of the page:
Under Environment:
*TERM

PHP Version 5.1.6

My values are:
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off

magic_quotes_gpc | Off | Off
magic_quotes_runtime | Off | Off
magic_quotes_sybase | Off | Off

Don't find TERM (you don't mean License Terms?)

I don't get any Error Messages, it just goes from 'Select Image to Upload' screen And when I press 'Send' (skicka in Sweden) it goes to the 'Result' screen but there is nothing and no images in uploads or uploads/thumbs.

I've changed the read/write/create/delete to ALLOW on both uploads and thumbs directories through my Control Panel my Webhosting has.

/Björn

49

Re: Automatic Image Upload with Thumbnails

Bjorn wrote:

I don't get any Error Messages, it just goes from 'Select Image to Upload' screen And when I press 'Send' (skicka in Sweden) it goes to the 'Result' screen but there is nothing and no images in uploads or uploads/thumbs.

Is the results page completely empty? Can you see a box displayed which says:

Kopiera och klistra in följande i meddelandefältet när du skriver ditt inlägg (Swedish)
or
Copy and Paste the following into the message box of your post (English)

Can you also get me the following values in your php.ini file:

*file_uploads
*max_execution_time
*memory_limit
*post_max_size
*upload_max_filesize
*upload_tmp_dir

50

Re: Automatic Image Upload with Thumbnails

Koos wrote:
Bjorn wrote:

I don't get any Error Messages, it just goes from 'Select Image to Upload' screen And when I press 'Send' (skicka in Sweden) it goes to the 'Result' screen but there is nothing and no images in uploads or uploads/thumbs.

Is the results page completely empty? Can you see a box displayed which says:

Kopiera och klistra in följande i meddelandefältet när du skriver ditt inlägg (Swedish)
or
Copy and Paste the following into the message box of your post (English)

Can you also get me the following values in your php.ini file:

*file_uploads
*max_execution_time
*memory_limit
*post_max_size
*upload_max_filesize
*upload_tmp_dir

The results page is completely empty, with no error message.

*file_uploads = ON
*max_execution_time = 30
*memory_limit = dont have this value...
*post_max_size = 8M
*upload_max_filesize = 10M
*upload_tmp_dir = no value (that is the value is 'no value') smile

/Björn