Uutiset:

Join the Facebook Fan Page.

Main Menu
Advertisement:

How to make this work??

Aloittaja Overturehd, marraskuu 27, 2013, 01:59:34 AP

« edellinen - seuraava »

Overturehd

Alright so what I am trying to do is make this sub navigation button send you to a different page if you are not logged in on the forums.

'sub_download' => array(
'title' => 'Downloads',
'href' => $scripturl . '?page=page255',
'show' => $user_info['is_guest'],
else
'href' => $scripturl . '?page=downloads',
'show' => true,
),


I tried this going off how I would do it in java but this isn't java lol and I am lost.

Please help!

Kindred

you can't use conditionals like that in the middle of the array...


'sub_download1' => array(
'title' => 'Downloads',
'href' => $scripturl . '?page=page255',
'show' => $user_info['is_guest'],
),
'sub_download2' => array(
'title' => 'Downloads',
'href' => $scripturl . '?page=downloads',
'show' => !$user_info['is_guest'],
),
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

You can use inline conditionals though.

'sub_download' => array(
'title' => 'Downloads',
'href' => $user_info['is_guest'] ? $scripturl . '?page=page255' : $scripturl . '?page=downloads',
'show' => true,
),
Holder of controversial views, all of which my own.


Kindred

AH!  Right...    I always forget about those.

That's why you're a developer and I'm a manager. lol....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: