You are not logged in. Please login or register.
Active topics Unanswered topics
Search options
I used g_user_title...I guess that works too?
And, hopefully last question. I put a log out button IF they are logged in on my site, using $pun_user['id'] to replace the id variable in the link.
But, when clicked, it just redirects back to the forums -- where it says You are not allowed to view the forums (because I set guests to not be able to.)
Can I make it redirect back to the page it was clicked from, like, a page on my main site? I can use PHP $_SERVER to get the path it's at, if that's neccesary.
Thanks.
Okay, sorry for the triple posting here, but I think I got it to work. It was mad because I was including common.php twice -- e.g. it was working on the site itself, which I wasn't checking, but wasn't working on the forums. It now works, except the "Class:" shows no Title. How can you pull the title of their usergroup? Thank you.
Also, now I have a new error there that says check_cookie is being redeclared?
http://www.simpletorrents.org/forums/
It just displays as if you're still a guest. Even if you are logged in.
It's still not working, using EITHER of:
if($pun_user['is_guest'])
or
if($pun_user['is_guest'] == true)
??
Smartys:
Below is the code I am using but it is not working. It just simply shows the text from my "if true" -- no matter if they are or are not logged in.
<?php
define('PUN_ROOT', './forums/');
define('PUN_TURN_OFF_MAINT', 1);
require PUN_ROOT.'include/common.php';
if($pun_user['is_guest'] == "TRUE")
{
echo "Welcome! Please log in or register to see your stats. <a href=\"/forums/login.php\">Log In</a> · <a href=\"/forums/register.php\">Register</a>";
}
else
{
echo "Hello, <strong>".pun_htmlspecialchars($pun_user['username'])."</strong>. Class: <strong>".pun_htmlspecialchars($pun_user['title'])."</strong> Posts: <strong>".pun_htmlspecialchars($pun_user['num_posts'])."</strong>";
}
?>
So do I just use "isset" for that?
if (isset($pun_user['is_guest'])
or do I need to use something like
if ($pun_user['is_guest'] = "TRUE") ?
Hi!
I am working on website integration and read your article on it at http://www.punbb.org/docs/dev.html.
However, I would like to know if there is an IF statement possible to be used to switch text from "Welcome, username!" to "Welcome, you are not logged in." and link them to the login page etc.
For example, is there something like:
if($punbb['session_logged_in']) {
// Functions if they are logged in
}
else {
// Functions if they're not
}
If this code is possible, will someone please give it to me? It would be greatly appreciated.
Also, on a side note, is anything used within the $pun_user exactly what is in the punbb_users table structure in MySQL?
Thank you!
Posts found: 8