Elxis CMS Forum
Support => Technical support => Topic started by: stepsdesigns on April 08, 2012, 19:31:44
-
hello guys need alettel support today
how could i change 2 menu items depend on the Access level
what i need to do if the user is not loged in ( appear 2 links in the top menu which iam using mod_eisfish_menu in it " Login - Regester "
and if the user is already loged in ( appears 2 links in the top menu " Log Out - My Account "
how could i do this ???
-
You can not do this without writing some php.
Logged in users have a $my->id greater than zero. So, you must perform this check:
<?php
global $my;
if (intval($my->id) > 0) {
echo '<a href="#">logout</a>';
} else {
echo '<a href="#">login</a>';
}
?>
Alternative to $my->id > 0 you can use the group id: $my->gid <> 29
The same functionality for Elxis Nautilus:
<?php
if (eFactory::getElxis()->user()->gid <> 7) {
echo '<a href="#">logout</a>';
} else {
echo '<a href="#">login</a>';
}
?>
-
fantastic i done that already
I found login link is
<a href="index.php?option=com_login">Log In</a>
and Register link is
<a href="index.php?option=com_registration&task=register">Register</a>
but i need the links for
user Profile
and log out
and my question is this links will be deference if iam using SEO Pro and if iam now ?
-
this is the code iam using now
global $my;
if (intval($my->id) > 0) {
echo '
<ul class="login">
<li>
<a href="#">My Account</a>
</li>
<li>
<a href="index.php?option=com_login&Itemid=29">Logout</a>
</li>
</ul>';
} else {
echo '
<ul class="login">
<li>
<a href="index.php?option=com_registration&task=register">Register</a>
</li>
<li>
<a href="index.php?option=com_login">Log In</a>
</li>
</ul>
';
}
what i need to do next
1- directly logout like the login module logout link directly without going to another page
2- find the user account link
-
Open module "login" (mod_login) and you will find all related functionality ready.
-
done and finished successfully thanks datahell for your help