From: Don S. <ri...@us...> - 2004-09-13 19:47:46
|
Update of /cvsroot/phpwsbb/phpwsbb/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/class Modified Files: Manager.php Log Message: anal single-quote stuff Index: Manager.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/class/Manager.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Manager.php 13 Sep 2004 18:17:20 -0000 1.40 --- Manager.php 13 Sep 2004 19:47:36 -0000 1.41 *************** *** 1293,1297 **** function _load_user_ranks () { ! $results = $GLOBALS["core"]->sqlSelect('mod_phpwsbb_user_ranks',NULL,NULL,'rank_min'); if($results) $this->_user_ranks = $results; --- 1293,1297 ---- function _load_user_ranks () { ! $results = $GLOBALS["core"]->sqlSelect("mod_phpwsbb_user_ranks", NULL, NULL, "rank_min"); if($results) $this->_user_ranks = $results; *************** *** 1316,1344 **** // If user data was passed in, use it $result = $id; ! } elseif (!$result = $GLOBALS["core"]->getRow('SELECT * FROM ' ! . $GLOBALS["core"]->tbl_prefix . 'mod_phpwsbb_user_info AS i LEFT JOIN ' . $GLOBALS["core"]->tbl_prefix ! . 'mod_users AS u ON ( u.user_id = i.user_id ) WHERE i.user_id ='.$id)) { ! // Using 1 sql statement instead of loading user classes which would use more memory ! // and generate an additional query per user. // If no record was found, create one $result = array(); // Develop correct user post counts ! $posts = $GLOBALS["core"]->getRow('SELECT COUNT(owner_id) FROM mod_phpwsbb_messages WHERE owner_id='.$id, 1); ! $result['posts'] = $posts['COUNT(owner_id)']; // If the user has uservars set for this module... ! $monitordefault = $_SESSION['OBJ_user']->getUserVar('monitordefault', NULL, 'phpwsbb'); if ($monitordefault!==NULL) { // transfer the values to the table ! $result['monitordefault'] = $monitordefault; ! $result['suspendmonitors'] = $_SESSION['OBJ_user']->getUserVar('suspendmonitors', NULL, 'phpwsbb'); } ! $GLOBALS["core"]->sqlInsert($result,'mod_phpwsbb_user_info'); ! $result['location']=$result['avatar']=$result['signature']=$result['monitordefault']=$result['suspendmonitors']=null; } // If user's post count is set to 0, recalculate it. ! if($result['posts']==0) { // Develop correct user post counts ! $result['posts'] = $data['posts'] = $GLOBALS["core"]->getOne('SELECT COUNT(owner_id) FROM mod_phpwsbb_messages WHERE owner_id='.$id, 1); $GLOBALS["core"]->sqlUpdate($data, 'mod_phpwsbb_user_info', 'user_id', $id); } --- 1316,1348 ---- // If user data was passed in, use it $result = $id; ! } elseif (!$result = $GLOBALS["core"]->getRow("SELECT * FROM " . $GLOBALS["core"]->tbl_prefix . "mod_phpwsbb_user_info AS i LEFT JOIN " . $GLOBALS["core"]->tbl_prefix . "mod_users AS u ON ( u.user_id = i.user_id ) WHERE i.user_id = $id")) { ! /* ! * Using 1 sql statement instead of loading user classes which ! * would use more memoryand generate an additional query per user. ! */ ! // If no record was found, create one $result = array(); + // Develop correct user post counts ! $posts = $GLOBALS["core"]->getRow("SELECT COUNT(owner_id) FROM mod_phpwsbb_messages WHERE owner_id=$id", 1); ! $result['posts'] = $posts["COUNT(owner_id)"]; ! // If the user has uservars set for this module... ! $monitordefault = $_SESSION["OBJ_user"]->getUserVar("monitordefault", NULL, "phpwsbb"); if ($monitordefault!==NULL) { // transfer the values to the table ! $result["monitordefault"] = $monitordefault; ! $result["suspendmonitors"] = $_SESSION['OBJ_user']->getUserVar("suspendmonitors", NULL, "phpwsbb"); } ! ! $GLOBALS["core"]->sqlInsert($result, "mod_phpwsbb_user_info"); ! $result["location"] = $result["avatar"] = $result["signature"] = $result["monitordefault"] = $result["suspendmonitors"] = null; } // If user's post count is set to 0, recalculate it. ! if($result["posts"]==0) { // Develop correct user post counts ! $result["posts"] = $data["posts"] = $GLOBALS["core"]->getOne("SELECT COUNT(owner_id) FROM mod_phpwsbb_messages WHERE owner_id=$id", 1); $GLOBALS["core"]->sqlUpdate($data, 'mod_phpwsbb_user_info', 'user_id', $id); } *************** *** 1347,1352 **** --- 1351,1358 ---- $result['MONITORDEFAULT'] = $result['monitordefault']; $result['SUSPENDMONITORS'] = $result['suspendmonitors']; + if (!empty($result['location'])) $result['FROM'] = $_SESSION['translate']->it('From').': '.PHPWS_Text::parseOutput($result['location']); + $result['AVATAR'] = null; if (!empty($result['avatar_file']) && $this->_use_avatars) { *************** *** 1358,1363 **** --- 1364,1371 ---- $result['AVATAR'] = '<img src="http://'.$result['avatar_file'].'" alt="" title="" border="0" />'; } + if (!empty($result['signature']) && $this->_use_signatures) $result['SIGNATURE'] = PHPWS_Text::parseOutput($result['signature']); + // Determine user's rank if($result['posts']&& $this->_user_ranks) { |