vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   First Look at vBulletin 4 Template Tags (https://vborg.vbsupport.ru/showthread.php?t=217570)

Dax IX 10-26-2009 08:54 PM

Thank you, Wayne!

This actually looks a lot easier and better than the old system, and seems more logical, too. :)

syrus.xl 11-09-2009 07:39 PM

vB4 as come a long way with coding. Much appreciated Wayne! :)

abdobasha2004 11-12-2009 01:08 AM

I think it became more complicated ! :(

Zaiaku 11-20-2009 01:41 PM

Not all that different. Very helpful. I do like the comment options though very much.

TY

niake 11-20-2009 04:29 PM

Thank you :up:

Reeve of shinra 11-23-2009 04:23 AM

Quote:

Originally Posted by bobster65 (Post 1881712)
you can still use the HTML comment, but it will display when someone "views source" where as using the <vb:comment>, that comment will be stripped and not processed by the HTTP server, hence not being visible when someone views source.. make sense?

Makes sense -- off hand, anyone know if <vb:comment> show up in the html source code when vb is in debug mode?

vietfancy 11-28-2009 02:01 PM

have anybody try to use
PHP Code:

<vb:if condition="$is_member_of($bbuserinfo,6)">

do 
something
</vb:if> 

It's not working for me.

Lynne 11-28-2009 02:10 PM

It isn't $is_member_of, it's simply is_member_of (no $ in front).

AndrewD 12-06-2009 05:44 AM

Something to be aware of with the conditional tag.

Whereas in vb3.x, fetch_template was typically eval()'d in the scope of the function that created the template output, in vb4, the template is eval()'d inside another function. Since the conditional test refers to standard php variables rather than the vb registered template variables, this can create a situation where the variable you are testing is not in scope, so the test will always fail.

For example:
PHP Code:

function myfunc() {
    
$myvar 1;
    
$templater vB_Template::create('mytemplate');
    
$templater->register(myvar', $myvar);
    print_output($templater->render());


where mytemplate contains:
PHP Code:

val: {vb:raw myvar}
<
vb:if condition="$myvar==1"say again {vb:raw myvar}</vb:if> 

will only output "val: 1"

You can get round this by explicitly referring to the registered variable in the vb:if condition as follows:

PHP Code:

val: {vb:raw myvar}<br />
<
vb:if condition="$this->registered['myvar']==1"say again {vb:raw myvar}</vb:if> 

which will output "val: 1 say again 1", which is what the equivalent vb3.x template would have achieved.

Lynne 12-06-2009 02:20 PM

Thanks for posting that, Andrew. I haven't run into that problem yet, but I know I will and I'll be pulling my hair out and then I'll remember this post of yours and the world will be right again. :)


All times are GMT. The time now is 03:46 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.02280 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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