vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   how to add new var to exist template (https://vborg.vbsupport.ru/showthread.php?t=236374)

YsTyle 02-20-2010 07:32 AM

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.

Vaupell 02-20-2010 08:52 AM

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.

YsTyle 02-20-2010 08:59 AM

Quote:

Originally Posted by Vaupell (Post 1987139)
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?

Vaupell 02-20-2010 09:41 AM

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.

TalkVirginia 03-03-2010 01:54 PM

Quote:

Originally Posted by Vaupell (Post 1987167)

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

ChopSuey 03-03-2010 02:02 PM

You can check this great article

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

And

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

TalkVirginia 03-03-2010 02:23 PM

Quote:

Originally Posted by ChopSuey (Post 1996100)

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?

shri 07-28-2010 11:24 AM

Did this ever get solved? I think I have the same problem with setting a variable in the footer template (with preregister..)


All times are GMT. The time now is 03:25 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.00990 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete