Topic: Highlight Search Results

This is on phpbb and i would like it to be used on this system, a highlight option, where the search results are highlighted.

p.s, is it possible to use the user management system accross an entire site. I.e. include a file and then certain options on the page will be avaliable dependng if the user is logged in?

thanks

smile

Re: Highlight Search Results

mavoric wrote:

This is on phpbb and i would like it to be used on this system, a highlight option, where the search results are highlighted.

Maybe. I'll consider it.

mavoric wrote:

p.s, is it possible to use the user management system accross an entire site. I.e. include a file and then certain options on the page will be avaliable dependng if the user is logged in?

Yes. Have a look at the top of basically all scripts. First, $pun_root is defined, then include/common.php is included. After that, you have access to a number of PunBB arrays. Here's an example:

$pun_root = './forums/';  // Path to the forum root directory (must be defined)
require $pun_root.'include/common.php';

if ($cookie['is_guest'])
{
    // The visitor is a guest. Do whatever.
}
else
{
    // The visitor is logged in.

    echo 'Hello '.pun_htmlspecialchars($cur_user['username']);
}
"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Highlight Search Results

thanks, il try that

Re: Highlight Search Results

ok, i tried that (but i put it in a file to include), but it said thought i was a guest, so i went and checked, and it said i was logged on

do you know whats causing this?

5 (edited by jochem 2004-02-27 18:33)

Re: Highlight Search Results

for me it's the other way around, i'm always logged in, even after i logged out...
but it only shows "Hello", it does not show the username.

Re: Highlight Search Results

do you have to put it in te root directory to make this work?

thats wierd for it to do that jochem, i know in phpbb i used to have that prob

Re: Highlight Search Results

oh, and Rickard, that doesn't show the username

Re: Highlight Search Results

Sorry, it should be username, not Username. I've update the post above to reflect the change.

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

Re: Highlight Search Results

it is so weird, after i gave manually removed the cookie from my hd, i'm logged off from the forum, but the page i put that code on still shows me as logged in and shows my username.... mmm.

Re: Highlight Search Results

Yes, that is weird. Try removing all your cookies or something.

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

11

Re: Highlight Search Results

well, on my laptop i'm always a guest, it's a new laptop so there are/were no cookies on it yet when i tried. But after logging in i keep being a guest on that page...

Re: Highlight Search Results

Well, then it's a problem with your browser or you have incorrect settings for cookie_domain and/or cookie_path in your config.php.

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

Re: Highlight Search Results

ok this seems wierd, when i put that code in, it makes my server run in ultra slow mode. So i changed it to require_once, and it still caused it

any ideas?

Re: Highlight Search Results

Nope, no idea. What happens exactly?

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

Re: Highlight Search Results

ok don't worry i sorted it, just had made it do a loop so it had to load a file in which it was already loading

thanks