vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding a counter for template conditionals (https://vborg.vbsupport.ru/showthread.php?t=209048)

neverstop 09-27-2010 08:45 PM

Yep I a m aware the second script is for 4.0

And the problem is it isnt doing anything lol.

If I add $count to the template it doesnt return a number, it just returns '$count'

I tried {vb:raw count} and {vb:raw top_reputation.count} as well. Of course neither worked. I know this should be simple but I am not a coder unfortunately.

Here is the template:

Code:

<tr>
<td class="{vb:raw bgclass}">
<font size="3">&raquo;</font> <a href="{vb:raw vboptions.bburl}/member.php?{vb:raw session.sessionurl}u={vb:raw top_reputation.userid}" rel="nofollow">{vb:raw top_reputation.musername}</a>
</td>
<td class="{vb:raw bgclass}">[{vb:raw top_reputation.credits}]</td>
</tr>


Does that help you realize what I'm looking for?

dartho 09-27-2010 08:58 PM

You need to register the count variable first.

add
Code:

$templater->register('count',$count);
just below
Code:

$templater = vB_Template::create('adv_portal_top_reputations_bit');
and then use {vb:raw count} rather than $count in teh templates.

neverstop 09-27-2010 09:03 PM

Youre the man dartho, thanks

BirdOPrey5 09-28-2010 01:36 AM

If this is all VB4 what is it in the VB3 forum for?

Lynne 09-28-2010 02:36 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2104037)
If this is all VB4 what is it in the VB3 forum for?

Because at first it was vB3, then he switched over to vB4. He should have started a new thread in the correct forum, but....


All times are GMT. The time now is 11:24 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.03794 seconds
  • Memory Usage 1,724KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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