Announcement

Collapse
No announcement yet.

put an "include" call in template file ?

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

  • #31
    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

    Comment


    • #32
      Yeah, banners.dat works, becuase i tested it on a page not on vb.
      Ken Prescott - 21Studios freelancing design
      Graphic-Forums - The Forums for the Graphic User

      Comment


      • #33
        What about the code that uses $fullbutton? What is the HTML result of that?

        Comment


        • #34
          It wouldnt show up, it was black, the "&fullbutton" was like i added nothing at all.
          Ken Prescott - 21Studios freelancing design
          Graphic-Forums - The Forums for the Graphic User

          Comment


          • #35
            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]

            Comment


            • #36
              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>";
              
              ?>
              ...
              Ken Prescott - 21Studios freelancing design
              Graphic-Forums - The Forums for the Graphic User

              Comment


              • #37
                Yes.

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

                Anyway, try my last suggestion.

                Comment


                • #38
                  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.
                  Ken Prescott - 21Studios freelancing design
                  Graphic-Forums - The Forums for the Graphic User

                  Comment


                  • #39
                    sorry,
                    there i can find phpinclude template?

                    Comment


                    • #40
                      That template does not exist in vB 3.5. This is the vB2 forum.
                      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                      Change CKEditor Colors to Match Style (for 4.1.4 and above)

                      Steve Machol Photography


                      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                      Comment

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