1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

Closes Issue #319

This commit is contained in:
SecretR
2013-05-24 22:40:10 +03:00
parent f7f3dd65f3
commit 06a2ea8fa0
9 changed files with 18 additions and 18 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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
{

View File

@@ -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'");
}

View File

@@ -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.
}

View File

@@ -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++;
}

View File

@@ -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);
}

View File

@@ -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))
{

View File

@@ -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']."");
}
}