1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

newb ?: How to included php in vbulletin template

Discussion in 'vBulletin' started by mizt, Aug 4, 2005.

  1. #1
    Ok guys, I'm pretty decent with html but when it comes to php I get lost. I just broke down and bought a license so you will see me here alot. I want to add this script
    <?php
    $rssense_client = "pub-MjVAc2XXXXXXXXXXXXXX2UuY29t";
    $rssense_source = "pub-ZGIucHXXXXXXXXXXXXW5zZS5jb20=";
    $rssense_type = "text";
    $rssense_width = 728;
    $rssense_height = 90;
    $rssense_format = "leaderboard";
    $rssense_color_border = "ffffff";
    $rssense_color_bg = "ffffff";
    $rssense_color_link = "0000ff";
    $rssense_color_url = "008000";
    $rssense_color_text = "000000";
    $rssense_color_title = "e0efea";
    $rssense_color_title_bg = "336699";
    $rssense_links = "Y";
    
    $rssense_keywords = "";
    $rssense_content = "";
    
    include ( dirname(__FILE__) . "/rssense_client.php" );
    ?>
    
    PHP:
    In a spot like I would an adsense banner, such as below the navbar. Yet when I insert that php code like I would an adsense banner it doesn't work. Nothing appears. I remember with my old cms I had to do like a php include type thing. Maybe I have to do one here? Any help is appericated.

    By the way has anyone used this new rss service (rssense)? Seems pretty sweet.
     
    mizt, Aug 4, 2005 IP
  2. mck9235

    mck9235 Peon

    Messages:
    42
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not 100% sure about this but:
    Save that has a file, we'll use include() to reference it in vB.
    Go into the template editor, find where you want the banner to display, type:
    
    <?php
    include("placewherefileis.php");
    ?>
    
    PHP:
    Hopefully that will work. Good luck to you. :)
     
    mck9235, Aug 5, 2005 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    Nope... vBulletin does not parse PHP within the (normal) templates itself. But you can use PHP variables and conditionals to do most of what you probably need within the template itself. If that isn't enough, you can use the php_include_start template or a plug-in (depending on the version of vBulletin) to generate a variable you could spit out on a template.
     
    digitalpoint, Aug 5, 2005 IP
  4. mizt

    mizt Active Member

    Messages:
    772
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Shawn could you explain a bit more about using "PHP variables and conditionals to do most of what you probably need within the template itself". Maybe provide an example of how you'd include a code like this. TIA
     
    mizt, Aug 5, 2005 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    I don't know what you are actually trying to do (what the included PHP file outputs) so I'm not sure.
     
    digitalpoint, Aug 5, 2005 IP
  6. mizt

    mizt Active Member

    Messages:
    772
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    70
    #6
    It outputs a banner much like adsense. I assume its like the coop code, how would I add that to vbulletin?
     
    mizt, Aug 5, 2005 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Well bottom line is you can't execute PHP code inside a normal template, so you are going to need to do it some other way.
     
    digitalpoint, Aug 5, 2005 IP