1 (edited by Ev!L-E!NsTe!N 2015-02-13 02:35)

Topic: ...

...

Re: ...

Have a look at basically any of the scripts from PunBB. At the top you will find the include code for common.php and then a permission check that displays a message if the page can only be viewed by logged in users. You could modify that code slightly to always display that message. Something like this:

<?php

$pun_root = './';
require $pun_root.'include/common.php';

if ($cookie['is_guest'])
    message($lang_common['Login required']);

// Your code here

?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: ...

exit;

?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4

Re: ...

hi
when i include my home page
  include/common.php'
is must add in end the of page ?

$db->close();

to close database as like in footer.php of forum ?

If your people come crazy, you will not need to your mind any more.

Re: ...

Well, you can. It isn't vital, but it's not a bad idea.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6 (edited by joshua 2004-10-12 22:42)

Re: ...

How to change the $pun_root  value when the php file is not in the same directory as the forum?
I tried both absolute path and relative path, neither of them work. The error information is "There is no valid language pack 'en' installed. Plese check $language setting in config.php."

Update: the problem is solved. It was due to config.php for punbb, where I set $pun_root to './'. After removing this line from config.php, the authentication process works.