OK, that was stupid.
Thanks for your support.
26 2008-04-27 17:37
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
27 2008-04-27 16:53
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Check if a user is logged in: $pun_user['is_guest']
Member of a user group: $pun_user['g_id'] == SOME_NUMBER
A wrote a piece of code to check, if the user has logged in. The group with the number 5 is the standart-group where all users, who get registrated, have to wait for their (manuell) activation. For registered and activated users, I want to use this piece of code:
if ($pun_user['is_guest'==false] && $pun_user['g_id']!=5)
{ ...
}
But if I check the page, I get the message of the else tag. But im registrated and in der group Administrators - which hasn't got the ID 5.
Thanks!
28 2008-04-27 16:40
Re: My own logout link? (21 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I don't understand: Is there a possibility to insert an logout-link at another part of page? What is the code for it?
Thx!
29 2008-04-27 12:51
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Okay, i see. I've corrected the code:
<?
if($_GET['section'] != board) {
define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);
define('PUN_ROOT', './board/');
require PUN_ROOT.'include/common.php';
}
?>
But now, when I try to open index.php?section=board, the following error appears:
Warning: require() [function.require]: Unable to access ./include/common.php in /srv/www/httpd/phost/d/de/pytalhost/dav/web/ema09/board/index.php on line 27
Warning: require(./include/common.php) [function.require]: failed to open stream: No such file or directory in /srv/www/httpd/phost/d/de/pytalhost/dav/web/ema09/board/index.php on line 27
Fatal error: require() [function.require]: Failed opening required './include/common.php' (include_path='.:/srv/www/httpd/phost/d/de/pytalhost/dav/web/') in /srv/www/httpd/phost/d/de/pytalhost/dav/web/ema09/board/index.php on line 27
I don't exactly know what it means, but I think the script is missing the common.php.
What is wrong?
Thanks a lot!
30 2008-04-27 11:37
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Only include/require common.php once. Require it in the parent script alone, and not in the required/included script.
I only included the common.php once in the index.php. The define/require is only once at the top of index.php.
How do I include generell content (not the board)?
At the place, where the content should be displayed is this code:
<?
switch($_GET['section']){
case "news": include("news.php"); break;
case "links": include("includes/links.php"); break;
default: include("news.php"); break;
}
?>
So, if you type in index.php?section=links you see the page with the links. Now, based on that, I want to include the board:
case "board": include("board/index.php"); break;
PunBB is in the dictionary /board/. But if I run the index.php with index.php?section=board the error in my last post appears.
common.php is included only once - at the top of index.php.
Thanks!
31 2008-04-27 10:29
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Ok, thanks for your help so far.
At the moment I have a problem including the board into my normal website design.
I have got an index.php for my design, and at the content part I have a switch where I include content parts of my page. For example, the script checks index.php?section=contact and includes at that position the content of a file with a contact form.
Now I included the common.php in the file index.php and want to include the board at the content area if the variable is called "board". But when I want to include the board/index.php, this error appears:
Fatal error: Cannot redeclare check_cookie() (previously declared in /srv/www/httpd/phost/d/de/pytalhost/dav/web/ema09/board/include/functions.php:28) in /srv/www/httpd/phost/d/de/pytalhost/dav/web/ema09/board/include/functions.php on line 112
What is wrong?
I only found an explaination to include in the PuBB template, but I want to do it the other way around.
Thanks a lot!
32 2008-04-26 22:02
Re: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi!
Thanks for your help. I included the common.php now.
But how can I use a variable to check if the user is logged in / if the logged in user is member of a special user group?
And:
If you login at the board and than check the website (other pages with the common.php included) - do you stay at the status "logged in"?
Thanks!
D.
33 2008-04-18 12:14
Re: ForumPassat.fr (24 replies, posted in PunBB 1.2 show off)
Very nice - the layout. I'm still looking for a simple, white layout for PunBB - but I wasn't successfully till today.
34 2008-04-18 12:00
Topic: Using the login system of PunBB. (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hello,
Sorry for my English, at first. I know that it's not very good, but I'll try my best. :-)
I'm very happy testing (and using soon hopefully) PunBB - it's quiet an easy and very functional board system. Till now I only tested the functions - now I want start integration the system into my page.
My situation: I want to set other pages of the site with a password - like the user groups in the forum. So, if you login to the forum, it should be possible to surf on the page - being logged in all the time. And if you enter a page, I want to set the following oppotunitys: a) Not logged in (Error & Login-Field), b) Logged in, but the wrong rights = in the wrong user group (Error) and c) Loggin in successfully -> see the content of this site.
Is this possible with the system of PunBB?
I hope you unterstood what I want to say.
Thx,
d.