Log in

View Full Version : GET variables in my template (or how to change oder status)


ganima
10-18-2009, 02:44 PM
Hi there.
I am using an addon to sort profilefields on /memberlist.php.
Addon: https://vborg.vbsupport.ru/showthread.php?t=124580&page=2

Unfortunately it does have only the ability to sort one way ? ASC or DESC. But I want it to change every click, like other fields (User, Last Post etc.).

In my template I tried
<if condition="$get['order'] == 'ASC'">
<td class="thead" nowrap="nowrap"><a href="$sorturl&amp;order=DESC&amp;sort=mitgliednummer&amp;pp=$perpag e$usergrouplink">Mitglied-Nr</a> $sortarrow[mitgliednummer]</td>
<else />
<td class="thead" nowrap="nowrap"><a href="$sorturl&amp;order=ASC&amp;sort=mitgliednummer&amp;pp=$perpage $usergrouplink">Mitglied-Nr</a> $sortarrow[mitgliednummer]</td>
</if>

It seems I can not access GET variables in my template?! How can I?

Does anybody have an idea how I can change ASC to DESC and reverse?

Hope for some help. Thanks!!

Lynne
10-18-2009, 02:55 PM
Do a google search on "get post request variables" and you'll see the correct syntax to use for them. In fact, here you go - PHP: Predefined Variables - Manual (http://php.net/manual/en/reserved.variables.php)

ganima
10-18-2009, 05:08 PM
It's a little bit mortifying. :o
I do know how to write the correct code but I thought PHP is not allowed in templates. I should have tested it :)


Thanks anyway for your help, Lynne!

Lynne
10-18-2009, 05:33 PM
php is not allowed in templates. But, a simple comparison condition is allowed in templates.