vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   variables won't show (https://vborg.vbsupport.ru/showthread.php?t=249175)

Booyakan 08-23-2010 09:00 AM

variables won't show
 
I cannot get $numbermembers, $totalposts, or any variables to show like this on my forum. They do show however in the default "What's going on?" box

I have tried to put them in the ad locations and also in the ultimate side column hack blocks.

I simply want to write: "join our $numbermembers members" but it will only output "join our members"

Any help would be appreciated.

Lynne 08-23-2010 01:53 PM

They show where they are supposed to because they are actually defined there. If you want them to show somewhere else, you need to make sure to put the code on that other page that defines the variables.

Booyakan 08-23-2010 11:07 PM

Could you please give me one example of how to do that? I will take it from there..

Lynne 08-24-2010 02:51 AM

A plugin to add something to FORUMHOME template:

PHP Code:

**a bunch of php code here ending in **
$myvar 'myvar is now set';
vB_Template::preRegister('FORUMHOME', array('myvar' => $myvar)); 

Now you can use {vb:raw myvar} in the FORUMHOME template

BirdOPrey5 08-24-2010 05:31 PM

Quote:

Originally Posted by Lynne (Post 2088646)
Now you can use {vb:raw myvar} in the FORUMHOME template

We're talking VB3.x here. ;)

Lynne 08-24-2010 09:09 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2088961)
We're talking VB3.x here. ;)

Oh dear... this is one of those times it would help if vb4 threads had a different style than vb3 threads.

Ignore that code I posted since it is vB4 related.

You'd want something more like...
PHP Code:

**a bunch of php code here ending in **
$numbermembers vb_number_format($variable_from_above); 

Look at the bottom of the index.php page. The code is there.

Booyakan 09-04-2010 05:48 PM

I still need help please.

I added to my template this code but it still doesn't work.. Any ideas?

$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);

--------------- Added [DATE]1283628314[/DATE] at [TIME]1283628314[/TIME] ---------------

Ok I got this working for myself with this product. I don't know if this was the "right" way to do things but it works for me...


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


All times are GMT. The time now is 03:53 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.00994 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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