Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > vB Chat

Reply
 
Thread Tools
Chat Log Details »»
Chat Log
Version: , by pets.ca pets.ca is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-07-2005 Last Update: Never Installs: 0
 
No support by the author.

Hi there,

I require the ability to keep a log of all chat activity on my board. I plan to have a single chat room only. Is there a way to dump all activity (time/date stamped) to a text file?

thanks

dave

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-07-2005, 11:52 PM
wacnstac wacnstac is offline
 
Join Date: Nov 2001
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be useful to me as well.
Reply With Quote
  #3  
Old 03-08-2005, 05:38 PM
Zero Tolerance's Avatar
Zero Tolerance Zero Tolerance is offline
 
Join Date: Feb 2004
Location: England
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It may be created for a future version, thats not a promise.

- Zero Tolerance
Reply With Quote
  #4  
Old 03-09-2005, 09:10 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zero Tolerance
It may be created for a future version, thats not a promise.

- Zero Tolerance
If I may, add this code at the end of your admin_vbchat.php file, before the ?> :

PHP Code:
// ###################### Do View Messages ########################
if ($_GET['do'] == "viewmessages" 
{
    
$file="vbchat_store";
    
globalize($_REQUEST, array(
        
'sid' => INT,
        
'perpage' => INT,
        
'page' => INT,
        
'orderby' => STR,
    ));
    
print_cp_header("vBChat System");
    
    
$perpage=20;
    
    if (
$page 1)
    {
        
$page 1;
    }
    
$startat = ($page 1) * $perpage;
    
    
$counter=$DB_site->query_first("SELECT COUNT(*) AS messages FROM " TABLE_PREFIX "{$file} AS message");
    
    if (
$counter['messages']==or $counter['messages']=='')
    {
        
$url='admin_vbchat.php';
        
$wait=5;
        
print_cp_message("No Chat Messages to Show."$url$wait);
    }
    
    
$totalpages ceil($counter['messages'] / $perpage);
        
    
$Get_Chat_MSG $DB_site->query("select m.*,u.*,t.username AS tusername, t.userid AS tuserid from ".TABLE_PREFIX."{$file} m
        left join "
.TABLE_PREFIX."user u on (u.userid = m.s_postby) 
        left join "
.TABLE_PREFIX."user t on (t.userid = m.s_foruser)
        order by m.s_postime LIMIT 
$startat$perpage");
    
    if (
$DB_site->num_rows($Get_Chat_MSG))
    {
            
        if (
$page != 1)
        {
            
$prv $page 1;
            
$firstpage "<input type=\"button\" class=\"button\" value=\"&laquo; " $vbphrase['first_page'] . "\" tabindex=\"1\" onclick=\"window.location='admin_vbchat.php?$session[sessionurl]do=viewmessages&perpage=$perpage&orderby=$orderby&file=$file&page=1'\">";
            
$prevpage "<input type=\"button\" class=\"button\" value=\"&lt; " $vbphrase['prev_page'] . "\" tabindex=\"1\" onclick=\"window.location='admin_vbchat.php?$session[sessionurl]do=viewmessages&perpage=$perpage&orderby=$orderby&file=$file&page=$prv'\">";
        }
    
        if (
$page != $totalpages)
        {
            
$nxt $page 1;
            
$nextpage "<input type=\"button\" class=\"button\" value=\"" $vbphrase['next_page'] . " &gt;\" tabindex=\"1\" onclick=\"window.location='admin_vbchat.php?$session[sessionurl]do=viewmessages&perpage=$perpage&orderby=$orderby&file=$file&page=$nxt'\">";
            
$lastpage "<input type=\"button\" class=\"button\" value=\"" $vbphrase['last_page'] . " &raquo;\" tabindex=\"1\" onclick=\"window.location='admin_vbchat.php?$session[sessionurl]do=viewmessages&perpage=$perpage&orderby=$orderby&file=$file&page=$totalpages'\">";
        }
    
        
$aa=($page-1)*$perpage+1;
        if (
$page<$totalpages)
        {
            
$bb=$page*$perpage;
        }
        else
        {
            
$bb=$counter['messages'];
        }
        
$cc=$counter['messages'];    

        
print_form_header('''');
        
        
print_table_header("View vBChat Messages<br>Page $page of $totalpages<br>Messages $aa to $bb of $cc",14);
                
        
$header = array();
        
        
$header[] = "<b>ID</b>";
        
$header[] = "<b>Poster Name</b>";
        
$header[] = "<b>Message</b>";
        
$header[] = "<b>Date/Time</b>";
        
$header[] = "<b>To User</b>";
            
        
print_cells_row($header1);
        
        while(
$message=$DB_site->fetch_array($Get_Chat_MSG))
        {
        
            
$cell = array();
            
//             $message[date] = vbdate ( $vboptions['dateformat'], $message[s_postime] ) ;
             
$message[time] = vbdate $vboptions['timeformat'], $message[s_postime] ) ;
            
$message[date]=date("d-m-Y");

            if(
$message['s_foruser']=="0")
            {
                
$touser='All';
            }
            else
            {
                
$touser=$message[tusername];
            }
            
            
$cell[] = "<font size='-1'>$message[sid]</font>";
            
$cell[] = "<font size='-1'>$message[username]<br>$message[userid]</font>";
            
$cell[] = "<font size='-1'>$message[s_message]</font>";
            
$cell[] = "<font size='-1'>$message[date]<br>$message[time]</font>";
            
$cell[] = "<font size='-1'>$touser<br>$message[tuserid]</font>";
            
            
print_cells_row($cell);
            
        }
        
print_table_footer(5"$firstpage $prevpage &nbsp; $nextpage $lastpage");
    }

Then edit your admincp/index.php file and find:

PHP Code:
construct_nav_option 'Chat Prune Options''admin_vbchat.php?do=prune''<br />' ) ; 
Right below that, add:

PHP Code:
construct_nav_option 'Chat Log''admin_vbchat.php?do=viewmessages''<br />' ) ; 
Let me know if that works.

Of course, you should not have the prune chat option active, or else the messages will be deleted.
Reply With Quote
  #5  
Old 03-20-2005, 07:09 AM
AzHousePro AzHousePro is offline
 
Join Date: Mar 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like it works to me. Nice job.

How hard would it be to code something that dumped the entire log to a text file on the server?

Mike
Reply With Quote
  #6  
Old 03-20-2005, 10:23 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why dump it to a .txt file, if it's already in the DB?
Reply With Quote
  #7  
Old 03-20-2005, 04:25 PM
AzHousePro AzHousePro is offline
 
Join Date: Mar 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just thought it would be nice to dump the log to a text file every once in a while and purge the database.

Mike
Reply With Quote
  #8  
Old 03-24-2005, 02:39 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That, Sir, I have no idea how to do it.
Reply With Quote
  #9  
Old 04-17-2005, 01:57 AM
Diana Notacat's Avatar
Diana Notacat Diana Notacat is offline
 
Join Date: Dec 2003
Location: Arkansas
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was brilliantly useful!

Is it possible to make some modifications to this to allowing viewing logs for the created rooms as well? Perhaps a menu to "view Logs for X room"?
Reply With Quote
  #10  
Old 04-17-2005, 05:57 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would you want it to be an actual file on your server, which is updated at regular bases, or do you just want to be able to download the .txt file?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10773 seconds
  • Memory Usage 2,338KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete