PDA

View Full Version : Setting a variable for use within a template


Pitman
11-04-2020, 06:07 PM
​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:

$randomnum = rand(1,112);

{vb:set randnum, $randomnum}

Then use the random number inside the same template:
{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