Thanks Steven,

Indeed it is !!!  Found it few minutes before your post smile

DIV.blockpost DIV.box, DIV.postright, DIV.postfootright {BACKGROUND-COLOR: #F5E29E;}
DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #F4EEC6;}
DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #F4EEC6;}

Note that BORDER-LEFT-COLOR should be the same than BACKGROUND-COLOR.

Thanks for your help !!!
Tommy

http://www.webkenya.com/Untitled-1.gif

Any help to resolve this small problem (the black part) would be highly appreciated.

Thank you
Tommy

Hi,

I have currently one minor problem with CSS.  My level in CSS is good and was confident to find the solution by myself but sadly I didn't... sad

How to assign a fixed height to the BR tag, that is a height independant from parent element (e.g. <p>).

Thank you

4

(95 replies, posted in News)

Thanks for the update !!!

I have seen that in some table (like prefix_posts),

message TEXT NOT NULL DEFAULT '',

has been changed with

message TEXT,

I guess modification should also be brought to the database, meaning changing NOT NULL to NULL (using Phpmyadmin) or can I just leave the databases as it is ???

Thanks

Wait to see mine !!! 

The forum is fully integrated in my website !! With different color per section !!
Not launched yet...  Coming soon.

Three snapshosts below for your eyes smile  (I hope it is allowed)
Enjoy !!

http://us.f13.yahoofs.com/bc/4424b04dm253cac82/bc/Mes+documents/Forum1.gif?bfdD_gEB26ubWGgn
http://us.f13.yahoofs.com/bc/4424b04dm253cac82/bc/Mes+documents/Forum3.gif?bfdD_gEBMCpZ8Kqh
http://us.f13.yahoofs.com/bc/4424b04dm253cac82/bc/Mes+documents/Forum4.gif?bfdD_gEB7QFfNNWw

Please could you let me know if the logic below has been respected.
Thanks

// *************
// Check cookie!
// *************
function check_cookie(&$pun_user) {
    global $db, $pun_config, $cookie_name, $cookie_seed;

    $now = time();
    $expire = $now + 31536000;    // The cookie expires after a year

    // We assume it's a guest
    $cookie = array('user_id' => 1, 'password_hash' => 'Guest');

    // If a cookie is set, we get the user_id and password hash from it
    if (isset($_COOKIE[$cookie_name]))
    {
        list($cookie['user_id'], $cookie['password_hash']) = @unserialize($_COOKIE[$cookie_name]);

        if ($cookie['user_id'] > 1)
        {
        // Check if there's a user with the user ID and password hash from the cookie
        $result = $db->query('SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error());
        $pun_user = $db->fetch_assoc($result);

            // If user authorisation failed
            if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash'])
            {
            pun_setcookie(0, random_pass(8), $expire);
            set_default_user();
            return;
            }

        // Set a default language if the user selected language no longer exists
        if (!@file_exists(PUN_ROOT.'lang/'.$pun_user['language']))
            { $pun_user['language'] = $pun_config['o_default_lang']; }

        // Set a default style if the user selected style no longer exists
        if (!@file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css'))
            { $pun_user['style'] = $pun_config['o_default_style']; }

        if (!$pun_user['disp_topics'])
            { $pun_user['disp_topics'] = $pun_config['o_disp_topics_default'];}
        if (!$pun_user['disp_posts'])
            { $pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];}

        if ($pun_user['save_pass'] == '0')
            { $expire = 0; }

        // Define this if you want this visit to affect the online list and the users last visit data
        if (!defined('PUN_QUIET_VISIT'))
        {
            // Update the online list
            if (!$pun_user['logged'])
            {
                $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
            }
            else
            {
                // Special case: We've timed out, but no other user has browsed the forums since we timed out
                if ($pun_user['logged'] < ($now-$pun_config['o_timeout_visit']))
                {
                    $db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
                    $pun_user['last_visit'] = $pun_user['logged'];
                }
            }

                $idle_sql = ($pun_user['idle'] == '1') ? ', idle=0' : '';
                $db->query('UPDATE '.$db->prefix.'online SET logged='.$now.$idle_sql.' WHERE user_id='.$pun_user['id']) or error('Unable to update online list', __FILE__, __LINE__, $db->error());
            }
        }

        $pun_user['is_guest'] = false;
    }
    else
    { 
    set_default_user();
    }
}

I am having problems to rewrite the check_cookie() function.

Because some { and } have been omitted, I find it difficult to understand the logic of all the if and else statement.

I would really appreciate if one of the PUNBB guru could post this function with all the { and }, this would make my day smile

Thank you

8

(1 replies, posted in PunBB 1.2 discussion)

Look for a function called "generate_navlinks()" into include/functions.php.

Hi,

I have been playing with this great forum today and managed to integer it to my existing website and membership system very easily (even more easily than minibb).

The method used is pretty simple.
Below, what I have done to my already existing page.

REGISTRATION PAGE & USER DATABASE
1/ Use pun_hash($str) to encrypt the password when register.

LOGIN PAGE
1/ Use pun_hash() function to see if password match.
2/ Remove guest entry from the online database.
3/ Send cookie using pun_cookie() function.

LOGOUT PAGE
1/ Refresh cookie data and send cookie using pun_cookie() function
2/ Remove user entry from the online database.

Still need to work on the password retrieval system.
Nonetheless, I would like to know if :

1/ I can delete the register.php and login.php from the forum folder without any problems (knowing that I have removed the link from the navigator bar) ?  Is there any other links linking to these two pages apart these in the navigator bar.

2/ Where can I find the script who does the calculation of the idle time (the idle row found in the online database).

Thank you.