News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

CometChat add ID_MEMBER to Session Table

Started by nadrojcote, December 11, 2009, 02:12:28 AM

Previous topic - Next topic

nadrojcote

hi I am using smf 1.1.11 and am trying to install cometchat.  I am wondering if there is a way i can modify my forum to save the ID_MEMBER that is assoiciated with their session in its own field. I can create the field in the table. but i do not know enough about coding to know what to change to have the field auto populated.


currently sessions db is set up like this

        session_id     char(32)     
   last_update    int(10)
   data            text    

I would like it to be like this

        session_id     char(32)     
   last_update    int(10)
   data            text    
        ID_MEMBER     mediumint(8)     


Any help would be greatly appreciated, unless someone has installed comet chat, if so then you will probably be able to tell me if I am going in the right direction.  Thanks

Arantor


nadrojcote

#2
Hey, I am currently trying to install cometchat onto my smf forum, But it is requiring me to have certain databases setup, this is what they are wanting,

// Session table
// ---------------------------------
// userid   sessionhash
// ---------------------------------
// 1      afgbdsfbsdfklbnlern34



   // Please update this line as per your database. We assume that a table "user" contains a field "lastactivity" which records the unix timestamp of the user
   // This is used later to find out if the user is online or offline

   $sql = ("update ".TABLE_PREFIX."members set lastLogin = UNIX_TIMESTAMP(NOW()) where userid = ".mysql_real_escape_string($userid));
   $query = mysql_query($sql);

// Please update the logic below to interact with your buddy list and return the friends of the logged in user along with status information (which is handled by CometChat)
      // We assume here that you have a table called "user" with fields "userid", "username", "lastactivity"
      // And a table called "userlist" with field "userid", "relationid", "friend"
      // For example
      //
      // User table
      // -------------------------------------
      // userid   username   lastactivity
      // -------------------------------------
      // 1      abc         1244912985
      // 2      def         1244912983
      //
      // Userlist table
      // -------------------------------------
      // userid   relationid   friend
      // -------------------------------------
      // 1      2         yes
      // 2      1         yes
      //

Arantor

The session table isn't designed like that, and even if it were, it uses a different session structure and id to what they're expecting.

It's also not a great idea to add to the table as it is fairly volatile, more so than CometChat (if it goes true to name and uses a connection style like Comet technology does, and retains a long-life connection).

You can get last activity from whether there is a row in {db_prefix}log_online or not, but buddies might be altogether a whole other problem, since buddies aren't stored in a table per se, but in a comma list in the members table.

* Arantor moves this to Coding Discussion where it really belongs.

nadrojcote

Ok I have the last login part working just the session id and user id are not in a table together, so I was assuming thats why it doesnt recognize that people are logged in. This is going to be a long process. I am willing to pay for help if anyone is interested.

Thanks

nadrojcote

I know this is possible to do cause sleepys arcade has it setup, thats where I got the idea

http://sleepy-arcade.ath.cx/sleepy/index.php

Arantor

Oh, I didn't say it wasn't, just that the modifications are really not a good idea for performance. Plus you can have multiple sessions per user.

You could always ask him how he did it?

Is he definitely using CometChat? I don't have an account there, so it might be something different instead?

nadrojcote

Ya im pretty sure he is using a nulled version of it. I have asked him but he hasnt replied to me, Im sure it wouldnt be too hard for someone with the knowledge to figure out, Im just not very good with this stuff. I know basic sql queries but not a lot of php or js.

I have it up and working, its just that its not detecting a logged in user

my site is here

http://tdrgg.net and you can see what I have so far if anyone is willing to help, and make some extra cash

Arantor

Well, if I had a log in to his site I'd be able to see. Remember we do have multiple shoutboxes ourselves here...

nadrojcote

Um im a nub I guess where can I find these shoutboxes? are you suggesting I ask for help in them?

SA™

ive modded mine and changed loads of it to work with smf it alot of work rely and i dont rember what i changed sending ya a pm :)
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

nadrojcote

#11
heres my files

I just realized i had my db info in there so i have removed it

Arantor

Please remove that link if it is a paid-for mod.

nadrojcote

its just the config files not the whole mod

SA™

are you using smf1 or smf2 ?

are u using ultimate profile mod mine is set up to use that ?
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

nadrojcote

I am using smf 1.1.11 and yes I am using ultimate profile, I was assuming I would need to use that for the buddy system? I was hoping to be able to make all people buddies so that they didnt have to add each other. But I will figure that out after I have it set up and working

nadrojcote

if you want to use team viewer I can let you take control of my ftp and cpanel, if needed

SA™

yes and no  it just made it easyer for me to use that

ok ill work on this later for you on ps3 at moment sisters hogging the pc lol


no i shouldent need ftp plus im wary of taking peoples ftp details
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

nadrojcote

Thanks a lot again for the help I appreciate it very much :)

nadrojcote

I have got it all setup like yours now, but

it seems as though it could have something to do with members.lastupdate because in my table i have members.lastlogin

Advertisement: