Add exclude id

This commit is contained in:
Laurent Destailleur 2020-05-24 12:11:39 +02:00
parent 509ce9f571
commit e2f0f0d71d

View File

@ -43,6 +43,7 @@ $joomlaserverinfo = empty($argv[3]) ? '' : $argv[3];
$image = 'image/__WEBSITE_KEY__/images/stories/dolibarr.png'; $image = 'image/__WEBSITE_KEY__/images/stories/dolibarr.png';
$max = (!isset($argv[4]) || (empty($argv[4]) && $argv[4] !== '0')) ? '10' : $argv[4]; $max = (!isset($argv[4]) || (empty($argv[4]) && $argv[4] !== '0')) ? '10' : $argv[4];
$excludeid = (empty($argv[5]) ? '' : $argv[5]);
if (empty($argv[3]) || !in_array($argv[1], array('test', 'confirm')) || empty($websiteref)) { if (empty($argv[3]) || !in_array($argv[1], array('test', 'confirm')) || empty($websiteref)) {
print '***** '.$script_file.' *****'."\n"; print '***** '.$script_file.' *****'."\n";
@ -87,6 +88,7 @@ if ($dbjoomla->error)
$sql = 'SELECT c.id, c.title, c.alias, c.created, c.introtext, `fulltext`, c.metadesc, c.metakey, c.language, c.created, c.publish_up, u.username FROM '.$joomlaprefix.'_content as c'; $sql = 'SELECT c.id, c.title, c.alias, c.created, c.introtext, `fulltext`, c.metadesc, c.metakey, c.language, c.created, c.publish_up, u.username FROM '.$joomlaprefix.'_content as c';
$sql .= ' LEFT JOIN '.$joomlaprefix.'_users as u ON u.id = c.created_by'; $sql .= ' LEFT JOIN '.$joomlaprefix.'_users as u ON u.id = c.created_by';
$sql .= ' WHERE featured = 1'; $sql .= ' WHERE featured = 1';
$sql .= ' AND c.id NOT IN ('.$excludeid.')';
$sql .= ' ORDER BY publish_up ASC'; $sql .= ' ORDER BY publish_up ASC';
$resql = $dbjoomla->query($sql); $resql = $dbjoomla->query($sql);