vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   php modification for a page (https://vborg.vbsupport.ru/showthread.php?t=68711)

HipHopFranco 08-26-2004 12:27 AM

php modification for a page
 
I got this part of php code I wanna incorporate in a .php file...it selects a random image:

<?php

global $value;

srand((double)microtime()*1000000);
$value = rand(0,1);

if($value==0){
$img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor1.gif";
}
if($value==1){
$img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor2.gif";
}

?>


and, lower

<a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a>

I'm just trying to figure out where I should put this because the whole thing is ran by templates...

Sylvus 08-26-2004 03:13 PM

I'd put it in global.php

Xenon 08-26-2004 03:21 PM

phpinclude_start (template) would be better

Sylvus 08-26-2004 03:24 PM

Hi Xenon! I just looked under my vB2 and I do not have a phpinclude_start template. Is this something that needs to be added manually or perhaps it was accidently removed? I hope by not having this phpinclude_start template in my vB2 forum does not cause any serious problems or issues with the database!

Xenon 08-26-2004 03:31 PM

in vb2 it's called just phpinclude :)

HipHopFranco 08-26-2004 05:45 PM

I tried to put the top part in the "phpinclude" template:

global $value;

srand((double)microtime()*1000000);
$value = rand(0,1);

if($value==0){
$img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor1.gif";
}
if($value==1){
$img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor2.gif";
}



And I tried to put the other part in the "forumdisplay" template (I wanna put the image in the "forumdisplay template"):

<a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a>


But it doesn't work. Sombody knows the problem? :(

Xenon 08-27-2004 01:59 PM

change
Code:

<a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a>
into
Code:

<a href="blop.html" target="_blank"><img src="$img" /> width="468" height="60" border="0"></a>
that should work

HipHopFranco 08-27-2004 08:23 PM

Thank you Xenon! You're the man!!!

It works perfectly fine now.

Xenon 08-28-2004 03:32 PM

you're welcome :)


All times are GMT. The time now is 02:59 AM.

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.01112 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete