PDA

View Full Version : how does it work?


vuiveclub
07-19-2007, 08:21 PM
hello all,
i've opened some code (ex. vbplaza.php) and see something like
// check if it should do the richest/most sold scripts
if ($_REQUEST['do'] == 'main')
{
// always show some history on the main page
$show['history'] = true;

// always show it on the main page
$show['richestmostsold'] = true;
}

I don't understand using $show['history'] = true; or $show['richestmostsold'] = true;

Could some one teach me about this, how to write, how to use?
Thank so much, sorry for my bad English :(

nico_swd
07-19-2007, 09:02 PM
This is just for the templates. It tells whether to display a section or not.

In the template you'll see something like:

<if condition="$show['history']">
Some code here
</if>


This block would only be displayed if $show['history'] is true.

King Kovifor
07-19-2007, 09:52 PM
vBulletin created an array called $show. This array is populated in a lot of files. It is how vBulletin will use complex if()'s and permissions in the file to figure out whether or not something should be displayed. Than, it assigns it to a $show key (true / false). Then inside templates they use <if condition="$show['this']"> here </if> to display things.