Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
newsbar help
Author Message
edielinux
Junior Member


Posts: 23
Joined: May 2009
Reputation: 0
MyBux: 16
Post: #1
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
Post: #2
RE: newsbar help
well it could probably be done with some PHP but I don't know much of that

Thanks Polarbear541! (Polar or PB)
Admin at Tech Talk
Tuts Team at MyBBSource
Super Mod at AdminSpace.net
Admin at Traffikr.net

[Image: polarbear541.png]
05-05-2009 03:39 AM


madshark
Member


Posts: 185
Joined: Feb 2009
Reputation: 0
MyBux: 300
Post: #3
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
Post: #4
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
Post: #5
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
 




New to MyBBSource?Need Assistance?
  • Mark Forums Read
  • View Forum Staff
  • Looking for a MyBB Host?

  



Theme created by AK-47. Find more great themes and skins at K! Dezign R1s.net