vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   php replacement variables (https://vborg.vbsupport.ru/showthread.php?t=79316)

Lizard King 04-04-2005 11:20 AM

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>
 
                        <?
                        }

is there anyway i can get this to get my style colors ? Maybe with replacement variable but i dont know how to do that.

akanevsky 04-04-2005 06:13 PM

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).

Lizard King 04-04-2005 07:13 PM

I am not really good in coding how can i do that ? can you explain a little more bit ?

akanevsky 04-04-2005 09:08 PM

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.

Lizard King 04-08-2005 07:55 PM

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 ?

akanevsky 04-08-2005 09:29 PM

Depends on your objectives.

Lizard King 04-08-2005 09:36 PM

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 ?

akanevsky 04-08-2005 09:50 PM

If you only add <body class="alt1"> </body> to your template, then you can count your template empty - you have nothing except for tags...

Lizard King 04-08-2005 10:05 PM

Quote:

Originally Posted by Dark Visor
If you only add <body class="alt1"> </body> to your template, then you can count your template empty - you have nothing except for tags...

so can you just give an example ? i am not really good in this what i have to add to template ?

The Geek 04-08-2005 10:25 PM

Quote:

Originally Posted by Lizard King
so can you just give an example ? i am not really good in this what i have to add to template ?

If I understand correctly - you want to be applying the class to the <tr>'s or <td>'s like: <tr class='alt1'> or <td class='alt1'>

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


All times are GMT. The time now is 04:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01169 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete