Hello,
I have looked and I have found something close to what I need but, they don't do what I need it to do. I am just wanting a simple div box that will go right above the breadcrumb and below the menu on a Default theme using 2.0.2 that I can put some info in like "You are not logged in, please log in or register yada, yada, yada. This info bar will only show to Non members or members not logged in. When the user logs in the bar disappears. I had this many years ago when I used phpBB, and was curious if this could be done or if there is a mod that will do this. I know when I had it on phpBB it was a really simple code edit. I figured it would be the same for here.
-Thanks
Do you know any PHP Coding?
Lainaus käyttäjältä: Fog - toukokuu 21, 2012, 09:18:22 IP
Do you know any PHP Coding?
If I did I wouldn't really be asking. I know enough to make my way around, but not really wanting to reinvent the wheel if there is already something out there.
It might be easier to create your own mod, the reason I ask is I've created a info bar below the main menu but never tried to put permissions into the PHP code I modified. It wouldn't be hard to create permissions.
Yea creating the actual div bar wouldn't be hard at all. I just don't know what code is used to display or not display something when a user is not logged in. On phpBB it wasn't hard at all. But the code for SMF is a lot more complex then phpBB was back then.
Hint: Lets look at the PHP code that displays the Admin Button on the Menu, from there one can apply that PHP code to the info bar div code.
That complicates things more then it should because that is permission based and only shows to admin. It would need to show for guests and then disappear for registered users once they have logged in.
I'm sure there are mods for this, register bar or similar.
Lainaus käyttäjältä: Texan78 - toukokuu 21, 2012, 10:24:46 IP
That complicates things more then it should because that is permission based and only shows to admin. It would need to show for guests and then disappear for registered users once they have logged in.
The only thing I'm trying to point out is how does the php code help you with your idea. I for one would look at how the PHP code and try to understand what one has to put into place to create premission.
Then try to use "Regular Members" instead of where it says "Admin"
Just ideas if you don't find the right MOD.
Lainaus käyttäjältä: Arantor - toukokuu 21, 2012, 10:27:38 IP
I'm sure there are mods for this, register bar or similar.
Hey Arantor, Long time how are you?
Let's just say I've been better, thanks, how about you?
Whats been going on over on Shawns Sites? I haven't been over there in awhile.
Lainaus käyttäjältä: Arantor - toukokuu 21, 2012, 10:49:55 IP
Let's just say I've been better, thanks, how about you?
I hear you otherwise, didn't know you posted here.
Fog
Ok here is what I got which works, but I need it to work when user is logged out not logged in...
// Information bar for guest or user not logged in.
if ($context['user']['is_logged'])
{
echo ' <p class="windowbg description">WELCOME</p>';
}
So I need to change "is_logged" to logged out but I don't know what the function should be for logged out users. It works not if a user is logged in and doesn't show when they are logged out. I just need to switch it now.
Ok I figured it out, is_logged needs to be changed to is_guest and it will only show when they are not logged in or registered.
Now just need to figure out how to add the text so I can put it in a language file.
EDIT: all is sorted and working exactly as I am needing. Thank you Fog for your suggestions.
Glad to hear Texan78, I'm going to try setting an info bar now with permissions.
Well looking for a different mod I came across this one that is exactly what I was looking for that I have pretty much done. Just without the admin CP which is nice. So thought I would share it if anyone else was interested. I think I may back up my code and test it out and see how well it works. What I have now is simple and easy and works, only bad thing is the text is hard coded where this mod allows you to edit and style it from the admin CP.
http://custom.simplemachines.org/mods/index.php?mod=2607