Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-20-2010, 07:32 AM
YsTyle YsTyle is offline
 
Join Date: Mar 2007
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how to add new var to exist template

Hello,
i want to insert a variable to exists template (formhome_level1_nopost)

how can I do it?

thanks.
Reply With Quote
  #2  
Old 02-20-2010, 08:52 AM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

using to the Preregister is the item your looking for..

I use it in my photobucket mod, just rendering a empty template to get the variable
into existing templates, such as newthread, etc..

I also made a small mod with costum Terms of service showing on forumhome
also used preregister there on Forumhome template.

There is an article on its use in vb4 articles.
Reply With Quote
  #3  
Old 02-20-2010, 08:59 AM
YsTyle YsTyle is offline
 
Join Date: Mar 2007
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Vaupell View Post
using to the Preregister is the item your looking for..

I use it in my photobucket mod, just rendering a empty template to get the variable
into existing templates, such as newthread, etc..

I also made a small mod with costum Terms of service showing on forumhome
also used preregister there on Forumhome template.

There is an article on its use in vb4 articles.
Thanks for commenting.

there is no other way to get the variables?
Reply With Quote
  #4  
Old 02-20-2010, 09:41 AM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well ofcourse manual edit the template, and the php file

And adding the normal register into the existing php file, then editing the template
where you want to use the var.

but hardly a way to go, cause when updateing the files might be updated aswell.
and not shareable if makeing a shared mod, but if its just for your own site
then manual editing is fine, templates will let you know when changed so you can
edit them when upgrading versions.

But if i where you, i would create a plugin, and run the preregister from there,
then also add a Str replace to add the var into use in the template.

its proberly to most "clean" way, plus easy to disable if theres problems.
Reply With Quote
  #5  
Old 03-03-2010, 01:54 PM
TalkVirginia's Avatar
TalkVirginia TalkVirginia is offline
 
Join Date: Oct 2008
Location: Virginia
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Vaupell View Post

... i would create a plugin, and run the preregister from there,
then also add a Str replace to add the var into use in the template.

its proberly to most "clean" way, plus easy to disable if theres problems.
Any examples on doing this? particularly with the footer. It appears the footer is cached so how do you append to a cached template?
Reply With Quote
  #6  
Old 03-03-2010, 02:02 PM
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Posts: 2,140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can check this great article

https://vborg.vbsupport.ru/showthread.php?t=228078

And

https://vborg.vbsupport.ru/showthread.php?t=233973
Reply With Quote
  #7  
Old 03-03-2010, 02:23 PM
TalkVirginia's Avatar
TalkVirginia TalkVirginia is offline
 
Join Date: Oct 2008
Location: Virginia
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ChopSuey View Post
Thanks for your suggestions.. but I've read and re-read these articles still I'm just about bleeding from my eyes, nose and ears.. and still no success.

So basically what you're telling me is that there is no way to do it in the plugin?
Reply With Quote
  #8  
Old 07-28-2010, 11:24 AM
shri shri is offline
 
Join Date: Nov 2001
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did this ever get solved? I think I have the same problem with setting a variable in the footer template (with preregister..)
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 10:19 PM.


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.04035 seconds
  • Memory Usage 2,231KB
  • 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
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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