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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 136
  • Total: 136

am I posting in the right place

Started by darakhshan, December 08, 2006, 07:07:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thurnok

The code I gave you works.  Recheck that you put the code in the correct place.  Also make sure you add the global line.  As an Admin $context['user']['is_guest'] will be false and therefore not run the code within the if() block.
Thurnok
The one, the only!

darakhshan

ok guys this is the banner I want to add


<div id="theLayer" style="z-index: 999; left: 5px; visibility: visible; width: 650px; position: absolute; top: 530px"><table style="height: 322px" cellspacing="0" cellpadding="5" width="650" bgcolor="#ffcc00" border="0"><tbody><tr><td style="width: 100%; height: 312px"><table style="height: 36px" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td id="titleBar" style="width: 100%; cursor: move"><a href="http://www.mydomain.com"><img id="domain" height="18" src="images/pop.gif" width="162" border="0" /></a> </td><td style="cursor: hand" valign="top"><a style="text-decoration: none" onclick="hideMe();return false"><font style="font-weight: bold; text-decoration: none" face="Arial" color="#ffffff" size="2">X</font></a> </td></tr><tr><td lang="fa" dir="rtl" style="padding-right: 4px; padding-left: 4px; padding-bottom: 4px; width: 100%; padding-top: 4px" align="center" bgcolor="#ffffff" colspan="2"><table lang="fa" dir="ltr" style="border-collapse: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td><a href="../undefined/english"><img id="notic" height="124" src="/images/logopop.gif" width="120" align="right" border="0" /></a></td><td lang="fa" dir="rtl" style="font-size: 35px; font-family: 'Times New Roman'; text-align: center"><div style="font-size: 35px; font-family: 'Times New Roman'; text-align: center"><strong><font color="#ff0000">Please log in</font></strong> </div><div style="font-weight: bold; font-size: 45px; font-family: 'Times New Roman'; text-align: center"><font size="4">Some of our topics might not be viewable by guests. To be able<br />to view all recent topics you need to login with your ID and Password </font><font size="6"><br /></font><font size="3">&nbsp; </font></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div>



so where should I put this if thing? :uglystupid2:
// needed globals
global $context;

if ($context['user']['is_guest']){
     // all your code in here
}

IchBin

Here's how you would do it in a phpbox block.

// needed globals
global $context;

if ($context['user']['is_guest']){
    echo '
<div id="theLayer" style="z-index: 999; left: 5px; visibility: visible; width: 650px; position: absolute; top: 530px"><table style="height: 322px" cellspacing="0" cellpadding="5" width="650" bgcolor="#ffcc00" border="0"><tbody><tr><td style="width: 100%; height: 312px"><table style="height: 36px" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td id="titleBar" style="width: 100%; cursor: move"><a href="http://www.mydomain.com"><img id="domain" height="18" src="images/pop.gif" width="162" border="0" /></a> </td><td style="cursor: hand" valign="top"><a style="text-decoration: none" onclick="hideMe();return false"><font style="font-weight: bold; text-decoration: none" face="Arial" color="#ffffff" size="2">X</font></a> </td></tr><tr><td lang="fa" dir="rtl" style="padding-right: 4px; padding-left: 4px; padding-bottom: 4px; width: 100%; padding-top: 4px" align="center" bgcolor="#ffffff" colspan="2"><table lang="fa" dir="ltr" style="border-collapse: collapse" bordercolor="#111111" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td><a href="../undefined/english"><img id="notic" height="124" src="/images/logopop.gif" width="120" align="right" border="0" /></a></td><td lang="fa" dir="rtl" style="font-size: 35px; font-family: 'Times New Roman'; text-align: center"><div style="font-size: 35px; font-family: 'Times New Roman'; text-align: center"><strong><font color="#ff0000">Please log in</font></strong> </div><div style="font-weight: bold; font-size: 45px; font-family: 'Times New Roman'; text-align: center"><font size="4">Some of our topics might not be viewable by guests. To be able<br />to view all recent topics you need to login with your ID and Password </font><font size="6"><br /></font><font size="3">&nbsp; </font></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div>';

}

darakhshan

thanks I appreciate for your time to help me but I get this

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/hosting_users/www/english/Sources/Load.php(1733) : eval()'d code(35) : eval()'d code on

bloc

It were 2-3 font names that was wrongly enclosed in single quotes...also I indented the code. Its MUCH easier to spot errors once that is done. ;)


// needed globals
global $context;

if ($context['user']['is_guest']){
    echo '
<div id="theLayer" style="z-index: 999; left: 5px; visibility: visible; width: 650px; position: absolute; top: 530px">
<table style="height: 322px" cellspacing="0" cellpadding="5" width="650" bgcolor="#ffcc00" border="0">
<tbody>
<tr>
<td style="width: 100%; height: 312px">
<table style="height: 36px" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td id="titleBar" style="width: 100%; cursor: move">
<a href="http://www.mydomain.com"><img id="domain" height="18" src="images/pop.gif" width="162" border="0" /></a>
</td>
<td style="cursor: hand" valign="top">
<a style="text-decoration: none" onclick="hideMe();return false"><font style="font-weight: bold; text-decoration: none" face="Arial" color="#ffffff" size="2">X</font></a>
</td>
</tr>
<tr>
<td lang="fa" dir="rtl" style="padding-right: 4px; padding-left: 4px; padding-bottom: 4px; width: 100%; padding-top: 4px" align="center" bgcolor="#ffffff" colspan="2">
<table lang="fa" dir="ltr" style="border-collapse: collapse;" bordercolor="#111111" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<a href="../undefined/english"><img id="notic" height="124" src="/images/logopop.gif" width="120" align="right" border="0" /></a>
</td>
<td lang="fa" dir="rtl" style="font-size: 35px; font-family: Times New Roman; text-align: center">
<div style="font-size: 35px; font-family: Times New Roman; text-align: center">
<strong><font color="#ff0000">Please log in</font></strong>
</div>
<div style="font-weight: bold; font-size: 45px; font-family: Times New Roman; text-align: center">
<font size="4">Some of our topics might not be viewable by guests. To be able<br />to view all recent topics you need to login with your ID and Password </font><font size="6"><br /></font><font size="3">&nbsp; </font>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>';

}

darakhshan

#15
thanks guys! spent your time to help me! if there is any thing I can do for you please let me.
I will be more than glad to help you in any way. :)

God bless this forum
you know I am doing some missionary work in here so need a lot help

bloc

Glad it worked.

I can't help much with your mission, but for anything code related you are on the right place. ;)

Thurnok

hehe.. well, since the requestor actually showed php code in his first post, I assumed he knew php syntax but just didn't know what to use for excluding an Admin.  I probably should have asked him to show his "pop-up" code originally.  If I did, I probably would have realized he wasn't using an echo statement to write his code to the php processor.  hehe.. Sorry korea, bad assumption on my part.  Glad you are working now.  :)
Thurnok
The one, the only!

This website is proudly hosted on Crocweb Cloud Website Hosting.