Author Topic: Help me to hide field  (Read 4836 times)

0 Members and 1 Guest are viewing this topic.

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Help me to hide field
« on: September 22, 2010, 03:28:55 PM »
Hi all.

I need to hide this field from users. Only show for Admins. How to do it?

Code: [Select]
                            {if admin}
                            <tr>
                         <td valign="top" align="left" bgcolor="#e7e7e7"><font size="2" face="verdana"><b>{lang_keywords_textarea}</b></font><br><font size="1" face="arial">{lang_type_keywords}</font></td>
                             <td align="left" bgcolor="#e7e7e7"><table border="0" cellpadding="2" cellspacing="0"><tr><td><font size="1" face="verdana"><textarea name="image_keywords" style="font-family: Verdana,Helvetica,Arial; font-size: 8pt; width: 200px; height: 50px;">{image_keywords}</textarea></font></td></tr></table></td>
                            </tr>
                            {endif admin}

This is not work!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Help me to hide field
« Reply #1 on: September 22, 2010, 03:37:07 PM »
use {if is_admin} and {endif is_admin}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: Help me to hide field
« Reply #2 on: September 22, 2010, 04:27:36 PM »
Ok, Thanks. And is it possible to do for moderators? And how? This mod http://www.4homepages.de/forum/index.php?topic=17155.45

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Help me to hide field
« Reply #3 on: September 22, 2010, 05:31:23 PM »
you'll need use PHP for that:
Code: [Select]
<?php
global $user_info;
if (
$user_info['user_level'] == ADMIN || $user_info['user_level'] == MODERADOR)
{
?>


your code here

<?php
}
?>
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: Help me to hide field
« Reply #4 on: September 22, 2010, 06:13:59 PM »
Very useful thing, Thanks V@no!