Archives FluxBB.fr

Les archives de FluxBB.fr

Vous n'êtes pas identifié(e).

#1 17-02-2007 21:34:54

Zh0bel
Membre

[Résolu] Gros problème chatbox !

Après avoir installer la shoutbox de jojo_pokemon PBB CHATBOX 2.0

J'ai décidé de la mettre en acceuil, enfin a l'index des forums , j'ai tout suivi mais j'ai cette erreur quand je regarde un post :

Fatal error: Cannot redeclare preparse_bbcode() (previously declared in /home.10.6/zonetuto/www/forums/include/parser.php:41) in /home.10.6/zonetuto/www/forums/include/parser.php on line 41

Hors ligne

#2 17-02-2007 22:14:46

Zh0bel
Membre

Re : [Résolu] Gros problème chatbox !

Mon problème est réglé en fait je comprenais pas trop vu que c'est en anglais il faut modif le index.php et mettre :

////////////////////////////////////////////////////////////////////////////////
// THE BEGIN of PBB Chatbox 2.0 on index

$pun_config['cb_height'] = '150'; // Height of the chatbox in px

require PUN_ROOT.'include/parser.php';

// Load the chatbox.php and post.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/chatbox.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';

// This particular function doesn't require forum-based moderator access. It can be used
// by all moderators and admins.
if (isset($_GET['get_host']))
{
    if ($pun_user['g_id'] > PUN_MOD)
        message($lang_common['No permission']);
    
    // Is get_host an IP address or a post ID?
    if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
        $ip = $_GET['get_host'];
    else {
        $get_host = intval($_GET['get_host']);
        if ($get_host < 1)
            message($lang_common['Bad request']);
        
        $result = $db->query('SELECT poster_ip FROM '.$db->prefix.'chatbox_msg WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
        if (!$db->num_rows($result))
            message($lang_common['Bad request']);
    
        $ip = $db->result($result);
    }
    
    message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
}

if ($pun_user['g_read_chatbox'] != '1')
    message($lang_chatbox['No Read Permission']);

?>
<script type="text/javascript" src="include/lib/js/prototype.js"></script>
<script type="text/javascript" src="include/lib/js/chatbox.js"></script>
<div class="block">
   <h2>
    <span>
        <span class="conr" ><img style="display:none;" id="loading" name="loading" src="img/chatbox/loading.gif" /></span>
    <?php echo $lang_chatbox['Chatbox'] ?> <span style="font-size:7px;vertical-align:super;">© PBB ChatBox <?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['cb_pbb_version']; ?></span>
    </span>
  </h2>
    <div class="box">
        <div id="chatbox" class="inbox" style="overflow:auto;height:<?php echo $pun_config['cb_height'] ?>px;">
<?php

$cur_msg_txt = '';
$last_msg_time = '';
$count_id = array();

$result = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());

$new_msg_time = false;
while ($cur_msg = $db->fetch_assoc($result)) {
    
    // Get newest timestamp
    if ($new_msg_time == false) {
        $last_msg_time = $cur_msg['posted'];
        $new_msg_time = true;
    }
    $cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'].$cur_msg_txt;
    
    if ($cur_msg['g_id'] != PUN_GUEST)
        $cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
    else
        $cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
    
    $cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
    
    if ($cur_msg['g_id'] != PUN_GUEST)
        $cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
    else {
        if (!isset($count_id[$cur_msg['poster']])) {
            $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
        
            $count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
            $num_post = $db->result($count);
            $count_id[$cur_msg['poster']] = $num_post;
        }
        else
            $num_post = $count_id[$cur_msg['poster']];
        
        $cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
    }
    
    $cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
    
    if ($pun_user['g_id'] < PUN_GUEST) {
        $cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
        if ($cur_msg['poster_email'])
            $cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ]';
        else
            $cur_msg_admin .= ' ] ';
    }
    else
        $cur_msg_admin = '';
    
    $cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
    $cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
}

if (!$cur_msg_txt)
    echo $lang_chatbox['No Message'];
else
    echo "\t\t\t".$cur_msg_txt."\n";
?>
        </div>
    </div>
  <h2>
    <span>
    <script language="javascript">
    <!--
    // This checkbox is utterly useless, unless we have javascript enabled. As such, we won't display it until then.
    document.write('<span class="conr" style="width:150px;" ><?php echo $lang_chatbox['Autoscroll'] ?>: <input type="checkbox" id="autoscroll" value="" checked  tabindex="<?php echo $cur_index++ ?>" /></span>');

    // -->
    </script>
<?php
if ($pun_user['g_post_chatbox'] == '1') {
    $cur_index = 1;
?>
      <form style="display: inline" id="post" method="post" name="formulaire" action="chatbox.php" onsubmit="send_message(); return false;">
         <input type="hidden" name="form_sent" value="1" />
         <input type="hidden" name="form_user" id="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
<?php
    if ($pun_user['is_guest']) {
        $email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].':</strong>' : $lang_common['E-mail'];
        $email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
        
        if($email_form_name = 'req_email')
            echo "\t".'<input type="hidden" name="email" id="email" value="" />'."\n";
        else
            echo "\t".'<input type="hidden" name="req_email" id="req_email" value="" />'."\n";
?>
          <strong><?php echo $lang_post['Guest name'] ?>:</strong> <input type="text" name="req_username" id="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="15" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /> 
          <?php echo $email_label ?> <input type="text" name="<?php echo $email_form_name ?>" id="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="15" maxlength="50" tabindex="<?php echo $cur_index++ ?>" /> 
<?php
    }
    else {
?>
          <input type="hidden" name="req_username" id="req_username" value="" /> 
          <input type="hidden" name="email" id="email" value="" /> 
          <input type="hidden" name="req_email" id="req_email" value="" /> 
<?php
    }
?>
         <strong><?php echo $lang_chatbox['Message'] ?>:</strong> <input type="text" name="req_message"  id="req_message" value="<?php if (isset($_POST['req_message'])) echo pun_htmlspecialchars($message); ?>" size="35" maxlength="<?php echo $pun_config['cb_msg_maxlength'] ?>"  tabindex="<?php echo $cur_index++ ?>" /> 
         <input type="submit" name="submit" value="<?php echo $lang_chatbox['Btn Send'] ?>" accesskey="s" tabindex="<?php echo $cur_index++ ?>" />
    <script language="javascript">
    <!--
    document.formulaire.req_message.focus();
    // -->
    </script>
    </form>
<?php
}
else
    echo $lang_chatbox['No Post Permission'];
?>
    </span>
  </h2>
</div>

<script language="javascript">
    // Begin getting messages
    var LastMsg = '<?php echo $last_msg_time; ?>';
    $('autoscroll').value = 'true';
    get_messages();
    checker = new PeriodicalExecuter(get_messages, <?php echo $pun_config['cb_ajax_refresh']; ?>);
</script>
<?php
// THE END of PBB Chatbox 2.0 on index
////////////////////////////////////////////////////////////////////////////////

Après :

require PUN_ROOT.'header.php';

Merci

Hors ligne

Pied de page des forums