TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,058
  • Total Topics: 21,338
  • Online today: 234
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 127
  • Total: 127

Do not show block for admin?

Started by MrApples, April 25, 2007, 09:56:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrApples

#10
Thats what were talking about Crystallas, it would be useful.

MrApples

Could someone tell me how to use HTML in PHP? Is there a tag, or command for it?

And again, this really should be a feature in TinyPortal  ;D

IchBin

In php you use the echo command to print HTML.


echo '<html></html>';

MrApples

Its giving me the unexpected '>' error on the echo line. I'm using it with Thurnoks code

IchBin

You're not using the <?php and ?> tags are you? You don't need them if you are. If you are not, can you please post your code.

MrApples

New welcome message for my forum.


// your comments at top of code
global $context; // can add your other global vars as well to the same line
// exclaimation point ( ! ) means NOT
if (!$context['user']['is_admin']){
  // all your code that should be displayed in block goes here
echo ââ,¬Ëœ<html>
<b>Welcome to PoLlama Forums!</b> <i>Poe ââ,¬â€œ La ââ,¬â€œ Ma ââ,¬â€œ For ââ,¬â€œ Ums</i><br>
<i>If your already a member please, please log-in now.</i><br>
<br>
Donââ,¬â,,¢t let the name fool you, because you wonââ,¬â,,¢t find any Llamas here. PoLlama Forums is a modding and gaming site revolving around the WarCraft 3, StarCraft 2, and hopefully more games in the future. Founded on September 21st 2006, we have been growing fast and there are no limits to what we can be, because thatââ,¬â,,¢s what PoLlama means, anything the community wants it to mean.<br>
<br>
So, join now by <a href=http://www.pollama.com/index.php?action=register>clicking here</a>. No e-mail verification required! However, it would be nice for you to give your real e-mail, so we can send you newsletters and contact you if necessary.
<br>
Have a map, project, or clan? There may be a spot on PoLlama for you, <a href=ââ,¬Âhttp://www.pollama.com/index.php?topic=1609.0ââ,¬Â>read this</a> for more information. Think something should be done different on our site, or have a idea or something we should add to our site, tell us now in the <a href=http://www.pollama.com/index.php?board=3.0>Site Discussion Forum</a>.
</html>';
}

MrApples

It must be a simple mistake of mine..

Thurnok

yep.. it is  :)

You have a "back quote" after your echo instead of a regular single quote.

Additionally, you do not need the html start and end tags, these are supplied by the page already...  try this code:


// your comments at top of code
global $context; // can add your other global vars as well to the same line
// exclaimation point ( ! ) means NOT
if (!$context['user']['is_admin']){
// all your code that should be displayed in block goes here
echo '
<b>Welcome to PoLlama Forums!</b> <i>Poe ââ,¬â€œ La ââ,¬â€œ Ma ââ,¬â€œ For ââ,¬â€œ Ums</i><br>
<i>If your already a member please, please log-in now.</i><br>
<br>
Donââ,¬â,,¢t let the name fool you, because you wonââ,¬â,,¢t find any Llamas here. PoLlama Forums is a modding and gaming site revolving around the WarCraft 3, StarCraft 2, and hopefully more games in the future. Founded on September 21st 2006, we have been growing fast and there are no limits to what we can be, because thatââ,¬â,,¢s what PoLlama means, anything the community wants it to mean.<br>
<br>
So, join now by <a href=http://www.pollama.com/index.php?action=register>clicking here</a>. No e-mail verification required! However, it would be nice for you to give your real e-mail, so we can send you newsletters and contact you if necessary.
<br>
Have a map, project, or clan? There may be a spot on PoLlama for you, <a href=ââ,¬Âhttp://www.pollama.com/index.php?topic=1609.0ââ,¬Â>read this</a> for more information. Think something should be done different on our site, or have a idea or something we should add to our site, tell us now in the <a href=http://www.pollama.com/index.php?board=3.0>Site Discussion Forum</a>.
';
}

Thurnok
The one, the only!

MrApples


This website is proudly hosted on Crocweb Cloud Website Hosting.