summaryrefslogtreecommitdiffstats
path: root/bin/catalog_update.php.inc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/catalog_update.php.inc')
-rw-r--r--bin/catalog_update.php.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/catalog_update.php.inc b/bin/catalog_update.php.inc
index d03270b9..4ad80076 100644
--- a/bin/catalog_update.php.inc
+++ b/bin/catalog_update.php.inc
@@ -20,13 +20,21 @@
*/
-
$no_session='1';
require ("../modules/init.php");
echo "[catalog_update.php.inc]\nStarting Catalog Clean/Update And Add\n\n";
-$sql = "SELECT id FROM catalog WHERE catalog_type='local'";
+if (count($_SERVER['argv']) > 1) {
+ for ($x = 1; $x < count($_SERVER['argv']); $x++) {
+ if ($where) $where .= " OR ";
+ $where .= "name LIKE '%" . preg_replace("/[^a-z0-9\. -]/i", "", $_SERVER['argv'][$x]) . "%'";
+ }
+}
+if ($where) $where = "($where) AND catalog_type='local'";
+else $where = "catalog_type='local'";
+$sql = "SELECT id FROM catalog";
+if ($where) $sql .= " WHERE $where";
$db_results = mysql_query($sql, dbh());
while ($r = mysql_fetch_row($db_results)) {