PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#51 2007-04-13 01:55:18

osccar
New member
From: Linköping, Sweden
Registered: 2007-03-27
Posts: 1

Re: PBB ChatBox 2.0

All non pure-ascii characters turns to "???????" when they are posted in the chatbox, and they are stored as "?????" in the database (MySQL 5), and I can't figure out why.
Since we use a lot of non-ascii characters in our communication, this gets very annoying for our users.

How do i make it work?
I haven't made any modifications to the files posted in this thread, so I'm pretty sure it's not my fault either.

Offline

 

#52 2007-04-17 08:30:52

lucasnet
New member
Registered: 2007-04-17
Posts: 1

Re: PBB ChatBox 2.0

Hi. I have a little problem with chatbox smile

Everyting looks good but when enter to any topic any style dont load and at the footer i see:

Fatal error: Cannot redeclare preparse_bbcode() (previously declared in /home/knagafor/public_html/include/parser.php:41) in /home/knagafor/public_html/include/parser.php on line 41

The same error i have when set ,that guests cant see chatbox.

Pls help. I am using punbb 1.2.15

Offline

 

#53 2007-05-10 18:36:18

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: PBB ChatBox 2.0

is there a way to see a list of all users currently in the chatroom ?

So when people go to the chat screen they know if anyone else is in there with them.

Offline

 

#54 2007-06-01 16:11:49

alana
Member
From: Maine, USA
Registered: 2007-05-30
Posts: 44
Website

Re: PBB ChatBox 2.0

nifty-stuff.com wrote:

A quick follow up on my post above.   How can we get the chat message on the same line as the username?  Right now the message is put on a new line under the post which makes users a bit frustrated.

Thanks to anyone who can figure it out!!

I am also interested in how to fix this. I have looked through everything I can think of, but I do not have a good understanding of php, so I am probably missing where in the code this line break is forced.

right now my settings:

Message Separation
<hr noshade size=1>

Message Display
<strong><pun_username></strong> - <pun_date> - <pun_admin>: <pun_message>

My other question is that I thought there would be a delete option for Admin, but I don't see it. Is there syntax for this I should put into the Message Display?

Offline

 

#55 2007-06-08 01:35:05

punBBfan
Member
Registered: 2007-05-21
Posts: 29

Re: PBB ChatBox 2.0

Is this still updated by the author ?
Is it OK with the 1.2.15 ?

Offline

 

#56 2007-06-08 01:37:42

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: PBB ChatBox 2.0

yeah works fine with 1.2.15

Offline

 

#57 2007-06-08 11:20:51

punBBfan
Member
Registered: 2007-05-21
Posts: 29

Re: PBB ChatBox 2.0

Ok but I see release date:  2006-06-29

Is it still updated ? Is it bug and security fixed ?

I see a lot of questions in this topic that are not answered by the author...

The project isn't supported anymore ?

Offline

 

#58 2007-06-08 16:46:17

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: PBB ChatBox 2.0

im using it and it works fine...you may need to change the installer to say 1.2.15

and yep you are probably right it is not supported anymore by the looks of things.

Offline

 

#59 2007-06-08 17:37:10

alana
Member
From: Maine, USA
Registered: 2007-05-30
Posts: 44
Website

Re: PBB ChatBox 2.0

alana wrote:

My other question is that I thought there would be a delete option for Admin, but I don't see it. Is there syntax for this I should put into the Message Display?

My only update on this is that I tried setting the display (in admin options) to 0 messages and saving that to clear all the messages, which did not work (but did not allow any ADDITIONAL messages to be posted). So I had to go into the database (I use phpmyadmin) and manually flush the table storing the messages.

There has got to be a better way to manage the chat messages ! ):

Offline

 

#60 2007-07-01 05:50:54

hungrycoder
Member
Registered: 2007-04-09
Posts: 12

Re: PBB ChatBox 2.0

i just installed the script and it working amazing except:
1.
my forum (http://forum.projanmo.com) is in Bangla (in Unicode). Everthing in Bangla. Even usernames. So when moderators or admin logins using bangla name it still works fine. but it does not work (gets BAD REQUEST error in the textarea when they type and press enter) when member enters using Bangla username. But when member enters using english username it is again fine

2. when guests chats, again bangla does not come correctly except ???

3. It will be nice to chat chatters list smile

Last edited by hungrycoder (2007-07-01 05:56:38)

Offline

 

#61 2007-07-01 06:11:24

hungrycoder
Member
Registered: 2007-04-09
Posts: 12

Re: PBB ChatBox 2.0

i just test it. its working fine in my local server. but problem persists in web server

Offline

 

#62 2007-07-02 05:11:26

doki
Member
Registered: 2007-04-30
Posts: 225

Re: PBB ChatBox 2.0

How to make the chabox link on navigation bar hide if the user is not login(guest)?

Offline

 

#63 2007-07-02 06:01:44

mdfh
Member
Registered: 2006-06-04
Posts: 13

Re: PBB ChatBox 2.0

doki wrote:

How to make the chabox link on navigation bar hide if the user is not login(guest)?

include/functions.php

find
//
// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()


refer to defult items and edit.

Offline

 

#64 2007-07-02 06:07:19

doki
Member
Registered: 2007-04-30
Posts: 225

Re: PBB ChatBox 2.0

thanks for the reply. I found this

Code:

// Are there any additional navlinks we should insert into the array before imploding it?
    if ($pun_config['o_additional_navlinks'] != '')
    {
        if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))
        {
            // Insert any additional links into the $links array (at the correct index)
            for ($i = 0; $i < count($extra_links[1]); ++$i)
                array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
        }
    }

