Help
Discuss anything you want here
User avatar
ka3de
Free
 
Posts: 4
Joined: 18 Sep 2012, 03:25

 

by ka3de 20 Sep 2012, 03:35

Hi.
I installed arrowchat on a custom site and I'm having some problems with the "get_user_id" function.

What I've done so far is I created a cookie wich has the "userid" for the user, this cookie is set for the main directory "/" so I guessed the "get_user_id" function would be able to read that cookie, but it doesn't.

Is there something that I'm ignoring? Where is the "get_user_id" function called from?

Thank you.
User avatar
Jason
Customer
 
Posts: 2329
Joined: 12 Dec 2009, 16:06

 

by Jason 20 Sep 2012, 06:30

It sounds like you're doing it right. I would get a cookie extension for your browser so that you can see all the cookies from the site your browsing and make sure it is actually being set properly.
User avatar
ka3de
Free
 
Posts: 4
Joined: 18 Sep 2012, 03:25

 

by ka3de 21 Sep 2012, 04:08

Ok I solved that, but I have another question sorry:

From the includes/integration.php I want to connect to the database to get the url's of the avatars wich are stored in the "users" table, ¿is that possible? I'm not much sure what are the "elements" of my webpage that I can reach from integration.php

Thanks for the help.
User avatar
bodyguard
Customer
 
Posts: 4
Joined: 18 Sep 2012, 04:49

 

by bodyguard 21 Sep 2012, 22:29

What are you make for found get_user_id with cookies for integration.pphp please?? :-s
Thanks
User avatar
bodyguard
Customer
 
Posts: 4
Joined: 18 Sep 2012, 04:49

 

by bodyguard 06 Oct 2012, 01:44

bodyguard wrote:What are you make for found get_user_id with cookies for integration.pphp please?? :-s
Thanks

Up please :-)
User avatar
aproape
Customer
 
Posts: 1
Joined: 29 Jan 2012, 20:12

 

by aproape 23 Oct 2012, 06:10

Hi there,

We added a 2nd function, to avoid using the cookies:

function getUserID2() {
$userid = 0;
echo "<pre>"; print_r ($_SESSION);
echo "</pre>";
if (!empty($_SESSION['userid'])) {
$userid = $_SESSION['userid'];
}

return $userid;
}

Then modified the includes/init.php to use this new function for $userid.

This way, if a browser/user doesn't accept cookies we still get his userid..



Cheers,
Alex
User avatar
Jason
Customer
 
Posts: 2329
Joined: 12 Dec 2009, 16:06

 

by Jason 23 Oct 2012, 12:02

Alex, that's unnecessary, you can put it all in one function by first checking for cookies and then a session.
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 16 Dec 2014, 00:26

[b]This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.[/b]