gideon prewett Posted August 28, 2011 Share Posted August 28, 2011 its been a while since ive posted for help but im stuck on this one so figured it was worth a go ok this is the file that i need to change to work with MCC ive tryed quite a few times with no avail so figured i would post here to see if anybody else has better luck session_start(); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ADVANCED */ define('SET_SESSION_NAME',''); // Session name define('DO_NOT_START_SESSION','0'); // Set to 1 if you have already started the session define('DO_NOT_DESTROY_SESSION','0'); // Set to 1 if you do not want to destroy session on logout define('SWITCH_ENABLED','0'); define('INCLUDE_JQUERY','1'); define('FORCE_MAGIC_QUOTES','0'); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* DATABASE */ define('DB_SERVER', 'localhost' ); define('DB_PORT', '3306' ); define('DB_USERNAME', 'username' ); define('DB_PASSWORD', 'password' ); define('DB_NAME', 'DBNAME'' ); define('TABLE_PREFIX', '' ); define('DB_USERTABLE', 'users' ); define('DB_USERTABLE_NAME', 'users' ); define('DB_USERTABLE_USERID', 'userid' ); define('DB_USERTABLE_LASTACTIVITY', 'lastactivity' ); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* FUNCTIONS */ function getUserID() { $userid = 0; if (!empty($_SESSION['userid'])) { $userid = $_SESSION['userid']; } return $userid; } function getFriendsList($userid,$time) { $sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." laston, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." <> '".mysql_real_escape_string($userid)."' and ('".$time."'-".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_laston."<120) order by username asc"); return $sql; } function getUserDetails($userid) { $sql = ("select ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = '".mysql_real_escape_string($userid)."'"); return $sql; } function updateLastActivity($userid) { $sql = ("update `".TABLE_PREFIX.DB_USERTABLE."` set ".DB_USERTABLE_LASTACTIVITY." = '".getTimeStamp()."' where ".DB_USERTABLE_USERID." = '".mysql_real_escape_string($userid)."'"); return $sql; } function getUserStatus($userid) { $sql = ("select cometchat_status.message, cometchat_status.status from cometchat_status where userid = '".mysql_real_escape_string($userid)."'"); return $sql; } function getLink($link) { return 'users.php?id='.$link; } function getAvatar($image) { if (is_file(dirname(dirname(__FILE__)).'/images/'.$image.'.gif')) { return 'images/'.$image.'.gif'; } else { return 'images/noavatar.gif'; } } function getTimeStamp() { return time(); } function processTime($time) { return $time; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* HOOKS */ function hooks_statusupdate($userid,$statusmessage) { } function hooks_forcefriends() { } function hooks_activityupdate($userid,$status) { } function hooks_message($userid,$unsanitizedmessage) { } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.