1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Replace usage of deprecated updateArray() method.

This commit is contained in:
Cameron 2019-03-02 08:49:42 -08:00
parent 64bab92d68
commit 943ea1ddd7
3 changed files with 22 additions and 20 deletions

View File

@ -223,8 +223,10 @@ if (isset($_POST['updatelimits']))
{
$vals[$targetFields[$k+1]] = intval($_POST[$lName][$idLim]);
}
$vals['WHERE'] = "gen_id = ".$idLim;
$sql->update('generic',$vals);
$valString = implode(',',$vals);
$sql->db_UpdateArray('generic',$vals," WHERE gen_id = {$idLim}");
e107::getLog()->add('DOWNL_10',$idLim.', '.$valString,E_LOG_INFORMATIVE,'');
$message .= $idLim." - ".DOWLAN_121."<br/>";
unset($vals);

View File

@ -299,19 +299,20 @@ class gsitemap
'gsitemap_lastmod' => $_POST['gsitemap_lastmod'],
'gsitemap_freq' => $_POST['gsitemap_freq'],
'gsitemap_order' => $_POST['gsitemap_order'],
'gsitemap_active' => $_POST['gsitemap_active']
'gsitemap_active' => $_POST['gsitemap_active'],
'WHERE' => ' gsitemap_id= '.intval($_POST['gsitemap_id'])
);
if(isset($_POST['gsitemap_id']))
if(!empty($_POST['gsitemap_id']))
{
$this -> message = $sql -> db_UpdateArray("gsitemap", $gmap, ' WHERE gsitemap_id= '.intval($_POST['gsitemap_id'])) ? LAN_UPDATED : LAN_UPDATED_FAILED;
$this -> message = $sql->update("gsitemap", $gmap) ? LAN_UPDATED : LAN_UPDATED_FAILED;
$log->logArrayAll('GSMAP_04',$gmap);
}
else
{
$gmap['gsitemap_img'] = $_POST['gsitemap_img'];
$gmap['gsitemap_cat'] = $_POST['gsitemap_cat'];
$this -> message = ($sql -> db_Insert('gsitemap',$gmap)) ? LAN_CREATED : LAN_CREATED_FAILED;
$this -> message = ($sql->insert('gsitemap',$gmap)) ? LAN_CREATED : LAN_CREATED_FAILED;
$log->logArrayAll('GSMAP_03',$gmap);
}
}

View File

@ -943,7 +943,11 @@ class rss
// Db:create/update
function dbrss($mode='create')
{
global $sql, $ns, $tp, $e107cache, $admin_log;
$sql = e107::getDb();
$tp = e107::getParser();
$cache = e107::getCache();
$log = e107::getLog();
if($_POST['rss_name'] && $_POST['rss_url'] && $_POST['rss_path'])
{
@ -956,27 +960,21 @@ class rss
$rssVals['rss_class'] = (intval($_POST['rss_class']) ? intval($_POST['rss_class']) : '0');
$rssVals['rss_limit'] = intval($_POST['rss_limit']);
// $rssVals['rss_exclude_class'] = intval($_POST['rss_exclude_class']);
if(isset($_POST['rss_datestamp']) && $_POST['rss_datestamp']!='')
{
$rssVals['rss_datestamp'] = intval($_POST['rss_datestamp']);
}
else
{
$rssVals['rss_datestamp'] = time();
}
$rssVals['rss_datestamp'] = !empty($_POST['rss_datestamp']) ? (int) $_POST['rss_datestamp'] : time();
$rssVals['WHERE'] = " rss_id = ".intval($_POST['rss_id']);
switch ($mode)
{
case 'create' :
$message = ($sql -> db_Insert('rss',$rssVals)) ? LAN_CREATED : LAN_CREATED_FAILED;
$admin_log->logArrayAll('RSS_02',$rssVals, $message);
$e107cache->clear('rss');
$message = ($sql ->insert('rss',$rssVals)) ? LAN_CREATED : LAN_CREATED_FAILED;
$log->logArrayAll('RSS_02',$rssVals, $message);
$cache->clear('rss');
break;
case 'update' :
$message = ($sql -> db_UpdateArray('rss', $rssVals, " WHERE rss_id = ".intval($_POST['rss_id']))) ? LAN_UPDATED : LAN_UPDATED_FAILED;
$admin_log->logArrayAll('RSS_03',$rssVals, $message);
$e107cache->clear('rss');
$message = ($sql ->update('rss', $rssVals)) ? LAN_UPDATED : LAN_UPDATED_FAILED;
$log->logArrayAll('RSS_03',$rssVals, $message);
$cache->clear('rss');
break;
}
}
@ -984,6 +982,7 @@ class rss
{
$message = RSS_LAN_ERROR_7;
}
return $message;
}