edielinux
Junior Member
Posts: 23
Joined: May 2009
Reputation: 0
MyBux: 16
|
newsbar help
im using the next code on my index
Code:
<p class="newsbar">ALL FORUMS ARE HIDDEN TO VIEW THEM YOU NEED TO <a href="http://mysite/member.php?action=register" target="_self">REGISTER</a> OR <a href="http://mysite/member.php?action=login" target="_self">LOGIN</a></p>
its located on my index templete
where should i put the code so it will disappear for loged users?
i know i can just place the code in
header templetes /header_welcomeblock_guest
but if i do that it keeps showin the text on all pages
|
|
| 05-05-2009 02:25 AM |
|
Polarbear541
Tuts Team
Posts: 646
Joined: Aug 2008
Reputation: 3
MyBux: 710
|
RE: newsbar help
well it could probably be done with some PHP but I don't know much of that
|
|
| 05-05-2009 03:39 AM |
|
madshark
Member
Posts: 185
Joined: Feb 2009
Reputation: 0
MyBux: 300
|
RE: newsbar help
Code:
if($mybb->user['uid'])
{
//user is logged in
}
else
{
//user is not logged in
<p class="newsbar">ALL FORUMS ARE HIDDEN TO VIEW THEM YOU NEED TO <a href="http://mysite/member.php?action=register" target="_self">REGISTER</a> OR <a href="http://mysite/member.php?action=login" target="_self">LOGIN</a></p>
}
try that in your index if you only want it in the index or else if you want it in every page it goes in your header..
"Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies"
(This post was last modified: 05-05-2009 06:17 AM by madshark.)
|
|
| 05-05-2009 06:16 AM |
|
edielinux
Junior Member
Posts: 23
Joined: May 2009
Reputation: 0
MyBux: 16
|
RE: newsbar help
thanks for the help props
|
|
| 05-07-2009 04:04 PM |
|
Splappy
New Custom User Title
Posts: 343
Joined: Oct 2008
Reputation: 5
MyBux: 36
|
RE: newsbar help
(05-05-2009 06:16 AM)madshark Wrote:
Code:
if($mybb->user['uid'])
{
//user is logged in
}
else
{
//user is not logged in
<p class="newsbar">ALL FORUMS ARE HIDDEN TO VIEW THEM YOU NEED TO <a href="http://mysite/member.php?action=register" target="_self">REGISTER</a> OR <a href="http://mysite/member.php?action=login" target="_self">LOGIN</a></p>
}
try that in your index if you only want it in the index or else if you want it in every page it goes in your header..
As far as I know, that won't work if you just put that in your templates.
You'd need to use this plugin and use this code instead:
Code:
<if $mybb->user['uid'] then>
<!-- do nothing, user is logged in -->
<else />
<p class="newsbar">ALL FORUMS ARE HIDDEN TO VIEW THEM YOU NEED TO <a href="http://mysite/member.php?action=register" target="_self">REGISTER</a> OR <a href="http://mysite/member.php?action=login" target="_self">LOGIN</a></p>
</if>
I didn't test that, so if it doesn't work, just tell me.
lolwhut? | follow meh on twitter. NAW.
|
|
| 05-08-2009 03:28 AM |
|