|
From: Jon O. <jon...@us...> - 2006-06-30 11:17:27
|
Update of /cvsroot/mxbb/mx_simpledoc/simpledoc/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26055/modules/mx_simpledoc/simpledoc/includes Modified Files: functions_simpledoc.php Log Message: Adding Edit Lock and fixing some bugs Index: functions_simpledoc.php =================================================================== RCS file: /cvsroot/mxbb/mx_simpledoc/simpledoc/includes/functions_simpledoc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_simpledoc.php 17 Jun 2006 20:50:47 -0000 1.2 --- functions_simpledoc.php 30 Jun 2006 11:17:24 -0000 1.3 *************** *** 406,409 **** --- 406,447 ---- return $mxurl; } + + function edit_lock() + { + global $db, $mx_simpledoc_cache, $userdata; + + // + // $edit_lock array + // - user_id + // - user_name + // + if ( $mx_simpledoc_cache->exists( 'edit_lock' ) ) + { + $edit_lock = $mx_simpledoc_cache->get( 'edit_lock' ); + die('use_cache' . var_export($edit_lock)); + } + else + { + $edit_lock['user_id'] = $userdata['user_id']; + $edit_lock['user_name'] = $userdata['username']; + $mx_simpledoc_cache->put( 'config', $edit_lock ); + die('recaching...' . var_export($edit_lock)); + } + + echo(var_export($edit_lock)); + + /* + $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip + FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s + WHERE u.user_id = s.session_user_id + AND s.session_time >= ".( time() - 300 ) . " + ORDER BY u.username ASC, s.session_ip ASC"; + + if( !($result = $db->sql_query($sql)) ) + { + mx_message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); + } + */ + } } |