1

(71 replies, posted in News)

Thanks for reply Smartys wink

The board is here -> http://clopotelfrance.free.fr/forum/index.php

This is a free service from our IProvider -> http://www.free.fr/

2

(71 replies, posted in News)

wink

Smartys wrote:

Makes sense. Try this code from login.php instead

$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i

Yes I tried this code, but redirect_url is always index.php anywhere !?

Exemple, if I read a topic (http://domain.com/forum/viewtopic.php?pid=1618#p1618) , after login in I am on index.php and not in the topic that I read hmm

Why ? sad

3

(71 replies, posted in News)

wink

I have not modified login.php but I made this change -> Add a login form over the header.
I think that the problem is here:

    // Set the $redirect_url to this page, 
    $redirect_url = '' ;
    if(isset($_SERVER['REQUEST_URI'])) {
        $redirect_url = $_SERVER['REQUEST_URI'] ;

May be this part ? -> $_SERVER['REQUEST_URI']

4

(71 replies, posted in News)

Hi all wink

Some problems with redirect_url when login in hmm

My domain -> http://domain.com/
PunBB base url -> http://domain.com/forum

After login in the redirect url is http://domain.com/forum//forum/index.php sad

What can I do please ?

<?php
define('PUN_ROOT', './fora/');
require PUN_ROOT.'include/common.php';
define('PUN_QUIET_VISIT', 1);

if (!$pun_user['is_guest'])
      echo 'Hello '.pun_htmlspecialchars($pun_user['username']); 
else
{
    $redirect_url = '' ;
    if(isset($_SERVER['REQUEST_URI']))
        $redirect_url = $_SERVER['REQUEST_URI'] ;
 
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';

?>
            <form id="login" method="post" action="<?php echo PUN_ROOT.'login.php?action=in'; ?>">
                <input type="hidden" name="form_sent" value="1" />
                <input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
                <?php echo $lang_common['Username'].' ' ?>
                <input type="text" name="req_username" size="13" maxlength="25" /> 
                <?php echo $lang_common['Password'].' ' ?>
                <input type="password" name="req_password" size="13" maxlength="16" /> 
                <input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" />                
            </form>
<?php

}

Hi all wink

I'm trying to integrate PHP121 Instant Messenger in PunBB hmm
http://www.php121.com/

http://www.php121.com/img/ss-login.png

http://www.php121.com/img/ss-contactlist.gif

http://www.php121.com/img/ss-chat.gif

I got some problem with punbb password compatibility !

Can somebody help me please ?

Thx

wink

Hi all wink

I found a little problem when punBB was installed on www.free.fr hmm

Error: Unable to fetch table status.

I must comment this part of code in admin_index.php and then no error !?

// Collect some additional info about MySQL
if ($db_type == 'mysql' || $db_type == 'mysqli')
{
    $db_version = 'MySQL '.$db_version;

    // Calculate total db size/row count
    $result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error());

    $total_records = $total_size = 0;
    while ($status = $db->fetch_assoc($result))
    {
        $total_records += $status['Rows'];
        $total_size += $status['Data_length'] + $status['Index_length'];
    }

    $total_size = $total_size / 1024;

    if ($total_size > 1024)
        $total_size = round($total_size / 1024, 2).' MB';
    else
        $total_size = round($total_size, 2).' KB';
}

roll

8

(10 replies, posted in PunBB 1.2 bug reports)

wink

With Firefox   With IExplorer
http://img291.imageshack.us/img291/2774/withffnj0.th.jpg   http://img111.imageshack.us/img111/5265/withieyt7.th.jpg

9

(10 replies, posted in PunBB 1.2 bug reports)

Hi all wink

Just another little bug hmm

I don't see "Online" or "Offline" with IE7 Final.

May be the "<div class="clearer"></div>" before ?

Hi wink

http://img355.imageshack.us/img355/8213/modtitres1ff.jpg

##
##
##        Mod title:  User title + User custom title + User rank
##
##      Mod version:  1.0.0
##   Works on PunBB:  1.2.11 (should work with all 1.2.*)
##     Release date:  2006-02-18
##           Author:  Fil1958 (http://multy.freezee.org/)
##
##      Description:  With this Mod you can see:
##                    - User title (Administrator, Moderator, Member,...)
##              - User custom title.
##              - User rank (Rank title or rank image)
##              At the same time !!
##
##   Affected files:  include/functions.php
##                    viewtopic.php
##                    profile.php
##              userlist.php
##              moderate.php
##
##       Affects DB:  No
##
##            Notes:  If someboby can translate this Mod in correct English it was great wink
##
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

#
#---------[ OPEN ]---------------------------------------------------------
#

include/functions.php


#
#---------[ FIND (line: 444) ]----------------------------------------------
#

//
// Determines the correct title for $user
// $user must contain the elements 'username', 'title', 'posts', 'g_id' and 'g_user_title'
//
function get_title($user)
{
    global $db, $pun_config, $pun_bans, $lang_common;
    static $ban_list, $pun_ranks;

    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list))
    {
        $ban_list = array();

        foreach ($pun_bans as $cur_ban)
            $ban_list[] = strtolower($cur_ban['username']);
    }

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        @include PUN_ROOT.'cache/cache_ranks.php';
        if (!defined('PUN_RANKS_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_ranks_cache();
            require PUN_ROOT.'cache/cache_ranks.php';
        }
    }

    // If the user has a custom title
    if ($user['title'] != '')
        $user_title = pun_htmlspecialchars($user['title']);
    // If the user is banned
    else if (in_array(strtolower($user['username']), $ban_list))
        $user_title = $lang_common['Banned'];
    // If the user group has a default user title
    else if ($user['g_user_title'] != '')
        $user_title = pun_htmlspecialchars($user['g_user_title']);
    // If the user is a guest
    else if ($user['g_id'] == PUN_GUEST)
        $user_title = $lang_common['Guest'];
    else
    {
        // Are there any ranks?
        if ($pun_config['o_ranks'] == '1' && !empty($pun_ranks))
        {
            @reset($pun_ranks);
            while (list(, $cur_rank) = @each($pun_ranks))
            {
                if (intval($user['num_posts']) >= $cur_rank['min_posts'])
                    $user_title = pun_htmlspecialchars($cur_rank['rank']);
            }
        }

        // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
        if (!isset($user_title))
            $user_title = $lang_common['Member'];
    }

    return $user_title;
}



#
#---------[ REPLACE WITH ]---------------------------------------------------
#

//
// Determines the correct title for $user
// $user must contain the elements 'username', 'title', 'posts', 'g_id' and 'g_user_title'
//
function get_title($user)
{
    global $db, $pun_config, $pun_bans, $lang_common;
    static $ban_list, $pun_ranks;

    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list))
    {
        $ban_list = array();

        foreach ($pun_bans as $cur_ban)
            $ban_list[] = strtolower($cur_ban['username']);
    }

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        @include PUN_ROOT.'cache/cache_ranks.php';
        if (!defined('PUN_RANKS_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_ranks_cache();
            require PUN_ROOT.'cache/cache_ranks.php';
        }
    }

    // If the user has a custom title
    if ($user['title'] != '')
        $user_custom_title = pun_htmlspecialchars($user['title']);
    // If the user is banned
    if (in_array(strtolower($user['username']), $ban_list))
        $user_title = $lang_common['Banned'];
    // If the user group has a default user title
    else if ($user['g_user_title'] != '')
        $user_title = pun_htmlspecialchars($user['g_user_title']);
    // If the user is a guest
    else if ($user['g_id'] == PUN_GUEST)
        $user_title = $lang_common['Guest'];

    // Are there any ranks?
    if ($pun_config['o_ranks'] == '1' && !empty($pun_ranks))
    {
        @reset($pun_ranks);
        while (list(, $cur_rank) = @each($pun_ranks))
        {
            if (intval($user['num_posts']) >= $cur_rank['min_posts'])
                $user_rank = pun_htmlspecialchars($cur_rank['rank']);
        }
    }

        // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
        //if (!isset($user_title))
            //$user_title = $lang_common['Member'];
   

    return array( $user_title, $user_custom_title, $user_rank );
}

#
#---------[ OPEN ]---------------------------------------------------------
#

viewtopic.php

#
#---------[ FIND ]----------------------------------------------
#

// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, g.g_set_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());

#
#---------[ FIND ]----------------------------------------------
#

        $user_title = get_title($cur_post);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

        $user_array = get_title($cur_post);
        $user_title = $user_array[0];
        $user_custom_title = $user_array[1];
        $user_rank = $user_array[2];

#
#---------[ FIND ]----------------------------------------------
#

        if ($pun_config['o_censoring'] == '1')
            $user_title = censor_words($user_title);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

        if ($pun_config['o_censoring'] == '1')
        {
            $user_title = censor_words($user_title);
            $user_custom_title = censor_words($user_custom_title);
        }

