dynamic images not allowed in signatures?

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
KreeganRonald
Registered User
Posts: 22
Joined: Sat Feb 26, 2005 7:26 pm

dynamic images not allowed in signatures?

Post by KreeganRonald »

Hi
I have a clan site with phpbb and mx portal , i have only 1 problem with sigs, i cant use dynamic signatures, all other images are easy attached as a signature. With dynamic signatures i mean a pic that shows ur current rate in the game . Anyone knows if theirs a mod so that it does work? I have heard from more ppl that they have the same problem . Thx i.a :)
tsjakkaa
Registered User
Posts: 261
Joined: Sat Mar 27, 2004 1:25 pm
Location: belgium
Contact:

Post by tsjakkaa »

do a search on "dynamic images" on this board, and you know why this is not possible. There are some security issues.


a solution is to let dynamic images appear as normal images, that gif-files are handled as php on your server (if you can do this on your host of course...)
Image
KreeganRonald
Registered User
Posts: 22
Joined: Sat Feb 26, 2005 7:26 pm

Post by KreeganRonald »

tsjakkaa wrote: do a search on "dynamic images" on this board, and you know why this is not possible. There are some security issues.


a solution is to let dynamic images appear as normal images, that gif-files are handled as php on your server (if you can do this on your host of course...)


thx how do i do that?
KreeganRonald
Registered User
Posts: 22
Joined: Sat Feb 26, 2005 7:26 pm

Post by KreeganRonald »

i tried this but it doesnt work

:
this can't be done, as the bbcode-parser only allows image extensions (ie jpg,jpeg,gif,png)

but it isn't that hard to change it to make php as an allowed extension.

search for this line in includes/bbcode.php
Code:
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);


just add php as extension to the regular expression:
Code:
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png|php)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
alcaeus
I've Been Banned!
Posts: 431
Joined: Wed Nov 19, 2003 1:12 pm

Post by alcaeus »

