Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2005, 11:20 AM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 04-04-2005, 06:13 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 04-04-2005, 07:13 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not really good in coding how can i do that ? can you explain a little more bit ?
Reply With Quote
  #4  
Old 04-04-2005, 09:08 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-08-2005, 07:55 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #6  
Old 04-08-2005, 09:29 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Depends on your objectives.
Reply With Quote
  #7  
Old 04-08-2005, 09:36 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #8  
Old 04-08-2005, 09:50 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you only add <body class="alt1"> </body> to your template, then you can count your template empty - you have nothing except for tags...
Reply With Quote
  #9  
Old 04-08-2005, 10:05 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #10  
Old 04-08-2005, 10:25 PM
The Geek's Avatar
The Geek The Geek is offline
 
Join Date: Sep 2003
Location: Behind you
Posts: 2,779
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07966 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete