Support Forums

Menu Item Appearance according to GroupID - How?

This is a discussion on Menu Item Appearance according to GroupID - How? within the Templates, HTML, CSS, and Design Help forums, part of the General category; Hi Gang, I need some coding assistance. Simply stated, I do not want the normal "Registered User" to be allowed ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 05-29-2010, 06:27 AM   #1
Ageless Member
 
Bronxgodzilla's Avatar
 
Join Date: Jun 2008
Posts: 140
Rep Power: 16
Bronxgodzilla is on a distinguished road
Default Menu Item Appearance according to GroupID - How?

Hi Gang, I need some coding assistance.
Simply stated, I do not want the normal "Registered User" to be allowed to create an advert or even see " modify listings" at all. It would seem simply enough to me to insert into layout.tpl and userindex.tpl the code below, after the normal checking if a person is logged in? Though I am using the Sigma Templates, it should be a standard 68C smarty query, right?:


Code:
	<!-- // Test If Logged In // -->
	{if $smarty.session.username<>'' || $smarty.cookies.username<>""}
	<li><a href="{$smarty.const.URL}/userindex.php">{$smarty.const.LANG_MY_ACCOUNT}</a></li>
{* ARE YOU A GROUP X  MEMBER? *}	
	         {if $smarty.session.groupid <> "2"} <!--//   exclude #2 = "Registered"  User // -->
					<li><a href="{$smarty.const.URLS}/userbrowselistings.php">{$smarty.const.LANG_TPL_MODIFY_AD}</a></li>
                              {/if}				
                     {/if}
In other words, what I want is, if the GroupID is that of a Registered User,that pPerson will NOT see the menu selection items; ALL others will (there is only Admin and Group X Member as other groups). So with the code here I do not understand why the variable GroupID is not being passed. I tried looking into {debug} but did not see any variables which gave me any illumination. I searched the Docs for "groupid" but also received no joy.

I put the same code in the userindex.tpl -- but it still does not differentiate between users & => But no group at all sees the menu selection with the above code. Can some one Please show me / enlighten me what I am doing incorrectly? It has to be something simple I am not doing due to lack of smarty brain cells :-)

Please Help. Mucho appreciation!

Barry G
__________________
Currently using Latest version v4.1.10 Developer with latest Templatecodes Sigma (The Greatest)

Last edited by Bronxgodzilla; 05-29-2010 at 06:33 AM.
Bronxgodzilla is offline   Reply With Quote
Old 05-29-2010, 08:43 AM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,317
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I believe that is because this information is only stored in the session. I think you are actually after something like this:
{if $smarty.session.userlevel ne 2}
......
{/if}
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 05-29-2010, 08:31 PM   #3
Ageless Member
 
Bronxgodzilla's Avatar
 
Join Date: Jun 2008
Posts: 140
Rep Power: 16
Bronxgodzilla is on a distinguished road
Default

And have I not extoled thy virtues of Brilliance? Works Excellently, thank you!

Is there a primer somewhere <link> which can go into syntax such as this & differences between db called vars and ones which are stored session only? Is it covered somewhere on the smarty.com site? Thanks for a better understanding, Mike.

BarryG
__________________
Currently using Latest version v4.1.10 Developer with latest Templatecodes Sigma (The Greatest)
Bronxgodzilla is offline   Reply With Quote
Old 05-30-2010, 09:36 PM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Session data can be found by opening any php file and then adding:
PHP Code:
print_r($_SESSION); 
Then any of those are available as Mike described. Anything else you can use {debug} in the template to view the vars available.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accordion menu item if user logged in skekum TemplateCodes 2 08-20-2009 08:41 AM
How can I append a dynamic class to a menu item? jonahcoyote Technical Support 4 06-25-2008 07:26 PM


All times are GMT -4. The time now is 01:42 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0