I highly recommend NOT doing that change you tried to do. Doing that could allow everyone with a little knowledge about phpBB to include an image url, which would delete a topic. As soon as a moderator sees the image, the script has enough rights to do what is requested, and off we go. I recommend using a second preg_replace for image-tags, in which you for one specific url (i.e. http://yourhost.com/gamestats.php). That will prevent the scenario described above

Greetz
alcaeus
KreeganRonald
Registered User
Posts: 22
Joined: Sat Feb 26, 2005 7:26 pm

Post by KreeganRonald »

i dont completely understand what u mean ? Could u explain which files i have to edit to get it working?
KreeganRonald
Registered User
Posts: 22
Joined: Sat Feb 26, 2005 7:26 pm

Post by KreeganRonald »

any1?
starfoxtj
Registered User
Posts: 3714
Joined: Tue Jul 29, 2003 2:01 am
Contact:

Post by starfoxtj »

Its easy I do it on my board all the time.

Just make a folder on a server named after a jpeg file:
image.jpg
Then inside that folder stick your dynamic script, and call it index.php

PHPBB will then think it is loading an image, but is in reality loading the dynamic image. :D
Admin ToolKit v2.1a - An Admins most helpful tool for user management. Now Supports Mass User Deletion!
Change User's: names, passwords, emails, active status and avatar/pm permissions.
Ban/Unban Users, change Post and Resync Counts, and promote/demote users to admin.
Completely independent from your phpbb user account settings. No installation required, just upload one file.
User Upload ToolKit Beta - A quick and easy, 30 second-install, attachment mod. Now Supports Dynamic Thumbnails!
User avatar
xdarkday
Registered User
Posts: 570
Joined: Sat Oct 11, 2003 7:51 am
Location: Arizona

Post by xdarkday »

starfoxtj wrote: Its easy I do it on my board all the time.

Just make a folder on a server named after a jpeg file:
image.jpg
Then inside that folder stick your dynamic script, and call it index.php

PHPBB will then think it is loading an image, but is in reality loading the dynamic image. :D
hmm i tried this. no dice.
User avatar
xdarkday
Registered User
Posts: 570
Joined: Sat Oct 11, 2003 7:51 am
Location: Arizona

Post by xdarkday »

and thinking further, if it did work this easy, could this be a security issue?
starfoxtj
Registered User
Posts: 3714
Joined: Tue Jul 29, 2003 2:01 am
Contact:

Post by starfoxtj »

Nope I already told Techi-Michal. He said its not a security issue.

But you said it didnt work? Hmmm...sure its named index.php? It works fine for me...look here:
Image


Note: It is more random with IE, I think its because FF does not always change the image since it is linking to the same image/script (only the header changes after it loads the 1.jpg folder). Im pretty sure it has something to do with the caching system of FF.
If you close and reopen firefox, it will load the new dynamic image.

Code: Select all

<?php

$rand = rand( 1,5 );

if( $rand == 1 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/smile-l.gif" );
   }

elseif( $rand == 2 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/usa.gif" );

   }

elseif( $rand == 3 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/scrambles.gif" );

   }

elseif( $rand == 4 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/rainbow.gif" );

   }

elseif( $rand == 5 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/jumphamster.gif" );

   }

?>
Last edited by starfoxtj on Fri Mar 25, 2005 10:10 pm, edited 1 time in total.
Admin ToolKit v2.1a - An Admins most helpful tool for user management. Now Supports Mass User Deletion!
Change User's: names, passwords, emails, active status and avatar/pm permissions.
Ban/Unban Users, change Post and Resync Counts, and promote/demote users to admin.
Completely independent from your phpbb user account settings. No installation required, just upload one file.
User Upload ToolKit Beta - A quick and easy, 30 second-install, attachment mod. Now Supports Dynamic Thumbnails!
User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit »

Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."
User avatar
xdarkday
Registered User
Posts: 570
Joined: Sat Oct 11, 2003 7:51 am
Location: Arizona

Post by xdarkday »

starfoxtj wrote: Nope I already told Techi-Michal. He said its not a security issue.

But you said it didnt work? Hmmm...sure its named index.php? It works fine for me...look here:
Image


Note: It is more random with IE, I think its because FF does not always change the image since it is linking to the same image/script (only the header changes after it loads the 1.jpg folder). Im pretty sure it has something to do with the caching system of FF.
If you close and reopen firefox, it will load the new dynamic image.

Code: Select all

<?php

$rand = rand( 1,5 );

if( $rand == 1 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/smile-l.gif" );
   }

elseif( $rand == 2 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/usa.gif" );

   }

elseif( $rand == 3 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/scrambles.gif" );

   }

elseif( $rand == 4 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/rainbow.gif" );

   }

elseif( $rand == 5 ) 

   {

	header( "Location: http://starfoxtj.no-ip.com/images/phpbb/smilies/jumphamster.gif" );

   }

?>

see, i was trying to pull some ssi off my SMF board....

check the link here... it works
https://camo.phpbb.com/deccb24f334847b0a8ea03c34b110a115fd4747e/687474703a2f2f7777772e7368616465646172742e6e65742f696e666f2e6a7067/
but if i try it as an images it shows it as not working
Image
Last edited by xdarkday on Fri Mar 25, 2005 10:21 pm, edited 3 times in total.
starfoxtj
Registered User
Posts: 3714
Joined: Tue Jul 29, 2003 2:01 am
Contact:

Post by starfoxtj »

Drop off the last /
Image

Edit:

it does not work because you are displaying text, not an image file.
You need to use GDI or similar to convert the text to a jpeg/gif etc.

Or just randomly link to a new image like I do.

No browser supports embedding text as an image, regardless of the software. (phpbb, or just plain html).
Admin ToolKit v2.1a - An Admins most helpful tool for user management. Now Supports Mass User Deletion!
Change User's: names, passwords, emails, active status and avatar/pm permissions.
Ban/Unban Users, change Post and Resync Counts, and promote/demote users to admin.
Completely independent from your phpbb user account settings. No installation required, just upload one file.
User Upload ToolKit Beta - A quick and easy, 30 second-install, attachment mod. Now Supports Dynamic Thumbnails!
User avatar
xdarkday
Registered User
Posts: 570
Joined: Sat Oct 11, 2003 7:51 am
Location: Arizona

Post by xdarkday »

starfoxtj wrote: Drop off the last /
Image

Edit:

it does not work because you are displaying text, not an image file.
You need to use GDI or similar to convert the text to a jpeg/gif etc.

Or just randomly link to a new image like I do.

No browser supports embedding text as an image, regardless of the software. (phpbb, or just plain html).
ahhh see i did not know. thanks
Locked

Return to “2.0.x Discussion”