How to add ajax chat to subsoinc?

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

How to add ajax chat to subsoinc?

Postby falsadoo » Wed Dec 14, 2011 1:11 pm

I saw someone have added a chat room to subsonic and i am wondering how to do it... I am not good at programing so someone can tell me step by step how to do it... I really need to add that chat room because the chat that is in subsonic is very small and can not keep the massages
falsadoo
 
Posts: 4
Joined: Tue Dec 13, 2011 12:56 am

Re: How to add ajax chat to subsoinc?

Postby BKKKPewsey » Wed Dec 14, 2011 4:35 pm

falsadoo wrote:The chat that is in subsonic is very small and can not keep the massages

What sort of chat room are you hosting :shock:

:lol:
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: How to add ajax chat to subsoinc?

Postby falsadoo » Wed Dec 14, 2011 7:12 pm

I do not have a chat room step up i just so someone have the theme darkness that have the chat option up there and i don't want the theme i just want the chat room but i have no idea how he did it and how to do it
falsadoo
 
Posts: 4
Joined: Tue Dec 13, 2011 12:56 am

Re: How to add ajax chat to subsoinc?

Postby falsadoo » Thu Dec 15, 2011 4:03 am

I figured out but now i run into another problem i want to delete the log in page from Ajax chat let it when the user log in to subsonic is automatically logged to the chat can someone help me with that?
falsadoo
 
Posts: 4
Joined: Tue Dec 13, 2011 12:56 am

Re: How to add ajax chat to subsoinc?

Postby Hellscream » Sun Feb 12, 2012 12:29 pm

I have idea but still need help from someone who can tell me how to read data from SQl table.
Example table:
( userID | username | email | password ) this is table from subregengine

and this is part of php file ( ajax chat users )

Code: Select all
<?php
/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/
*/

// List containing the registered chat users:
$users = array();

// Default guest user (don't delete this one):
$users[0] = array();
$users[0]['userRole'] = AJAX_CHAT_USER;
$users[0]['userName'] = null;
$users[0]['password'] = null;
$users[0]['channels'] = array(0);


I appreciate any help
Image
User avatar
Hellscream
 
Posts: 160
Joined: Fri Apr 22, 2011 11:47 am
Location: Serbia

Re: How to add ajax chat to subsoinc?

Postby SparkyRih » Sun Feb 12, 2012 11:07 pm

Is this to add into subsonic (so that it is part of the layout)... Or should this become a service next to it?
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: How to add ajax chat to subsoinc?

Postby Hellscream » Sun Feb 12, 2012 11:18 pm

This is a standalone service not related to SS in any way i just want to use your tables from subregengine so registered user can access chat inside SS.
I need code that will point to your tables with registered users.
$users[0]['userName'] = null;
$users[0]['password'] = null;
"null" values mean that user can enter anything and access chat without registering i dont like that.
Solution with reg page for chat is pfff terible double registration is anoying.
Question is. Is it possible to wrote code that will point to DB subsonicusers/table users/ colons username password.
For example u can access chat http://hellscream.dyndns.org/subchat without registering acc :(
THX for reply

This is code for register page for ajax chat

Code: Select all
<?php
include('PATHtoYOUR/chat/lib/data/users.php');
//check existing users   
   
   if ($_POST['username'])
   {
   //if user entered a name
   }
   //collect information from users.php
   $user_amount = count($users);
   for ($i=0; $i <=$user_amount;$i++);
   {
   //check usage of name
   if (strtolower($_POST['username']) == strtolower($users[$i]['userName']))
   $username_used = 1;
   }

//make sure user chose a password
if (!$_POST['password'])
$password_error = 1;

