News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

conditions for showing hidden information.

Started by Nitro, June 05, 2005, 12:57:58 PM

Previous topic - Next topic

Nitro

recently i put together this little code following [uknown] help pages and looking into the other codes found in templates.

the first part works GREAT, now i have added some extra code right after else !($context['user']['is_admin']) code. What i want to do is to make this to show a message to any person looking into the summary of any other people's profile.

i am wondering if the condition is right and the rest of the code after that condition, since the first part works great.


if ($context['user']['is_admin'])
{
echo '
  <tr>
   <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
  </tr><tr>
        <td><b>TYPE YOUR TEXT HERE:</b></td> <td>', isset($context['member']['options']['CHANGE_THIS']) ? $context['member']['options']['CHANGE_THIS'] : '',
  '</td></tr><tr>'

else !($context['user']['is_admin'])

<tr>
   <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
  </tr><tr>
        <td><b>TYPE YOUR TEXT HERE:</b></td> <td>', <td><b>', $txt[513], ':</b></td>'',
  '</td></tr><tr>'
   ;
}


where $txt[999] should say something like this: "sorry you are not allow to see this" i want to make a condition where if the person looking is not an admin, then  they cannot see.
is this condition right? if it is, is the sytax correct? can you please tell me if this is right please?

i really appreciate if someone can help me with the rest of the code. this is to make hidden information not to be available for others in the forum, more like REAL private information.

Thank you so much in advance.

ps. oh i forgot in what language file i should add my $txt[999] or what kind of syntax can i use to just show a message without calling any constant?
MPF Rocks!!!

[Unknown]

Replace:

else !($context['user']['is_admin'])

With:

}
else
{

You can add your language strings to the index language file.

-[Unknown]

Nitro

oh wow! that is nice. i will try this code. thank you.
MPF Rocks!!!

[Unknown]

Oops, sorry.  You also need a:

echo '

After the else and {.

-[Unknown]

Nitro

good thing you told me this, i was just about to go crazy trying to find out what is going on.

thank you man!!!
MPF Rocks!!!

Advertisement: