Registering a variable on forum list?

Status
Not open for further replies.

SNN_imported

OMG Member
Joined
Oct 7, 2010
Messages
19
Hey guys.

I'm trying to register a variable called '$channel' on /index.php (the forum list) so I can use it with a stats block. Would anyone have any idea how to do such a thing? (Only thing stopping me from finishing a product :p)

If anyone could help, that'd be great.
Thanks!
 

Hagai

OMG Member
Joined
Oct 9, 2010
Messages
207
to set a variable in a template you need to use:
<xen:set variable="$varname">value</xen:set>
 

SNN_imported

OMG Member
Joined
Oct 7, 2010
Messages
19
That isn't what I'm looking for, but that's always useful to know.

I need to know how to use the PHP backend to add $channel to the forum list. Has nothing to do with templates. :/
 

imported_Brian

OMG Member
Joined
Oct 6, 2010
Messages
161
Assuming sessions are working (started) in your index.php

Code:
if( !isset($_SESSION['channel']) {
$_SESSION['channel'] = 123;
}
Where 123 is the value you want to assign to the $channel var

Then you can also use

$channel++;
 
Status
Not open for further replies.
Top