1 (edited by keeshii 2015-11-02 13:05)

Topic: [Extension] om_shoutbox 0.0.5

Hi,

Shoutbox - allows user to talk in chat-like window.

om_shoutbox 0.0.5 (current): om_shoutbox-0.0.5.zip

Changelog:
0.0.5 - 2014-09-16
integration with om_warnings (blocking access to shoutbox)
compability with postgres

0.0.4 - 2013-11-24
configurable by admin: decode smilies in messages, guests can view shoutbox.
added ref="nofollow" to links

0.0.3 - 2013-10-11
Don't check session when refreshing the messages. Starting session each 3 seconds slows down the server.

0.0.2 - 2013-09-06
added some settings in administration panel
users may chenge their color in profile settings

0.0.1 - 2013-04-13
simple extension, allow posts messages, decodes bold tag and url links

The source code is very simple, everyone should be able to make changes in it smile

Some screenshost:
http://dev.poldrag.katowice.pl/distfile … utbox1.png
http://dev.poldrag.katowice.pl/distfile … utbox2.png

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

2 (edited by Lok 2013-04-13 09:52)

Re: [Extension] om_shoutbox 0.0.5

WOW it will be a popular extension. Thank you!

3

Re: [Extension] om_shoutbox 0.0.5

You may add

    <dependencies>
        <dependency>pun_jquery</dependency>
    </dependencies>

To force users to download official jquery extension.