how can I modify this that I will not show on the guest account?

Offline

 

#65 2007-07-05 02:25:27

crusader
Member
From: Canada
Registered: 2006-10-26
Posts: 219
Website

Re: PBB ChatBox 2.0

Has anyone been able to make this chatbox into a side block?

Offline

 

#66 2007-07-18 18:42:34

no64
Member
Registered: 2007-06-20
Posts: 179

Re: PBB ChatBox 2.0

What about open it with Highslide? Would look perfect.

Haven't implement it yet, is there some demo or working chatbox I can have a look to?

Offline

 

#67 2007-07-18 18:47:07

doki
Member
Registered: 2007-04-30
Posts: 225

Re: PBB ChatBox 2.0

check here:

for chatbox:

---removed----

for highslide implementation:

--removed---

Last edited by doki (2008-01-08 04:59:02)

Offline

 

#68 2007-07-18 18:52:10

no64
Member
Registered: 2007-06-20
Posts: 179

Re: PBB ChatBox 2.0

...can't see/find the highslide implementation

btw. nice styled site

Offline

 

#69 2007-07-19 00:00:33

doki
Member
Registered: 2007-04-30
Posts: 225

Re: PBB ChatBox 2.0

If you see the thumbnails on the profile. Just chick it. the image will expand.

Offline

 

#70 2007-07-19 08:48:55

no64
Member
Registered: 2007-06-20
Posts: 179

Re: PBB ChatBox 2.0

smile .... sorry, I didn't mean "highslide" with pics  - I ment open the chatbox with Highslide, so you have the chatbox in a draggable window...

Offline

 

#71 2007-07-19 16:36:13

doki
Member
Registered: 2007-04-30
Posts: 225

Re: PBB ChatBox 2.0

Ah ok... I think thats not possible on highslide. You need to hack on js script smile

Offline

 

#72 2007-07-19 21:38:26

quaker
Member
From: Bama,USA
Registered: 2006-02-23
Posts: 968
Website

Re: PBB ChatBox 2.0

i started hacking at this and i got it working on a single page. here is my code... if someone can fix the sql error it will work!! once i take it out of a page and try to make a mod via include/user folder.. i get errors.
demo of this file..
http://rc3racing.com/test.php

Q


Code:

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / New page 1';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
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'; 
?>

<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" style="width:220px;">
   <h2>
    <span>
        <span class="conr" ><img style="display:none;" id="loading" name="loading" src="img/chatbox/loading.gif" /></span>
    Shout It!
    </span>
  </h2>
    <div class="box">
        <div id="chatbox" class="inbox" style="overflow:auto;height:100px; width:200px;">
<?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>
  
    <span><p></p>&nbsp;
    <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 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>
         <span>
         <input type="text" name="req_message"  id="req_message" value="<?php if (isset($_POST['req_message'])) echo pun_htmlspecialchars($message); ?>" width="100%" maxlength="<?php echo $pun_config['cb_msg_maxlength'] ?>"  tabindex="<?php echo $cur_index++ ?>" />
         </span>
         <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>
 
</div>
<p></p>&nbsp;
<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

require PUN_ROOT.'footer.php';

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#73 2007-07-19 21:43:40

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: PBB ChatBox 2.0

i think what this mod could really do with is a way to see who else is looking at the page chatbox.php, then there could be a box saying "currently chatting" to the right of the chatbox....there must be some freely available ajax that sends a signal too and from the client to check that a user is still on the desired page...and if they navigate away they are taken off the "currently in chatroom" list.   I'll have a look into this.

Last edited by nickfzx (2007-07-19 21:44:03)

Offline

 

#74 2007-07-20 08:38:27

no64
Member
Registered: 2007-06-20
Posts: 179

Re: PBB ChatBox 2.0

Do the conversations have to be stored - can't it be used like a "normal" chat, where two people can chat with each other and nobody else can see what they are "chatting" ?

Offline

 

#75 2007-07-20 08:55:56

no64
Member
Registered: 2007-06-20
Posts: 179

Re: PBB ChatBox 2.0

..oh, I think I misunderstood the usage  - it is a chatroom, not a skype-like-thing
hey, but a "private" chat would be nice, instead of private messages

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.