The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
php replacement variables
I have a php file working in mo forum and i have a lot of styles. My problem is this php file is calling a template but i have to edit the php file to change background color so it causes a problem with differet styles.
here is the code inside the php file. Code:
################################################## ######################### ## SET YOUR OWN COLOURS HERE ################################################## ######################### ?> <body bgcolor="#202020" text="#999999" link="#ff0000" alink="#ff0000" vlink="#ff0000"> <font face="verdana" size="1"><a href="member.php?u=<? echo "$postuserid"; ?>" target="blank"> <b><? echo "$name"; ?></b></a><br><? echo "$comment"; ?><br><br></font></body> <? } |
#2
|
|||
|
|||
What you would need to do is instead of hard coding the HTML into the script, make a new template, and call it from the script. In the template, you can put the replacement variables (to see which exactly, check out other templates that have same colors).
|
#3
|
|||
|
|||
I am not really good in coding how can i do that ? can you explain a little more bit ?
|
#4
|
|||
|
|||
To call a template, use this:
$var = fetch_template('template_name'); In the template, you can use template variables. To find out, which variables work, go into your admincp, open the style you need, the go to "style variables". It will open a list of colors, size, etc. If you hover your mouse over a table row with a thing you need, it will popup a variable name in a tooltip - something like $stylevar['something']. EDIT Sorry, there are no color variables. To apply the colors etc., use classes. To see which classes have what, go to the CSS part of the template (Style manager -> CSS table). And then just use "class='classuneed'" in HTML. |
#5
|
|||
|
|||
Is it possible to give you an example what kind of template i need to create ?
$var = fetch_template('adv_portal_shoutbox1'); and then what do i have to edit in adv_portal_shoutbox1 template ? <body class="tcat"> will this be enough or something else ? |
#6
|
|||
|
|||
Depends on your objectives.
|
#7
|
|||
|
|||
if i use alt1 for example is the total code i will enter the template will be ?
<body class="alt1"> </body> or do i have to add something more ? |
#8
|
|||
|
|||
If you only add <body class="alt1"> </body> to your template, then you can count your template empty - you have nothing except for tags...
|
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
Quote:
i would avoid putting it in the body declaration. Its a bit too global for my tastes. It would help if you could specify exactly what you were trying to do though. HTH's |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|