diff --git a/class2.php b/class2.php index 03b23b1ad..287977547 100644 --- a/class2.php +++ b/class2.php @@ -947,7 +947,7 @@ if (($_SERVER['QUERY_STRING'] == 'logout')/* || (($pref['user_tracking'] == 'ses // TODO - should be done inside online handler, more core areas need it (session handler for example) if (isset($pref['track_online']) && $pref['track_online']) { - $sql->db_Update('online', "online_user_id = 0, online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}' LIMIT 1"); + $sql->db_Update('online', "online_user_id = 0, online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}'"); } // earlier event trigger with user data still available diff --git a/e107_admin/db.php b/e107_admin/db.php index 2e77189b5..7a4abbcf2 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -536,7 +536,7 @@ class system_tools $sql = e107::getDb(); $del = array_keys($_POST['delplug']); - if($sql->db_Delete("plugin", "plugin_id='".intval($del[0])."' LIMIT 1")) + if($sql->db_Delete("plugin", "plugin_id='".intval($del[0])."'")) { $mes->add(LAN_DELETED, E_MESSAGE_SUCCESS); } diff --git a/e107_admin/image.php b/e107_admin/image.php index 6b9b9b317..e9470633f 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -480,7 +480,7 @@ class media_form_ui extends e_admin_form_ui $mes->addSuccess(LAN_IMA_004.": ".basename($path)); $mes->addSuccess(print_a($info,true)); $dim = intval($info['img-width'])." x ".intval($info['img-height']); - $sql2->db_Update("core_media","media_dimensions = '".$dim."', media_size = '".intval($info['fsize'])."' WHERE media_id = ".intval($row['media_id'])." LIMIT 1"); + $sql2->db_Update("core_media","media_dimensions = '".$dim."', media_size = '".intval($info['fsize'])."' WHERE media_id = ".intval($row['media_id']).""); } else { diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 3f5ba8f1b..dcc77cba2 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -641,7 +641,7 @@ function update_706_to_800($type='') if(e107::getDb()->select("core", "*", "e107_name='pm_prefs' LIMIT 1")) { if ($just_check) return update_needed('Rename the pm prefs'); - e107::getDb()->update("core", "e107_name='plugin_pm' WHERE e107_name = 'pm_prefs' LIMIT 1"); + e107::getDb()->update("core", "e107_name='plugin_pm' WHERE e107_name = 'pm_prefs'"); } diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 1e2c842ff..72b8bfde1 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -529,7 +529,7 @@ class comment { return; } - return e107::getDb()->update("comments","comment_blocked=1 WHERE comment_id = ".intval($id)." LIMIT 1"); + return e107::getDb()->update("comments","comment_blocked=1 WHERE comment_id = ".intval($id).""); } function approveComment($id) // appropve a single comment by comment id. @@ -539,7 +539,7 @@ class comment return; } - return e107::getDb()->update("comments","comment_blocked=0 WHERE comment_id = ".intval($id)." LIMIT 1"); + return e107::getDb()->update("comments","comment_blocked=0 WHERE comment_id = ".intval($id).""); } @@ -547,7 +547,7 @@ class comment { $tp = e107::getParser(); - if(!e107::getDb()->update("comments","comment_comment=\"".$tp->toDB($comment)."\" WHERE comment_id = ".intval($id)." LIMIT 1")) + if(!e107::getDb()->update("comments","comment_comment=\"".$tp->toDB($comment)."\" WHERE comment_id = ".intval($id)."")) { return "Update Failed"; // trigger ajax error message. } diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 8fd282b6f..e01b75de0 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -723,7 +723,7 @@ class e_menuManager { $sql = e107::getDb(); $parms = $sql->escape(strip_tags($_POST['menu_parms'])); - $check = $sql->db_Update("menus", "menu_parms='".$parms."' WHERE menu_id=".intval($_POST['menu_id'])." LIMIT 1"); + $check = $sql->db_Update("menus", "menu_parms='".$parms."' WHERE menu_id=".intval($_POST['menu_id']).""); if($check) @@ -1508,7 +1508,7 @@ class e_menuManager { } elseif($_POST['mode'] == 'update') { - $sql->db_Update("menus","menu_location = ".intval($area)." WHERE menu_id = ".intval($insertID)." LIMIT 1",$this->debug); + $sql->db_Update("menus","menu_location = ".intval($area)." WHERE menu_id = ".intval($insertID)."",$this->debug); } $c = 0; @@ -1523,7 +1523,7 @@ class e_menuManager { { list($b,$id) = explode("-",$val); $order[] = $id; - $sql->db_Update("menus","menu_order = ".$c." WHERE menu_id = ".intval($id)." LIMIT 1",$this->debug); + $sql->db_Update("menus","menu_order = ".$c." WHERE menu_id = ".intval($id)."",$this->debug); $c++; } diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index f43f07979..37efb265c 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -140,7 +140,7 @@ class e_online { //It has been at least 'online_timeout' seconds since this user's info last logged //Update user record with timestamp, current IP, current page and set pagecount to 1 - $query = "online_timestamp='".time()."', online_ip='{$ip}'{$update_page}, online_pagecount=1 WHERE online_user_id='{$row['online_user_id']}' LIMIT 1"; + $query = "online_timestamp='".time()."', online_ip='{$ip}'{$update_page}, online_pagecount=1 WHERE online_user_id='{$row['online_user_id']}'"; } else { @@ -149,7 +149,7 @@ class e_online $row['online_pagecount'] ++; } // Update user record with current IP, current page and increment pagecount - $query = "online_ip='{$ip}'{$update_page}, `online_pagecount` = '".intval($row['online_pagecount'])."' WHERE `online_user_id` = '{$row['online_user_id']}' LIMIT 1"; + $query = "online_ip='{$ip}'{$update_page}, `online_pagecount` = '".intval($row['online_pagecount'])."' WHERE `online_user_id` = '{$row['online_user_id']}'"; } } else @@ -159,7 +159,7 @@ class e_online { // It has been at least 'timeout' seconds since this user has connected // Update record with timestamp, current IP, current page and set pagecount to 1 - $query = "`online_timestamp` = '".time()."', `online_user_id` = '{$udata}'{$update_page}, `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + $query = "`online_timestamp` = '".time()."', `online_user_id` = '{$udata}'{$update_page}, `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0'"; } else { // Another visit within the timeout period @@ -168,7 +168,7 @@ class e_online $row['online_pagecount'] ++; } //Update record with current IP, current page and increment pagecount - $query = "`online_user_id` = '{$udata}'{$update_page}, `online_pagecount` = ".intval($row['online_pagecount'])." WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + $query = "`online_user_id` = '{$udata}'{$update_page}, `online_pagecount` = ".intval($row['online_pagecount'])." WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0'"; } } $sql->update('online', $query); @@ -189,14 +189,14 @@ class e_online if ($row['online_timestamp'] < (time() - $online_timeout)) //It has been at least 'timeout' seconds since this ip has connected { //Update record with timestamp, current page, and set pagecount to 1 - $query = "`online_timestamp` = '".time()."'{$update_page}, `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + $query = "`online_timestamp` = '".time()."'{$update_page}, `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0'"; } else { //Update record with current page and increment pagecount $row['online_pagecount'] ++; // echo "here {$online_pagecount}"; - $query="`online_pagecount` = {$row['online_pagecount']}{$update_page} WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + $query="`online_pagecount` = {$row['online_pagecount']}{$update_page} WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0'"; } $sql->update('online', $query); } diff --git a/e107_handlers/rate_class.php b/e107_handlers/rate_class.php index 3de36b67a..892597eef 100644 --- a/e107_handlers/rate_class.php +++ b/e107_handlers/rate_class.php @@ -307,7 +307,7 @@ class rater { $qry = ($type == 'up') ? "rate_up = {$totalUp} " : "rate_down = {$totalDown}"; $qry .= ", rate_voters = '{$newvoters}', rate_votes = {$totalVotes} "; - $qry .= " WHERE rate_table = '{$table}' AND rate_itemid = '{$itemid}' LIMIT 1"; + $qry .= " WHERE rate_table = '{$table}' AND rate_itemid = '{$itemid}'"; if($sql->db_Update("rate",$qry)) { diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php index 0de814d9e..849ca103e 100644 --- a/e107_plugins/forum/forum_update.php +++ b/e107_plugins/forum/forum_update.php @@ -1044,7 +1044,7 @@ function step10_ajax()//TODO $info['post_attachments'] = e107::serialize($newValues); // $sql->update('forum_post', $info); // XXX FIXME TODO screwed up due to _FIELD_DEFS - $sql->update('forum_post',"post_entry = \"".$info['post_entry']."\", post_attachments=\"".$info['post_attachments']."\" WHERE post_id = ".$post['post_id']." LIMIT 1"); + $sql->update('forum_post',"post_entry = \"".$info['post_entry']."\", post_attachments=\"".$info['post_attachments']."\" WHERE post_id = ".$post['post_id'].""); } }