If any of my dropbox link fails with 404 error, change dl.dropbox.com/u/56038890/punbb/*.zip in address to 82283017.

Currently working on rPlus - responsive theme for developers to create their own themes basing on this one.

Re: [Extension] om_shoutbox 0.0.5

@keshii. how to make save shoutbox chat, into file .txt for database ?

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

Re: [Extension] om_shoutbox 0.0.5

The esiest way to save discussions in txt file, is to modify a json.php file. Just add this one line next to inserting new entry to database:

file_put_contents ("/tmp/shoutbox.txt", date("Y-m-d h:i", time())." $username: $message\n", FILE_APPEND);

It should look like this:

// new message
if (isset($_GET['message']) && $forum_user['id'] != 1) {

        $message = forum_htmlencode($_GET['message']);
        $username = forum_htmlencode($forum_user['username']);

        // insert new message with current time
        if( (strlen($message) > 0) && (strlen($message) <= MAX_MESSAGE_LENGTH) )
        {      
                $query = array(
                        'INSERT'        => 'poster, date, message',
                        'INTO'          => 'om_shoutbox',
                        'VALUES'        => '\''.$forum_db->escape($username).'\', '.time().', \''.$forum_db->escape($message).'\''
                );
                $forum_db->query_build($query) or error(__FILE__, __LINE__);
                file_put_contents ("/tmp/shoutbox.txt", date("Y-m-d h:i", time())." $username: $message\n", FILE_APPEND);
        }

        echo json_encode(array('status'=>true));

        // clean up after posting the message
        $time_before = time()-MAX_MESSAGE_OLD;
        $query = array(
                'DELETE'        => 'om_shoutbox',
                'WHERE'         => 'date <= '.$time_before
        );
        $forum_db->query_build($query) or error(__FILE__, __LINE__);
}

Of course you may change the path to txt file, but remember that you need write permission to the file you pointed.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: [Extension] om_shoutbox 0.0.5

how to put chat on top?

Re: [Extension] om_shoutbox 0.0.5

Hello, nice jobs! i like your shoutbox, is great work!!!!

I am looking for use a .txt file and not use a db table, and read this :

keeshii wrote:

The esiest way to save discussions in txt file, is to modify a json.php file. Just add this one line next to inserting new entry to database:

file_put_contents ("/tmp/shoutbox.txt", date("Y-m-d h:i", time())." $username: $message\n", FILE_APPEND);

Unfortunately for me don't work. I do this modify, i set permission at file but it don't work... maby I mistake to place the folder?

I tried to place it in principal root:

 website.tld/tmp/shoutbox.txt 

and tried to place it in the shoutbox extension folder

 website.tld/extensiont/om_shoutbox/tmp/shoutbox.txt 

but never work, Always do not write on file.txt but write on db and also read messages from db.

Can You help me?

thank you

Re: [Extension] om_shoutbox 0.0.5

UP
I have made some changes in this extension. Now users can change their colors in shoutbox.


how to put chat on top?

I have made new version of this extension. Now you can set position of shoutbox in administration panel (top or bottom).


but never work, Always do not write on file.txt but write on db and also read messages from db.

I see no sens in that, what you are trying to achive. Text files are very slow, after several months the file will be enormous big and causing performance problems. Memory tables in database are much more efficient. The changes I have discussed above creates something like log files - to archive the conversation.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: [Extension] om_shoutbox 0.0.5

I ran this for a while and really liked it, but it was making a php session file for each user viewing it every 3 seconds. sad After a few days my server hit its storage limit. tongue So I had to turn it off in the end.

Is there a solution for this problem?

Re: [Extension] om_shoutbox 0.0.5

New session each 3 seconds smile ups... i will try to fix it, just give me 1 or 2 days.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: [Extension] om_shoutbox 0.0.5

Thank you keeshii, you are awesome! I love really your scripts!

I am sorry to ask a lot of things of you and this is the wrong topic, but would it be easy for you to modify your om_medals to use a URL for a medal image instead of an uploader? The uploader doesn't work for me but with if http urls could be used I could just upload the medal graphic onto my server and link it.

Also, do you have a website or twitter or something? I love your work and would love to stay updated on new stuff you make smile

12 (edited by keeshii 2013-10-12 08:13)

Re: [Extension] om_shoutbox 0.0.5

I have been using this extenion on my forum for more than 6 months. Each evening I have about 20 users online and I ecountered no problems so far. I strongly suggest you to investigate your session preferences, because I suspect there is something wrong with them. Session is required to check if user is logged in or not. And the reason why the session is activated with each refresh is simple - I don't want my guests to read the secret shoutbox messages, do I? smile

I have modified the extension. Right now session is not starting when refreshing, but the messages in the shoutbox are now less secure - don't post there anything important.

At first I had no intention to commit these changes to my repository - because it is critical security mistake. In the other hand, the shoutbox will be running much faster without session check... so.... in the end, we have now om_shoutbox 0.0.3.

regards,
keeshii

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

13

Re: [Extension] om_shoutbox 0.0.5

What about (optionally) removing colour chooser for users and being compatible with pun_colored_usergroups ?

Re: [Extension] om_shoutbox 0.0.5

Hmm... interesting. I will consider your proposal and implement this in the future smile

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: [Extension] om_shoutbox 0.0.5

up, sir how to make this visible to guest?
and how to add smilies?

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

Re: [Extension] om_shoutbox 0.0.5

New features:
- decode smilies in messages
- guests can view shoutbox
- added ref="nofollow" to links

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

17

Re: [Extension] om_shoutbox 0.0.5

Hi keeshii & thank you for you wonderful extensions! I came across a pack you created containing a collection of extensions by you and hoped to get some help for some of em' I'm not sure if you're still maintaining these or not but in the off chance  you see this help would be appreciated.


Is there anyway to add some sort of moderation of shoutbox- Simple commands to allow mods/admins to silence, remove, prune, setting topics  & set character limits to prevent spam?

How about colors to fit themes or even allowing users to set their own font color?

Re: [Extension] om_shoutbox 0.0.5

How are clear chat? Sorry my bad english sad

Re: [Extension] om_shoutbox 0.0.5

Wm.Support wrote:

How are clear chat? Sorry my bad english sad

keeshi Helpp !!

Re: [Extension] om_shoutbox 0.0.5

Wm.Support wrote:
Wm.Support wrote:

How are clear chat? Sorry my bad english sad

keeshi Helpp !!

ininstall then install again big_smile

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

Re: [Extension] om_shoutbox 0.0.5

kudataz wrote:
Wm.Support wrote:
Wm.Support wrote:

How are clear chat? Sorry my bad english sad

keeshi Helpp !!

ininstall then install again big_smile

Woow! Thanks big_smile

Re: [Extension] om_shoutbox 0.0.5

ah, you wanted to clear all messages in shoutbox smile

The messages are removed automaticaly after some time. It is 60 min by default, but you can change it in settings. F.e. you may set it for 0 minuts, refresh main page (now the cache will be removed), then change the setting back to 60 minuts.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

23 (edited by antonio 2021-10-19 19:25)

Re: [Extension] om_shoutbox 0.0.5

I have just installed v0.0.5 on my PunBB v1.4.4 and when loggin in it sometimes shows a blank page saying:

{"messages":[]}

In address bar there is:

.../extensions/om_shoutbox/json.php?list=1634668330&login=1

Can you help?

24

Re: [Extension] om_shoutbox 0.0.5

Check the server log for errors.

ForkBB
I speak only Russian  :P