Debt Help - Debt Consolidation - Personal Loans - Flights - Loans

PDA

View Full Version : newb ?: How to included php in vbulletin template


mizt
Aug 4th 2005, 12:23 pm
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" );
?>


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.

mck9235
Aug 5th 2005, 10:31 am
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");
?>

Hopefully that will work. Good luck to you. :)

digitalpoint
Aug 5th 2005, 10:35 am
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.

mizt
Aug 5th 2005, 1:06 pm
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

digitalpoint
Aug 5th 2005, 1:38 pm
I don't know what you are actually trying to do (what the included PHP file outputs) so I'm not sure.

mizt
Aug 5th 2005, 1:47 pm
It outputs a banner much like adsense. I assume its like the coop code, how would I add that to vbulletin?

digitalpoint
Aug 5th 2005, 1:54 pm
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.