Announcement

Collapse
No announcement yet.

Inserting PHP code into header...does not works

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

  • freehtml
    replied
    Thank you very much

    Originally posted by freddie
    Put this in phpinclude
    Code:
    require "ad.php";
    $ad = show_ad();
    and place this in the header template where you want the ad to appear
    Code:
    $ad
    It works...thank you very much

    Does this work for other PHP codes also??

    Leave a comment:


  • Freddie Bingham
    replied
    Put this in phpinclude
    Code:
    require "ad.php";
    $ad = show_ad();
    and place this in the header template where you want the ad to appear
    Code:
    $ad

    Leave a comment:


  • Mike Sullivan
    replied
    $var = show_ads();

    then reference $var in the header

    Leave a comment:


  • freehtml
    replied
    Originally posted by Ed Sullivan
    Don't echo -- just assign it to a variable and reference that where you want the banner.
    Sorry, I am not good at PHP..so is it like the following :

    ads = require "ad.php"

    Please enlighten me...

    Leave a comment:


  • Mike Sullivan
    replied
    Don't echo -- just assign it to a variable and reference that where you want the banner.

    Leave a comment:


  • freehtml
    replied
    Originally posted by Ed Sullivan
    PHP code goes in the phpinclude template without the opening/closing tags (<?php ?>)
    It works while I input the following code in the "phpinclude" template ....

    Code:
    require "ad.php";
    echo show_ad();
    But I want the code to be insert in where the banner code suppose to be....not right on the top...anyway in doing so??

    I actually tried to use $phpinclude in where the banner code should be..but is of no use.

    Thanks

    Leave a comment:


  • Mike Sullivan
    replied
    PHP code goes in the phpinclude template without the opening/closing tags (<?php ?>)

    Leave a comment:


  • freehtml
    started a topic Inserting PHP code into header...does not works

    Inserting PHP code into header...does not works

    Here are some basic information before I start :
    [URL of your forums ]
    http://www.sanguo-online.com/vbb/

    [PHP version ]
    PHP 4.0.5

    [MySQL version ]
    3.23.38

    [Apache/webserver version ]
    Apache 1.3.19

    [Server operating system]
    FreeBSD 4.3

    I am using JMK Advertisement Rotator v1.0.1 script to display banners on the vBuleltin pages. It does not display at all...

    I had run a test but using the same code in the following URL :
    http://www.sanguo-online.com/vbb/test.php

    and it works..so the code and script is all right.. The code to be insert :

    <!-- Start Banner Code -->
    <?php
    require "ad.php";
    echo show_ad();
    ?>
    <!-- End Banner Code -->

    Whereas ad.php is inside the vBulletin root directory..by using the test.php , it works...

    The above banner code is insert into my "header" template....

    The complete code is follow :

    [Header Template]
    Code:
    <!-- logo and buttons -->
    <center>
    <table cellpadding=0 cellspacing=0 width="100%" height="85" border="0" align="center" bgcolor="#ffffff" >
    <tr>
    <td background="http://www.sanguo-online.com/vbb/images/header_bg.jpg">
    <table align=right>
    <tr>
    <td valign="middle" align="right">
    
    
    <!-- Start Banner Code -->
    <?php
    require "ad.php";
    echo show_ad();
    ?>
    <!-- End Banner Code -->
     
    
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    
    <TABLE cellpadding=0 cellspacing=0 width="100%" border="0" align="center" bgcolor="black">
    <tr>
    <TD align="middle" height="20"><FONT size="1">
    <b>
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=home" onmouseover="window.status='Return to main page';return true">Home</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=about" onmouseover="window.status='About Sanguo ONline';return true">About Us</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=register" onmouseover="window.status='Log in to our Members Area or create your new account with us';return true">Members Area</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=store" onmouseover="window.status='Please visit our online store for RTK games and Linux CD, many titles available';return true">Store</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=download" onmouseover="window.status='Download Romance Of Three Kingdoms games demo now';return true">Downloads</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=phpbb" onmouseover="window.status='Post your question in our online forum';return true">Forums</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=reviews" onmouseover="window.status='Read about our reviews';return true">Reviews</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=weblink" onmouseover="window.status='Add your site to our Links Section';return true">Links</a>
    &nbsp;&middot;&nbsp;
    <a href="http://www.sanguo-online.com/log/cgi-bin/logcnt.cgi?l=top10" onmouseover="window.status='Find out the hottest topics in Sanguo ONline';return true">Top 10</a>
    &nbsp;&middot;&nbsp;
    <a href="http://click.linksynergy.com/fs-bin/stat?id=60VOp6uH33o&offerid=23003&type=3&subid=0">Search</a><IMG border=0 width=1 height=1 src="http://ad.linksynergy.com/fs-bin/show?id=60VOp6uH33o&bids=23003&type=3&subid=0">
    &nbsp;&middot;&nbsp;
    <a href="http://sanguo-online.mail.everyone.net/" onmouseover="window.status='Get your own Free Sanguo ONline Email account';return true">Free Email</a>
    </b>
    </font>
    </td></tr>
    
    <tr><TD bgcolor="black" align="center">
    <!-- toplinks -->
    
       <a href="usercp.php?s=$session[sessionhash]"><img width="89" height="23" src="images2/top_profile.gif" alt="Here you can view your subscribed threads, view your private messages and edit your profile and preferences" border="0"></a
       ><a href="register.php?s=$session[sessionhash]&action=signup"><img width="99" height="23" src="images2/top_register.gif" alt="Registration is FREE!" border="0"></a
       ><a href="calendar.php?s=$session[sessionhash]"><img width="94" height="23" src="images2/top_calendar.gif" alt="Calendar" border="0"></a
       ><a href="memberlist.php?s=$session[sessionhash]"><img width="89" height="23" src="images2/top_members.gif" alt="Find other Sanguo ONline Members here!!" border="0">
    <a href="misc.php?s=$session[sessionhash]&action=showavatars"><img width="81" height="23" src="images2/top_avatar.gif" alt="Avatar!!" border="0">
    </a
       ><a href="misc.php?s=$session[sessionhash]&action=faq"><img width="57" height="25" src="images2/top_faq.gif" alt="Frequently Asked Questions" border="0"></a
       ><a href="search.php?s=$session[sessionhash]"><img width="85" height="23" src="images2/top_search.gif" alt="Search" border="0"></a
       ><a href="index.php?s=$session[sessionhash]"><img width="66" height="23" src="images2/top_home.gif" alt="Home" border="0"></a
       ><!-- <a href="member.php?s=$session[sessionhash]&action=logout"><img width="83" height="23" src="images2/top_logout.gif" alt="Logout" border="0"></a>  -->
       <!-- /toplinks -->
      </td>
    </tr>
    </table>
    <!-- /logo and buttons -->
    
    <!-- content table -->
    <table bgcolor="#FFFFFF" width="100%" cellpadding="10" cellspacing="0" border="0">
    <tr>
      <td>

    Hope the explanation is clear enuff...Thanks for any help
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X