vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   Setting a variable for use within a template (https://vborg.vbsupport.ru/showthread.php?t=328329)

Pitman 11-04-2020 06:07 PM

Setting a variable for use within a template
 
​I'm learning a little bit about {vb:set ...} and {vb:raw ... } but I am not quite sure how to accomplish using that to set a custom variable to simple a random number.

I'm trying to do exactly this:

PHP Code:

$randomnum rand(1,112); 

Code:

{vb:set randnum, $randomnum}
Then use the random number inside the same template:
Code:

{vb:raw randnum}
I've saw there is a php function for {vb:...}, but it doesn't look like I would be able to accomplish that using that. Is there an easy way to go about doing this?

yilmaz 11-05-2020 02:59 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=328332" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=328332</a>

delicjous 11-06-2020 10:48 AM

You should better use this...https://vbulletin.org/forum/showthread.php?t=328335


All times are GMT. The time now is 06:52 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.01741 seconds
  • Memory Usage 1,713KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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