//ensure username avalible and password chosen
if (!$username_used and !$password_error)
{
//present user id accepted message
print 'Your selection '.$_POST['username'].' was accepted... your account was created. You may now login!!!';
$next_user = $user_amount++;
$new_user_information = '

//remote created from '.$_SERVER['REMOTE_ADDR'].'
$users['.$next_user.'] = array();
$users['.$next_user.'][\'userRole\'] = AJAX_CHAT_USER;
$users['.$next_user.'][\'userName\'] = \''.$_POST['username'].'\';
$users['.$next_user.'][\'password\'] = \''.$_POST['password'].'\';
$users['.$next_user.'][\'channels\'] = array(0,1);

?>';
$file_edit = fopen('PATHtoYOUR/chat/lib/data/users.php', 'r+');
fseek($file_edit, -3,SEEK_END);
fwrite($file_edit, $new_user_information);
fclose($file_edit);
}
//end of php

?>
<table border="0" align="center">
   <table border="0" align="center">
   <tr>
      <td>Use the form below to create a Chat user account.</td>
   </tr>
   <tr>
   <td>
   <!-- collect username and password information via form -->
   <form action="" method="post">
   Username:<input name="username" type="text" value="" /> 16 Character Maximum<br>
   Password:<input name="password" type="text" value="" /> No requirements.<br>
   <input name="submit" type="submit" value="Create" />
   </form>
   </td>
   </tr>
   </table>
</table>


I have errors related to writing something in php file
allow_url_fopen = On
allow_url_include = On
BUMP still dont like idea with double registration in SS
Image
User avatar
Hellscream
 
Posts: 160
Joined: Fri Apr 22, 2011 11:47 am
Location: Serbia

Re: How to add ajax chat to subsoinc?

Postby SparkyRih » Mon Feb 13, 2012 8:38 am

Ok I get it, so I can just donwload the Open Source AJAX Chat package...
I will see if I can make it use my DB...
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: How to add ajax chat to subsoinc?

Postby Hellscream » Mon Feb 13, 2012 2:13 pm

TY for your time and help i appreciate that.
Image
User avatar
Hellscream
 
Posts: 160
Joined: Fri Apr 22, 2011 11:47 am
Location: Serbia

Re: How to add ajax chat to subsoinc?

Postby SparkyRih » Mon Feb 13, 2012 3:26 pm

So it just uses a plain PHP file to auth users...
And I can't just trick the file, because I use encrypted passwords instead of plain text passwords in the DB...

But I will see if I can find something to plug a DB into it.......

Edit: I figured it out :)
It's a matter of time now :P
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: How to add ajax chat to subsoinc?

Postby Hellscream » Mon Feb 13, 2012 6:16 pm

SparkyRih wrote:So it just uses a plain PHP file to auth users...
And I can't just trick the file, because I use encrypted passwords instead of plain text passwords in the DB...

But I will see if I can find something to plug a DB into it.......

Edit: I figured it out :)
It's a matter of time now :P

:D like i said GENIUS
I cant w8 to test it
Image
User avatar
Hellscream
 
Posts: 160
Joined: Fri Apr 22, 2011 11:47 am
Location: Serbia

Re: How to add ajax chat to subsoinc?

Postby muiz » Tue Feb 14, 2012 12:15 am

Very nice..... cant wait
muiz
 
Posts: 86
Joined: Wed Feb 02, 2011 11:52 am

Re: How to add ajax chat to subsoinc?

Postby SparkyRih » Tue Feb 14, 2012 8:44 am

LOL, the way I wanted to do it is not possible... they dont allow code injection (which is a good thing imo)... so I have to find another way... but I will find it...
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: How to add ajax chat to subsoinc?

Postby Hellscream » Tue Feb 14, 2012 2:40 pm

I have trust in you and I send you huge amount of positive energy so you can complete task :P.
Image
User avatar
Hellscream
 
Posts: 160
Joined: Fri Apr 22, 2011 11:47 am
Location: Serbia

Re: How to add ajax chat to subsoinc?

Postby SparkyRih » Tue Feb 14, 2012 6:09 pm

Ok, I'm able to use the usernames in my DB to access the chat, but I can't use the password (yet).
Since my passwords are encrypted, and ajax chat's passwords are plai ntext, I can't match them... I need to find the place in the code where the values of the login form are posted for the first time, so that I can encrypt the password, so it will match with my DB....

Edit: Nevermind, got the passwords working to! :D
Let mee cleanup the code a little, and I'll post my editted files wit hsome little instruction...
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Next

Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 14 guests