Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
4 + 6 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Q & D Way to Determine if User is Anonymous or Admin
by thelorax on 2006/2/19 15:42:42

Thank you for the quick reply. I figured it was something like that. But, I'm a moron. And, I can't get it to work. I'm trying to put it in a module, so here's the relevant part of the index.php...

if (!$xoops_isuser)
{
echo file_get_contents("segments/notxoops.html);
}

else
{
echo file_get_contents("segments/isxoops.html");

if ($xoops_isadmin())
{
echo file_get_contents("segments/isadmin.html");
}
}

---------------
When I'm logged on, and when I'm not, I still get the contents of notxoops.html.

What I'm trying to do is make it so I have item level control of what's displayed (vice displaying a whole block or module based upon user permissions). Any advice would be much appreciated.

Thanks again, in advance!
Re: Q & D Way to Determine if User is Anonymous or Admin
by Anonymous on 2006/2/19 12:02:40

Hi famaTV,

Long time! thank you for your XOOPS supporting.
Re: Q & D Way to Determine if User is Anonymous or Admin
by famaTV on 2006/2/19 7:56:58

Here is a simple example ...

if he is a user and an admin, show the admin control panel link, else (if he is an annonymous) show him only the home page url

you may put this in your theme

<tr>
<{if $xoops_isuser}>
<{if $xoops_isadmin}> <a href="<{$xoops_url}>/admin.php">(Admin Area)</a><{/if}>
<{/if}>
</tr>

<tr>
<{if !$xoops_isuser}> <a href="<{$xoops_url}>/">Home</a><{/if}>
</tr>

You may see an example (although its in arabic) in my website http://www.famaTV.net (look at the top header below the logo)

Regards,
famaTV
Q & D Way to Determine if User is Anonymous or Admin
by thelorax on 2006/2/19 3:35:30

What's the quickest way to determine if the user is logged on (i.e. NOT anonymous)?

How about - for users that are NOT anonymous, is user an authorized admin?

I can see the member kernel is the key, but I can't quite decypher how to use it for this.

(Yup! I'm a newbie.)

Who's Online

162 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 162


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits