Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > General Articles
[Tip] Use replacements
Sephiroth32
Join Date: Sep 2002
Posts: 200

 

Show Printable Version Email this Page Subscription
Sephiroth32 Sephiroth32 is offline 02-24-2003, 10:00 PM

When writing a template modification, you should always use the built-in Vbulletin replacements instead of acual settings. Fir example, instead of:

<tr bgcolor="#ff9900">
<td>
<font face="verdana" size="2">
Text
</td>
</tr>

You can use:

<tr bgcolor="{firstaltcolor}">
<td>
<normalfont>
Text
</td>
</tr>

This makes things much eassier for the person installing your mod. This is because they wont need to change all of your custom settings to their own settings.
Reply With Quote
  #2  
Old 02-26-2003, 03:15 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats just really common sense, you can also put text that is prone to change many times in a replacement too.
Reply With Quote
  #3  
Old 02-26-2003, 09:10 PM
Sephiroth32 Sephiroth32 is offline
 
Join Date: Sep 2002
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know it is common sense but alot of people dont do it
Reply With Quote
  #4  
Old 02-27-2003, 03:16 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I never intended to say everyone knew it, just thats it's that once known.
Reply With Quote
  #5  
Old 03-05-2003, 01:00 AM
refertech refertech is offline
 
Join Date: May 2002
Location: Atlanta, Georgia
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didnt know that, of course I'm extremely green to this and I'm still unclear what a replacement really is.

Mark
Reply With Quote
  #6  
Old 03-05-2003, 03:19 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's really a piece of code that is placed into 'replacements' so a new code (eg. {categorybackcolor}' can be used in the templates instead of bgcolor="blabla") is used and mostly used for things which appear alot throughout the templates.

Thats basically the jist of it's use.
Reply With Quote
  #7  
Old 03-05-2003, 11:54 AM
refertech refertech is offline
 
Join Date: May 2002
Location: Atlanta, Georgia
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh, ok I see. Well that does make sense now that you explained what it does. Thanks Tony.
Reply With Quote
  #8  
Old 03-06-2003, 03:42 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, didn't think that was a good one.
Reply With Quote
  #9  
Old 03-10-2003, 07:51 PM
RazeJr
Guest
 
Posts: n/a
Default

Sweet... Thanks for the Tip
Reply With Quote
Reply

Thread Tools

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 01:51 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.04198 seconds
  • Memory Usage 2,254KB
  • Queries Executed 22 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete