Announcement

Collapse
No announcement yet.

put an "include" call in template file ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Steve Machol
    replied
    That template does not exist in vB 3.5. This is the vB2 forum.

    Leave a comment:


  • wertis
    replied
    sorry,
    there i can find phpinclude template?

    Leave a comment:


  • Grandmaster
    replied
    Ok, I changed the code.

    When I used $GLOBALS['fullbutton'] It gave me these errors:
    Code:
    Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/sites/site31/web/global.php(255) : eval()'d code on line 39
    
    Warning: Cannot add header information - headers already sent by (output started at /home/sites/site31/web/global.php(255) : eval()'d code:39) in /home/sites/site31/web/admin/functions.php on line 1459
    When I changed it to $GLOBALS[fullbutton] without the quotes it didn't give me any errors, but nothing showed up. It didnt even add anything to the html when I viewed the source.

    Leave a comment:


  • MiF
    replied
    Yes.

    You should never echo anything from phpinclude unless you are buffering the output.

    Anyway, try my last suggestion.

    Leave a comment:


  • Grandmaster
    replied
    This is the code as it is last:
    Code:
    <?
    
    srand((double)microtime()*1000000); 
    $banners="banners.dat";
    $banners=file($banners);
    $select=rand(0, count($banners)-1);
    $banner=explode("|", $banners[$select]);
    echo "<a href=\"$banner[1]\" target=_new><img src=\"$banner[0]\" border=0 width=88 height=31></a>";
    
    ?>
    Now im guessing you want me to change echo to $fullbutton =

    And with that, the new code should look like:
    Code:
    <?
    
    srand((double)microtime()*1000000); 
    $banners="banners.dat";
    $banners=file($banners);
    $select=rand(0, count($banners)-1);
    $banner=explode("|", $banners[$select]);
    global $fullbutton;
    $fullbutton = "<a href=\"$banner[1]\" target=_new><img src=\"$banner[0]\" border=0 width=88 height=31></a>";
    
    ?>
    ...

    Leave a comment:


  • MiF
    replied
    Try this, add
    PHP Code:
    global $fullbutton
    Right before this line
    PHP Code:
    $fullbutton "<a href=\"$banner[1]\" target=\"_new\"><img src=\"$banner[0]\" border=\"0\" width=\"88\" height=\"31\"></a>" 
    Then, in the footer template, use
    $GLOBALS['fullbutton'] or $GLOBALS[fullbutton]

    Leave a comment:


  • Grandmaster
    replied
    It wouldnt show up, it was black, the "&fullbutton" was like i added nothing at all.

    Leave a comment:


  • MiF
    replied
    What about the code that uses $fullbutton? What is the HTML result of that?

    Leave a comment:


  • Grandmaster
    replied
    Yeah, banners.dat works, becuase i tested it on a page not on vb.

    Leave a comment:


  • MiF
    replied
    Is banners.dat getting loaded? Make sure banners.dat is in the right place with right permissions.

    Does the file contain blank lines?

    Another change I would make, not related to the problem:
    PHP Code:
    $select=count($banners) > rand(0count($banners)-1) : 0

    Leave a comment:


  • Grandmaster
    replied
    <a href="" target="_new"><img src="" border="0" width="88" height="31"></a>

    No urls or imgs sources

    Its from Firefly's post, in which at the bottom he states that it has to work.. Thats the only way i can identify it,.
    Last edited by Grandmaster; Wed 12 Sep '01, 1:04pm.

    Leave a comment:


  • MiF
    replied
    "Comes up as a broken image"

    Did you check the source code of the generated HTML? Post here what it generated.

    Leave a comment:


  • Grandmaster
    replied
    I used the $fullbutton and it doesn't show anything. I even changed the $fullbutton in the phpinclude file, and still no go.

    There must be something, could I use SSI and include the file like that inside of a php file?

    No, I didn't design it, my partner did, Justin Stayton. I was thinking about running for board of the month. You want to nominate me, because I belive i read the owner of the board cannot nominate is own, or if he does nomiate it, a second user has to second the nomination.

    Leave a comment:


  • Chen
    replied
    PHP Code:
    <?php

    srand
    ((double)microtime()*1000000); 
    $banners="banners.dat";
    $banners=file($banners);
    $select=rand(0count($banners)-1);
    $banner=explode("|"$banners[$select]);

    $fullbutton "<a href=\"$banner[1]\" target=\"_new\"><img src=\"$banner[0]\" border=\"0\" width=\"88\" height=\"31\"></a>"

    ?>
    Now use $fullbutton in your footer template.

    P.S.
    Your forum looks awesome! Did you design it?

    Leave a comment:


  • Grandmaster
    replied
    Comes up as a broken image. Check the bottom of the page. www.graphic-forums.com

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X