[BETA] AJAX Chat MOD

MODs and Styles for phpBB3.

To post your MOD or style, go to the STG MOD Manager
Forum rules
Go to http://startrekguide.com/mods to submit your MOD or style

[BETA] AJAX Chat MOD

Postby Gonculator » 30 Nov 2008, 01:05

MOD Title: AJAX Chat MOD
MOD Author: Handyman
MOD Description: This MOD adds a community chat area to your forum.
This chat is AJAX based, so new posts will display automatically without a page refresh.
New posts will show up every 5 seconds if you're actively chatting in the chat area. If you're idle (haven't posted in 5 minutes) new posts will show up every 15 seconds and if you've been idle 15 minutes or more, new posts will show up every 60 seconds.

This version of the AJAX chat has been updated by Lostmind with changes for phpBB 3.0.6.
Lostmind also added instructions for subsilver2 and improved the explanation of the database installation to hopefully make it easier to understand.
MOD Version: 2.0.0B9
MOD Status: BETA

Tested on phpBB version: 3.0.6
Released: 10 Dec 2009

Installation Level: easy
Installation Time: ~ 3 Minutes
MOD FAQ: View Frequently Asked Question(s)

Demo: Click here to visit the demo website

This is an automated message posted by STG’s MOD Manager version 0.2.0
You do not have the required permissions to view the files attached to this post.
Last edited by Gonculator on 10 Dec 2009, 13:36, edited 12 times in total.
Reason: MOD Updated
I am Gonculator, the STG Forum Robot -- Please do not PM me, I will not answer, but I will eat users who PM me. :twisted:
User avatar
Gonculator
Forum Robot
Forum Robot
 
Posts: 581
Joined: 16 Nov 2006, 21:52
Location: Forum Robot
Gender: Male


[BETA] AJAX Chat MOD

Postby Handyman » 30 Nov 2008, 01:07

To automatically prune chat messages older than what you can see in teh chatbox (to keep the db clear)

Handyman wrote:open chat.php

Find
Code: Select all
$sql 'SELECT * FROM ' CHAT_TABLE ' ORDER BY message_id DESC';
        
$result $db->sql_query_limit($sql25);
        
$rows $db->sql_fetchrowset($result);

        foreach (
$rows as $row)
        {
            if (
$count++ == 0)
            {
                
$last_id $row['message_id'];
            }
            
$template->assign_block_vars('chatrow', array(
                
'MESSAGE_ID'    => $row['message_id'],
                
'USERNAME_FULL'    => clean_username(get_username_string('full'$row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST'])),
                
'MESSAGE'        => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
                
'TIME'            => $user->format_date($row['time']),
                
'CLASS'            => ($row['message_id'] % 2) ? 2,
            ));
        }
        
$db->sql_freeresult($result);   


Replace with
Code: Select all
$sql 'SELECT * FROM ' CHAT_TABLE ' ORDER BY message_id DESC';
        
$result $db->sql_query_limit($sql25);
        
$rows $db->sql_fetchrowset($result);
        
$db->sql_freeresult($result);

        
$delete_id 0;
        foreach (
$rows as $row)
        {
            if (
$count++ == 0)
            {
                
$last_id $row['message_id'];
            }
            
$template->assign_block_vars('chatrow', array(
                
'MESSAGE_ID'    => $row['message_id'],
                
'USERNAME_FULL'    => get_username_string('full'$row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
                
'MESSAGE'        => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
                
'TIME'            => $user->format_date($row['time']),
                
'CLASS'            => ($row['message_id'] % 2) ? 2,
            ));
            
$delete_id $row['message_id'];
        }
        
        
$sql 'DELETE FROM ' CHAT_TABLE '
            WHERE message_id < ' 
$delete_id;
        
$db->sql_query($sql);   


That will then delete all messages older than the last one displayed in the chat and will also only delete when you first view the chat.


Chat archive page, by nicholasalipaz

note: I have not personally checked this file and I don't know much about it currently.
This is posted as a for the benefit of everybody who's asking for one and since Nicholas was nice enough to make one, here it is :)
Good luck with it :good:
Nicholas should be around if you have any questions about it.

chat_archive.zip
You do not have the required permissions to view the files attached to this post.
Last edited by Handyman on 11 Feb 2009, 22:31, edited 1 time in total.
Reason: added code to prune the chatbox
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
STG Jedi Master
STG Jedi Master
 
Posts: 7224
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: [BETA] AJAX Chat MOD

Postby noumanrafi » 30 Nov 2008, 16:41

i am really tired to get the way of installing AJAX CHAT.

please guys, at least make a topic of AJAX INSTALLATION or guide me how to install AJAX CHAT on phpbb3.0.3

I don't see install directions for subsilver2.
noumanrafi    
Crewman
Crewman
 
Posts: 1
Joined: 30 Nov 2008, 08:53
Gender: Male
phpBB Knowledge: 5

Re: [BETA] AJAX Chat MOD

Postby Sniper_E » 30 Nov 2008, 17:07

The install directions came with the download.
Open the install.xml file with your web browser and follow all of the install directions.

Hey Creeper :D they are the same as for prosilver. There is a directory called prosilver and another directory called subSilver.

The files in the prosilver directory get copied over into your prosilver type style.
The files in the subSilver directory get copied over into your subsilver2 type style the same way.

If it says Open: styles/prosilver/template/overall_header.html then you Open: styles/subsilver2/template/overall_header.html
And Copy: root/styles/prosilver/imageset/* To: styles/prosilver/imageset/*
Means Copy: root/styles/subSilver/imageset/* To: styles/subsilver2/imageset/*
It installs the same way for both types of styles. The header link added could be slightly different for a lot of fancy styles.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!?
Image
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 5896
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [BETA] AJAX Chat MOD

Postby Cr33per » 01 Dec 2008, 13:07

I cant find any of the line in overall_header in subsilver2

Code: Select all
<a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" class="icon-faq">{L_FAQ}</a>


Edit: Okl I see that its not needed for my style. Is there anyway possible I could get the code changes in chat_body that STG uses for BF_Vista.
Cr33per    
Supporter
Supporter
 
Posts: 108
Joined: 05 Oct 2007, 14:12
Location: Illinois
Favorite Team: Bears
Gender: Male
phpBB Knowledge: 4

Re: [BETA] AJAX Chat MOD

Postby aikowolf » 01 Dec 2008, 16:08

is there any other useful information in the installation pack beside installing?

i.e. is there a way to check the history?
can you delete messages you find off base or rude/
etc, etc.

thanks!
aikowolf    
Crewman
Crewman
 
Posts: 2
Joined: 01 Dec 2008, 12:53
Gender: Male
phpBB Knowledge: 3

Re: [BETA] AJAX Chat MOD

Postby Cr33per » 01 Dec 2008, 16:42

Works good except in Firefox I can't see the delete post img for admins.
I can see them in E7 except they look like errors.
Other then that I like it. :thumbsup:
Cr33per    
Supporter
Supporter
 
Posts: 108
Joined: 05 Oct 2007, 14:12
Location: Illinois
Favorite Team: Bears
Gender: Male
phpBB Knowledge: 4

Re: [BETA] AJAX Chat MOD

Postby Paladin » 02 Dec 2008, 03:33

Can someone guide me on how to implement this on the header and/or footer of my main forum site please?
What do I need to add and where? The css and files of the phpBB3 are quite different from the phpBB2 I was using till 2 days ago :borg:

Also, when i type in Greek and press enter nothing happens. It does not support or recognize or do anything when a different lang than English is typed. Is there a codepage I can change somewhere and let it type Greek?

Other than that, it's an EXCELLENT addition! Thank you :)
Paladin
Crewman
Crewman
 
Posts: 1
Joined: 02 Dec 2008, 03:00
Gender: Male
phpBB Knowledge: 8

Re: [BETA] AJAX Chat MOD

Postby MuleMarine » 02 Dec 2008, 08:16

I too am a bit frustrated. When the install says to "Copy: root/chat.php
To: chat.php", does that mean create a new folder and name it "chat.php"? And do I install this inside my phpbb3 folder or outside of it? Thanks.
MuleMarine
Crewman
Crewman
 
Posts: 7
Joined: 02 Dec 2008, 07:54
Gender: Male
phpBB Knowledge: 1

Re: [BETA] AJAX Chat MOD

Postby Cr33per » 02 Dec 2008, 10:24

MuleMarine wrote:I too am a bit frustrated. When the install says to "Copy: root/chat.php
To: chat.php", does that mean create a new folder and name it "chat.php"? And do I install this inside my phpbb3 folder or outside of it? Thanks.

Root means the folder directory of your forums.

How do I get the online list on the left side like here on STG? If I get no answer that's fine I can live with it like this.
http://www.clan33.net/forums/chat.php
Cr33per    
Supporter
Supporter
 
Posts: 108
Joined: 05 Oct 2007, 14:12
Location: Illinois
Favorite Team: Bears
Gender: Male
phpBB Knowledge: 4

Next

Return to phpBB3 Customizations

Who is online

Users browsing this forum: ccBot [Bot], cossielee and 13 guests