#
#---------[ FIND ]----------------------------------------------
#

    // If the poster is a guest (or a user that has been deleted)
    else
    {
        $username = pun_htmlspecialchars($cur_post['username']);
        $user_title = get_title($cur_post);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

    // If the poster is a guest (or a user that has been deleted)
    else
    {
        $username = pun_htmlspecialchars($cur_post['username']);
        $user_array = get_title($cur_post);
        $user_title = $user_array[0];

#
#---------[ FIND ]----------------------------------------------
#

                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
                    <dd class="postavatar"><?php echo $user_avatar ?></dd>

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
                    <dd class="usertitle"><?php if ($cur_post['g_set_title'] == '1') echo $user_custom_title ?></dd>
                    <dd class="postavatar"><?php echo $user_avatar ?></dd>
                    <dd class="usertitle"><?php echo $user_rank ?></dd>

#
#---------[ OPEN ]---------------------------------------------------------
#

userlist.php

#
#---------[ FIND ]----------------------------------------------
#

        $user_title_field = get_title($user_data);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

        $user_array = get_title($user_data);
        $user_title_field = $user_array[0];

#
#---------[ OPEN ]---------------------------------------------------------
#

profile.php

#
#---------[ FIND ]----------------------------------------------
#

        $user_title_field = get_title($user);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

    $user_array = get_title($user);
    $user_title_field = $user_array[0];

#
#---------[ OPEN ]---------------------------------------------------------
#

moderate.php

#
#---------[ FIND ]----------------------------------------------
#

            $user_title = get_title($cur_post);

#
#---------[ REPLACE WITH ]---------------------------------------------------
#

            $user_array = get_title($cur_post);
            $user_title = $user_array[0];

#
#---------[ SAVE and UPLOAD ]---------------------------------------------------
#

Enjoy !

wink

Another "bug" !

It's not possible to bookmark a forum.
The url is already "http://domaine.com/the_forums/index.php"   hmm

Hi wink

I find a little bug hmm

The folders (cache, avatars,..) are the same for all forums !? sad

13

(68 replies, posted in PunBB 1.2 discussion)

Hi all wink

I saw that -> http://revo-forum.berlios.de/forum/

Limber wrote:

Nowhere on this site do I find any mention of the origins of this forum, which apparently is punbb.

Reading through the source code I find that you have removed all copyright notices.

What do you have to say for yourselves?

kiefer wrote:

Apparently? PunBB? you should check your words before saying something like that. Revo is not related in any way to PunBB, it does not borrow code from it as it does not borrow code from any other forum software. If it "looks" like PunBB, i must say that Linux also "looks" like Windows because it has shiny windows and buttons and a start button. Please do not come here with such claims, you'll get nothing from here.

Kiefer

http://revo-forum.berlios.de/forum/view_topic.php?id=99


http://img488.imageshack.us/img488/8001/snap5sn.jpg

big_smile

BBcode [hide]

http://img143.imageshack.us/img143/2760/h6vz.gif

Only members can see hidden text !

the text is replaced with this...

http://img255.imageshack.us/img255/8489/hide8ej.gif


Edit 'include/parser.php'

Add the function

//
//Function hide text
//
function do_hide($text)
{
    global $pun_user;

    if ($pun_user['is_guest'])
        $text = preg_replace('#\[hide\](.*?)\[\/hide\]#si','<span><center><img src="./img/hide.gif"/></center></span>', $text);
    else
        $text = preg_replace('#\[hide\](.*?)\[\/hide\]#si','<span>$1</span>', $text);

        return $text;
}

Search

//
// Parse message text
//
function parse_message($text, $hide_smilies)
{
    global $pun_config, $lang_common, $pun_user;

    if ($pun_config['o_censoring'] == '1')
        $text = censor_words($text);

    // Convert applicable characters to HTML entities
    $text = pun_htmlspecialchars($text);

After Add

        $text = do_hide($text);

It's not perfect sad

Hello everyone wink

I just made a little Mod to hide text in post with BBcode tags!

[hide]Hidden text[/hide]

It works with small text, smilies, but I got bugs with other BBcode... (code tag...)

You can test it here -> http://multy.freezee.org/viewtopic.php?pid=233#p233

Sorry hmm

The server have some problems !
Try again later please

Edit: Link is working now !

Hello wink

First, sorry for my English hmm

I made a little modification that can interest someone ! (I am a newbie in php code)
You can display only the category of your choice while clicking on it !

You can see it in action here

Edit 'index.php'

Search

// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Replace with

if (isset($c))
$extra = $_GET['c'];
else
$c = 0;

if ($c == 0)

// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

else

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE c.id='.$extra.' AND (fp.read_forum IS NULL OR fp.read_forum=1) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Search

<div id="idx<?php echo $cat_count ?>" class="blocktable">
    <h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>

Replace with

<div id="idx<?php echo $cat_count ?>" class="blocktable">
    <h2><span><?php if ($c == 0) echo '<a href="index.php?c='.$cur_forum['cid'].'">'.pun_htmlspecialchars($cur_forum['cat_name']).'</a>'; else echo '<a href="index.php">'.pun_htmlspecialchars($cur_forum['cat_name']).'</a>'; ?></span></h2>

Et voilà tongue