Registering a variable on forum list?

Status
Not open for further replies.

SNN_imported

OMG Member
Oct 7, 2010
19
1
215
30
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
Oct 9, 2010
207
3
80
30
Israel
to set a variable in a template you need to use:
<xen:set variable="$varname">value</xen:set>
 

SNN_imported

OMG Member
Oct 7, 2010
19
1
215
30
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
Oct 6, 2010
161
1
225
The Lion City
mrbrian.me
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.