Advertisement:

Author Topic: CometChat add ID_MEMBER to Session Table  (Read 6796 times)

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
CometChat add ID_MEMBER to Session Table
« on: December 11, 2009, 02:12:28 AM »
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
« Last Edit: December 11, 2009, 06:49:00 PM by nadrojcote »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: add ID_MEMBER to Session Table
« Reply #1 on: December 11, 2009, 05:13:52 AM »
Um, why do you need to do this?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #2 on: December 11, 2009, 10:18:26 AM »
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
      //
« Last Edit: December 11, 2009, 10:22:14 AM by nadrojcote »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: add ID_MEMBER to Session Table
« Reply #3 on: December 11, 2009, 10:23:21 AM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #4 on: December 11, 2009, 10:30:40 AM »
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

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #5 on: December 11, 2009, 10:31:42 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: add ID_MEMBER to Session Table
« Reply #6 on: December 11, 2009, 10:33:23 AM »
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?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #7 on: December 11, 2009, 10:41:57 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: add ID_MEMBER to Session Table
« Reply #8 on: December 11, 2009, 10:49:17 AM »
Well, if I had a log in to his site I'd be able to see. Remember we do have multiple shoutboxes ourselves here...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #9 on: December 11, 2009, 10:58:22 AM »
Um im a nub I guess where can I find these shoutboxes? are you suggesting I ask for help in them?

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: add ID_MEMBER to Session Table
« Reply #10 on: December 11, 2009, 11:02:07 AM »
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
Quote
My allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #11 on: December 11, 2009, 11:12:02 AM »
heres my files

I just realized i had my db info in there so i have removed it
« Last Edit: December 11, 2009, 11:41:27 AM by nadrojcote »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: add ID_MEMBER to Session Table
« Reply #12 on: December 11, 2009, 11:12:50 AM »
Please remove that link if it is a paid-for mod.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #13 on: December 11, 2009, 11:23:31 AM »
its just the config files not the whole mod

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: add ID_MEMBER to Session Table
« Reply #14 on: December 11, 2009, 11:28:34 AM »
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
Quote
My allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #15 on: December 11, 2009, 11:31:24 AM »
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

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #16 on: December 11, 2009, 11:32:18 AM »
if you want to use team viewer I can let you take control of my ftp and cpanel, if needed

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: add ID_MEMBER to Session Table
« Reply #17 on: December 11, 2009, 11:35:29 AM »
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
Quote
My allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #18 on: December 11, 2009, 11:48:37 AM »
Thanks a lot again for the help I appreciate it very much :)

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #19 on: December 11, 2009, 12:57:02 PM »
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

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: add ID_MEMBER to Session Table
« Reply #20 on: December 11, 2009, 02:20:09 PM »
also could have something to do with the fact that I am on hostmonster and could be setting issues in php.ini I have been told ????

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #21 on: December 11, 2009, 06:49:28 PM »
If there is anyone willing to help please let me know, thanks

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #22 on: December 12, 2009, 03:11:35 AM »
First up, please don't bump within 24 hours. We're all volunteers here, and as you may have noticed, I'm the only person consistently in this board.

I really wouldn't encourage running CometChat on HostMonster if you're going to have more than a few people online at once.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: CometChat add ID_MEMBER to Session Table
« Reply #23 on: December 12, 2009, 10:26:44 AM »
If there is anyone willing to help please let me know, thanks

sry i had loads of call outs last night so i couldent do no coding

i doubt ill be able to hlp this week end cos im on call again and this is the first rest ive had since yesterday

if i was you id be inclined to listen to arantor not just cos im lazy :P but cos he has more experiance with php but if ypu still want it i can help you next week when im off work
http://samods.github.io/SAChatBar/

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

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #24 on: December 12, 2009, 02:56:29 PM »
Hey thanks for the reponse, yeah hostmonster isnt great and my year is almost up with them, do you suggest another host that would be better and allow me more memory and cpu usage? also I usually only have about maximum 10 registered members on at a time. I am sorry for bugging you guys and I understand that you are volunteers.

Is there anything that hostmonster could have setup that would not allow cometchat to work? the error logs are not showing any errors at all so I have no way to even start debugging.

First up, please don't bump within 24 hours. We're all volunteers here, and as you may have noticed, I'm the only person consistently in this board.

I really wouldn't encourage running CometChat on HostMonster if you're going to have more than a few people online at once.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #25 on: December 12, 2009, 02:59:43 PM »
No, it's not so much their configuration, more a simple matter of computing realities.

HostMonster are what is known as a overseller. That means they cram a lot of sites on to a single physical server. That means there is a limit on what resources you can take up.

Now, last I looked at CometChat, their code works on the basis of maintaining a connection to the user for the life of the chat - much the same way Facebook does.

That's one connection per user continuously. Takes a lot of resources. Facebook had to build a special server architecture to handle their load. You have the same problem on a smaller scale; the resources just don't really work so well for it.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #26 on: December 12, 2009, 03:55:22 PM »
Yeah I was aware that they oversell, they put around 1000 sites on a box lol. Anyways would you suggest this arvixe hosting?

My main concern right now tho is to get cometchat working, and then if I have resource issues I will move the site to a different host. I have looked through all the code for cometchat, and made all the database changes so that it should be able to read my sessions but it just isnt working. I have tried using sleepys exact code and that didnt work, so I checked it over and found that a few of the sql queries were looking for columns thats didnt exist in my db so I changed them and it still doesnt work.

Now this sounds like I am trying to take the easy way out, But I am willing to donate/paypal money transfer as a gift $40 to who ever can get it working for me, The only reason is because I do not know enough about coding to be able to do this on my own. It is for my gaming community site and they would love to have it working. I have been looking through ever line of code cometchat has hoping that I can find something that seems un ordinary but everything seems to be good.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #27 on: December 12, 2009, 03:59:46 PM »
If there is anyone willing to help please let me know, thanks

sry i had loads of call outs last night so i couldent do no coding

i doubt ill be able to hlp this week end cos im on call again and this is the first rest ive had since yesterday

if i was you id be inclined to listen to arantor not just cos im lazy :P but cos he has more experiance with php but if ypu still want it i can help you next week when im off work

its all good man, i dont like to bug you guys, im just in a desperate state. If I am still in need of some help next week i will send you a pm, sorry to bug you so much. Thanks again for the help you have given me so far as well as the code and the arcade games you have supplied me :D

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #28 on: December 12, 2009, 04:24:51 PM »
What was wrong with the live chat/shoutbox mods that are built for SMF, out of interest?

* Arantor would still point out that once you get past a few people chatting, the host will get upset. No chat is particularly light on the server.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #29 on: December 12, 2009, 04:30:26 PM »
um well we would like to be able to chat with each other no matter what page we are on in the forum, Currently we have lots of side blocks so the shoudbox is on a top block on the main forum page only. Also host monster has my account throttled already so instead of getting upset they just throttle my cpu usage. I was running hlstats and at first they shut me down for cpu usage and I had to call in, then they just started throttling and havent shut me down since.

forgot to mention currently I am running a flashchat room on the site and it has been working fine, but I would like to replace it with cometchat.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #30 on: December 12, 2009, 04:42:18 PM »
That's only the portal one.

nneonneo's shoutbox works on every page, as does AjaxChat and several of the others, meaning it'll just install and work directly with your database.

EVERY shoutbox hits the CPU on your server, especially Comet style ones. There is no avoidance.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #31 on: December 12, 2009, 04:51:26 PM »
Ya I have looked into those, but am looking for something that allows personal messages, from one user to the other without anyone else seeing, I am very intrigued by cometchat and so are my users. Flash chat allows to start private messages, but this is limited to one window and not while browsing the whole website. When i tried running the javascript version of flashchat hostmonster told me they dont support javascript, could this be why cometchat isnt working?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #32 on: December 12, 2009, 04:52:51 PM »
No, mostly it's not working because it requires code changes to be integrated with SMF, not because the host don't support it. Javascript runs on the client browser not on the server.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #33 on: December 12, 2009, 04:56:37 PM »
ok, well I would really like to get this working, but idk if you really want to help me with code it seems you are busy guy helping people on here.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: CometChat add ID_MEMBER to Session Table
« Reply #34 on: December 12, 2009, 05:01:54 PM »
I don't know CometChat, especially since I thought it was paid-for, and I don't have time to grab a copy (even legitimately) and dismantle it to figure out how to make it work on SMF, especially since it's a mod I'll never even dream of using on my own forum.

I'm not sure to be honest how much help I'd be without spending hours dismantling it.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #35 on: December 12, 2009, 05:16:26 PM »
i do have the zip i could give to you, but thats alright I feel like I have bothered you enough already. Ill wait till next week and see if sleepy can help me out, thanks for your time.

Offline nadrojcote

  • Semi-Newbie
  • *
  • Posts: 76
Re: CometChat add ID_MEMBER to Session Table
« Reply #36 on: December 12, 2009, 09:04:24 PM »
I have it working now, thanks again guys, i had my cookie set with a different name than he configed it for that was the prob.

Offline SA™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,954
  • (T)ogether (E)veryone (A)chieves (M)ore
    • DenotsNiaga on Facebook
    • SAChatBar
Re: CometChat add ID_MEMBER to Session Table
« Reply #37 on: December 13, 2009, 11:56:07 PM »
ah yes i should of said that you needed todo set the cookie lol too many things going down
http://samods.github.io/SAChatBar/

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