PDA

View Full Version : Including Via PHPInclude Templates or Main VBA Files/Template


DeMiNe0
10-26-2004, 07:38 PM
Hey,
Im trying to get a random background working on my site. I have this code in a seporate php file:
<?php
$bg[] = "/images/trees.jpg";
$bg[] = "/images/dawn.jpg";
$bg[] = "/images/winterwonder.jpg";
$bg[] = "/images/storm.jpg";

shuffle($bg);


echo $bg[0];
?>


I included this file into my phpinclude_start template:
ob_start();
include("/home/wowforge/public_html/bgimg.php");
$bgimg = ob_get_contents();
chdir("/home/wowforge/public_html/forums/");
ob_end_clean();

then i tryed using:
<style type="text/css">
<!--
.background
{
background: #000000 url('$bgimg') repeat-x top left;
}
-->
</style>
in my adv_portal template.

When i loaded the page. The $bgimg var was blank.

I tryed the same line on other templates and it worked fine... How would i go about making this work in VBA?

DeMiNe0
10-27-2004, 11:08 AM
anyone have any idea? *winks at brian in the Currently Active Users"

^^

Our Sponsors
 

KW802
10-27-2004, 11:18 AM
anyone have any idea? *winks at brian in the Currently Active Users"

^^
Try this one from Floris....

http://www.vbulletin.com/forum/showthread.php?t=116287

:D

DeMiNe0
10-27-2004, 11:33 AM
My Script works fine. The Variable is not being passed through to abadvanced.. Its clearly a problem in vbadvanced since it works anywhere else on vbulletin and on other portal systems.

Our Sponsors
 

Brian
10-27-2004, 11:45 AM
forum/includes/vba_cmps_include_bottom.php

Look for:

global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;

Replace with:

global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST, $bgimg;

KW802
10-27-2004, 11:46 AM
My Script works fine. The Variable is not being passed through to abadvanced.. Its clearly a problem in vbadvanced since it works anywhere else on vbulletin and on other portal systems.
I didn't say your script wasn't working. If you take a look at the one I pointed to, though, you'll see an alternative method that is easier to implement because it wouldn't require any changes to the phpinclude, templates, or anything else. But, whatever....