Members   Search      Help    Register    Login    Home
Home » Discussion Forums » M0dZ & HaCkZ » ajax_chat(ajax chat intergrated for PMBT)
icon14.gif  ajax_chat [message #2111] Mon, 09 June 2008 06:24 Go to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
MOD-Tittle:Ajax chat
MOD-Version:Beta 1.0.0 beta
MOD-Setup Time:Under 5 minutes
MOD-description:
Ajax Chat for PMBT adds Ajax shoutbox to your site witch well remove the need for constant refreshing of the index(or any other page)for your shoutbox.
You dont need to login for it to work it well automatically set user name and rank.
The only access is for members.
MOD-install:


  1. Extracket content and upload to your root directory
  2. Extracket content and upload to your root directory
  3. open lib/config.php
    Quote:

    // Database hostname:
    $config['dbConnection']['host'] = 'localhost';
    // Database username:
    $config['dbConnection']['user'] = "";
    // Database password:
    $config['dbConnection']['pass'] = "";
    // Database name:
    $config['dbConnection']['name'] = "";


    and save.
  4. Go to yoursite.net/chat/install.php
  5. now remove /chat/install.php
  6. open themes/yourtheme/styles.css
    and add to top
    @import url("http://www.yoursite.net/chat/css/shoutbox.css");
    

    this must be the first line
  7. now open include/functions and add
    <?php
    function getShoutBoxContent() {
        global
    $user, $db, $db_prefix, $localhost_autologin;
            @
    setcookie('PMBTNAME',$user->name,time()+1200,$cookiepath,$cookiedomain,0);
            @
    setcookie('PMBT_USERID',$user->id,time()+1200,$cookiepath,$cookiedomain,0);
            if(
    $user->user)@setcookie('ACTIVE_USER','true',time()+1200,$cookiepath,$cookiedomain,0);
            else
            @
    setcookie('ACTIVE_USER','false',time()+1200,$cookiepath,$cookiedomain,0);
            if(
    $user->admin)@setcookie('PMBT_ADMIN','true',time()+1200,$cookiepath,$cookiedomain,0);
            else
            @
    setcookie('PMBT_ADMIN','false',time()+1200,$cookiepath,$cookiedomain,0);
            if(
    $user->moderator)@setcookie('PMBT_MOD','true',time()+1200,$cookiepath,$cookiedomain,0);
            else
            @
    setcookie('PMBT_MOD','false',time()+1200,$cookiepath,$cookiedomain,0);
        

        
    // URL to the chat directory:
        
    if(!defined('AJAX_CHAT_URL')) {
            
    define('AJAX_CHAT_URL', '/chat/');
        }
        
        
    // Path to the chat directory:
        
    if(!defined('AJAX_CHAT_PATH')) {
            
    define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/chat').'/');
        }
        
        
    // Validate the path to the chat:
        
    if(@is_file(AJAX_CHAT_PATH.'lib/classes.php')) {
            
            
    // Include Class libraries:
            
    require_once(AJAX_CHAT_PATH.'lib/classes.php');
            
            
    // Initialize the shoutbox:
            
    $ajaxChat = new CustomAJAXChatShoutBox();
            
            
    // Parse and return the shoutbox template content:
            
    return $ajaxChat->getShoutBoxContent();
        }
        
        return
    null;
    }
    ?>

  8. Now open header.php and find
    include("blocks/shoutbox.php");
    and remove or comment it out
  9. now we decide where we want new shout if you want it in same place then add
    if ($user->user)
    {
    OpenTable('testajax');
    echo getShoutBoxContent();
    CloseTable();
    }
    
    at same location
    if you want to add it to top of each page then add it right before the ?>
    if you only want it in the index then open index.php and add it bellow
    if ($welcome_message != ""){
    OpenTable(_btsitenews);
    echo "<table><tr><td>$welcome_message</td></tr></table>";
    CloseTable();
    }
    


and thats it your done


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Sat, 14 June 2008 13:45]

Report message to a moderator

Re: ajax_chat [message #2114 is a reply to message #2111] Mon, 09 June 2008 09:53 Go to previous messageGo to next message
Revan is currently offline Revan  Czech Republic
Messages: 125
Registered: April 2007
Super-Seeder
Cool, nice one!!!
Re: ajax_chat [message #2132 is a reply to message #2111] Fri, 04 July 2008 09:41 Go to previous messageGo to next message
RazorSK is currently offline RazorSK  France
Messages: 52
Registered: April 2008
Seeder
thanks a lot for this mod.

i have tested and i got a problem, if there is a discussion to display in the content function and if you refresh the page, the discussion isn't displayed, there is only the line added by the bot. if you send a message, the discussion is displayed than before there is only the bot line "cookie needed..."

do you know where this error come from ?
Re: ajax_chat [message #2134 is a reply to message #2132] Fri, 04 July 2008 10:41 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
yes it is a cookie issue in chat/lib/config.php

http://a.imageshack.us/img831/5562/mybikes.png
Re: ajax_chat [message #2218 is a reply to message #2111] Wed, 05 November 2008 10:01 Go to previous messageGo to next message
RazorSK is currently offline RazorSK  France
Messages: 52
Registered: April 2008
Seeder
ok thanks for your reply
Re: ajax_chat [message #5881 is a reply to message #2111] Tue, 20 December 2011 05:04 Go to previous messageGo to next message
hackajack is currently offline hackajack  South Africa
Messages: 6
Registered: December 2011
Location: South Africa
Leecher
Works perfectly. Many thanks
Re: ajax_chat [message #5882 is a reply to message #2111] Tue, 20 December 2011 08:48 Go to previous messageGo to next message
hackajack is currently offline hackajack  South Africa
Messages: 6
Registered: December 2011
Location: South Africa
Leecher
Hi again

Is there any way to link the Shout Out option to the AJAX chat window? I replaced the Shoutbox with the Ajax Chat but really like the shout out feature when new torrents are added

Thanks
Re: ajax_chat [message #5883 is a reply to message #5882] Tue, 20 December 2011 12:36 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
Ive not mess with this in over 2 years because the default shoutbox for PMBT is java based

http://a.imageshack.us/img831/5562/mybikes.png
Re: ajax_chat [message #5884 is a reply to message #5883] Tue, 20 December 2011 20:18 Go to previous messageGo to next message
hackajack is currently offline hackajack  South Africa
Messages: 6
Registered: December 2011
Location: South Africa
Leecher
joeroberts wrote on Tue, 20 December 2011 12:36
Ive not mess with this in over 2 years because the default shoutbox for PMBT is java based


Not to worry. I have put the shoutbox back for torrent announces. Is there an easy way to resize the shoutbox window because all I need it for are the announces? Thanks so much
Re: ajax_chat [message #5887 is a reply to message #5884] Sat, 24 December 2011 07:09 Go to previous message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
Shout box is resized through the css in each theme.

http://a.imageshack.us/img831/5562/mybikes.png
Previous Topic:IMDB
Next Topic:IMDB Mod Replacement
Goto Forum:
  


Current Time: Wed Feb 08 11:48:49 GMT 2012

Total time taken to generate the page: 0.00789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software