vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Random Image works as direct link, but doesn't work in the IMG tag... (https://vborg.vbsupport.ru/showthread.php?t=40363)

wooolF[RM] 06-27-2002 09:51 PM

Random Image works as direct link, but doesn't work in the IMG tag...
 
]Hello everyone... I used following script to push a random picture:
Code:

<?php
$logodir = "http://www.somewhere.com/pics/";

header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=file.jpg');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');

$logos = array
(
        $logodir . "1.jpg",
        $logodir . "2.jpg",
        $logodir . "3.jpg",
        $logodir . "4.jpg",
        $logodir . "5.jpg",
        $logodir . "6.jpg"
);

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());

$logo = rand(0, count ($logos) - 1);
$titleimage = $logos[$logo];
?>

<?php
echo "<img src=$titleimage>";
?>

Then I saved that script as sig.php and uploaded in the same folder where pics are. Then I checked http://www.somewhere.com/pics/sig.php and it worked like a charm...

Now... I went to my VBB forum and made a new VBB code :

vB Code tag
adminimgonly

vB Code replacement
<img src="{param}">

vB Code example
[adminimgonly]http://www.google.com/images/logo.gif[/adminimgonly]

vB Code explanation
Adds an IMAGE to a signature for ADMINS only.

Use {option} ?
Yes No

And tried it out in my signature as
Code:

[adminimgonly]http://www.somewhere.com/pics/sig.php[/adminimgonly]
. Do u think it worked? nope! :(
But direct access
Code:

[adminimgonly]http://www.somewhere.com/pics/1.jpg[/adminimgonly]
to the picture worked fine (just showing that this vBB code works perfectly)

In the source code I could clearly see plain html language
Code:

< img src="http://www.somewhere.com/pics/sig.php" >
which should work but didn't (showed only place for the pix with X in the top left corner of it) :(

Anyone have any ideas? :(

shovel 06-27-2002 10:29 PM

&nbsp;&nbsp;&nbsp;&nbsp;Just a question but have you had any regular registered members try it to see if it works?

wooolF[RM] 06-27-2002 10:43 PM

]nope I haven't... I tried it on another pc at the same home network - same result :(

shovel 06-28-2002 02:45 PM

&nbsp;&nbsp;&nbsp;&nbsp;I think personally that the direct link is plainly bypassing as an image tag like:
Code:

[*img]the image address[*/img]
Would be just as:
Code:

[adminimgonly]http://www.somewhere.com/pics/1.jpg[/adminimgonly]
Do you have html or php enabled in the signatures?

wooolF[RM] 06-29-2002 11:46 AM

no, html/php + img tag is disabled... that's why I made new vBB code...

Xenon 06-29-2002 01:05 PM

woolfe try this code in your sig.php file:


PHP Code:

<?php
$logodir 
"http://www.somewhere.com/pics/";

header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=file.jpg');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');

$logos = array
(
    
$logodir "1.jpg",
    
$logodir "2.jpg",
    
$logodir "3.jpg",
    
$logodir "4.jpg",
    
$logodir "5.jpg",
    
$logodir "6.jpg"
);

function 
make_seed() {
    list(
$usec$sec) = explode(' 'microtime());
    return (float) 
$sec + ((float) $usec 100000);
}
srand(make_seed());

$logo rand(0count ($logos) - 1);

$im imagecreatefromjpeg($logos[$logo]);
Imagejpeg($im);
Imagedestroy($im);
?>


wooolF[RM] 06-29-2002 01:42 PM

]lemme try :)

(will edit this message as soon as I have tried :) )

wooolF[RM] 06-29-2002 01:43 PM

erm....

$im = imagecreatefromjpeg($logos[$logo]<img src="https://vborg.vbsupport.ru/images/newsm/wink.gif" border="0" alt="">;

^^^^^^ ????

wooolF[RM] 06-29-2002 02:03 PM

]well... I used script as u said and it didn't worked... then I changed


$im = imagecreatefromjpeg($logos[$logo]<img src="https://vborg.vbsupport.ru/images/newsm/wink.gif" border="0" alt="">;

to

$im = imagecreatefromjpeg($logos[$logo]<img src=" ; ) " border="0" alt="">;


same result - doesn't work...

Code:

Parse error: parse error, unexpected T_STRING in /blabla/sig.php on line 27
where line 27 is the line I have changed

Xenon 06-29-2002 04:31 PM

ups, seems vb has parsed a line as a smilie *gg*
try now


All times are GMT. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01213 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete