Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2013-03-08 04:48:46

mario2000
Member
From: Spain
Registered: 2012-05-04
Posts: 190
Website

Install CometCHAT

Hi

I want to install cometchat in my website, but I dont know how to do this, becouse I don know all the techical detaills about how ASPro send the user_id, if use cookies, the db_avatar .....

I belive, this can help some users with many registered users.
script - http://www.cometchat.com/
Install instruccions on an custom PHP website - http://www.cometchat.com/documentation/ … e/php-site

Asuming this:
my website username       webx
my db_username              webx_abc
my db_name                    webx_xyz
-------------------------------------
First - I need help to complete this part of code:

/* DATABASE */

define('DB_SERVER','localhost');
define('DB_PORT','3306');
define('DB_USERNAME','root');
define('DB_PASSWORD','password');
define('DB_NAME','databasename');
define('TABLE_PREFIX','');
define('DB_USERTABLE','users');
define('DB_USERTABLE_NAME','username');
define('DB_USERTABLE_USERID','userid');
define('DB_USERTABLE_LASTACTIVITY','lastactivity');
define('DB_AVATARTABLE'," ");
define('DB_AVATARFIELD'," ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." ");

--------------------------------------------------------------------

After that i need to get the user_id, but i dont know wath i need to use, down is an copy from the instructions:

- The getUserID() function is used to return the logged in user’s ID. Depending on how you have programmed your site, you will have to find out the user’s ID.
- If you have written a simple PHP authentication, then during the authentication, you can specify a session variable like:

/* In your own login.php */
/* After you authenticate the user */
$_SESSION['userid'] = $users['id']; // Modify to suit requirements
Then your getUserID() function will look like:

function getUserID() {
    $userid = 0; // Return 0 if user is not logged in

    if (!empty($_SESSION['userid'])) {
        $userid = $_SESSION['userid'];
    }

    return $userid;
}



- If you are using a cookie then read that using the following function:

function getUserID() {
    $userid = 0; // Return 0 if user is not logged in

    if (!empty($_COOKIE['userid'])) {
        $userid = $_COOKIE['userid'];
    }

    return $userid;
}


- If you are using a more complex method of authentication like storing the session_hash in the database, then your getUserID() function will look something like:

function getUserID() {
    $userid = 0; // Return 0 if user is not logged in

        if (!empty($_COOKIE['sessionhash'])) {
        $sql = ("select userid from ".TABLE_PREFIX."session 
            where sessionhash = '".mysql_real_escape_string($_COOKIE['sessionhash'])."'");
        $query = mysql_query($sql);
        $session = mysql_fetch_array($query);
        $userid = $session['userid'];
        }

    return $userid;
}

Thanks


Brutal Porn Videos - Brutal5.org
Peliculas Online - PepeCine
Filme Online Romana - Filme5

Offline

#2 2013-03-08 11:51:53

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Install CometCHAT

ASPro saves $_SESSION['user_id'], $_SESSION['username'], $_SESSION['email'], $_SESSION['group_id']....


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB