vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=328593

Using options in scripts within template
by Dr.CustUmz
15 Feb 2021 14:50

Ok for those who know me know im use to vb3, but I am working on something for vb4 and was wondering why my option wont print within a script in a template...

my code is as follows: (within a template)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and my img src is printing as "$vboptions[drc_img]" rather than the option.

also another instance of this is that last div I show in the code above.

the div shows, but displays $vboptions[drc_notice] when it should be displaying the Text...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


shka 15 Feb 2021 17:05

Quote:

Originally Posted by Dr.CustUmz (Post 2606273)

the div shows, but displays $vboptions[drc_notice] when it should be displaying the Text...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Dr.CustUmz 15 Feb 2021 17:21

Quote:

Originally Posted by shka (Post 2606276)
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

THANK YOU!

is the vb:raw standard for all $ within templates in vb4 then?

shka 15 Feb 2021 17:36

For output/echo values use curly braces and for array use dot syntax instead of square brackets.

https://www.vbulletin.com/docs/html?...rsion=40205500 - search for "template syntax"
Quote:

Raw Variables

To access variables in the normal, pre-vB4 fashion, use the following syntax:

{vb:raw variable}

This is equivalent to simply accessing $variable in the pre-vB4 syntax. No treatment is applied to the variable. The same dot operator is used to access array elements.

Dr.CustUmz 15 Feb 2021 17:42

Thanks shka (thinking in my head ShotKalla) lol


All times are GMT. The time now is 11:29.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.