Hi David
Not sure if this has come up before, is it possible to add a "run all" link in automation_tool.php?
Chris
Thanks David
Likewise is it possible add import all and import all modified to feeds_register.php.
Chris
Hi Chris,
That's a bit more code; firstly in admin/index.php, add the links to each type by looking for the following code at line 240:
print "</table>";
...and REPLACE with:
print "</table>";
print "<p>";
print "<a href='feeds_import.php?filename=@MODIFIED'>Import Modified</a> ";
print "<a href='feeds_import.php?filename=@ALL'>Import All</a> ";
print "</p>";
Next, in admin/feeds_import.php look for the following code at line 27:
admin_import($filename,$limit);
...and REPLACE with:
if ($filename == "@ALL")
{
$sql = "TRUNCATE `".$config_databaseTablePrefix."products`";
database_queryModify($sql,$result);
$sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds`";
if (database_querySelect($sql,$rows))
{
foreach($rows as $feed)
{
if (file_exists($config_feedDirectory.$feed["filename"]))
{
admin_import($feed["filename"],$limit);
}
}
}
}
elseif($filename == "@MODIFIED")
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds`";
if (database_querySelect($sql,$rows))
{
foreach($rows as $feed)
{
if (file_exists($config_feedDirectory.$feed["filename"]) && ($feed["imported"] < filemtime($config_feedDirectory.$feed["filename"])))
{
admin_import($feed["filename"],$limit);
}
}
}
}
else
{
admin_import($filename,$limit);
}
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David
Thanks for doing that, it worked great.
Chris
Hi David
Could you point me in the right direction, i am trying to show a progress printout like scripts/import.php produces but in feeds_import.php. I only seem to get the following working:
print chr(13)."backfilling reviews... ";
admin_importReviews();
print chr(13)."backfilling reviews...[done]\n";
Chris
Hi Chris,
I have an alternative version of admin/feeds_import.php that generates the same output as the scripts/ version i'll forward it now for you...
Cheers,
David.
--
PriceTapestry.com
Hi Chris,
Should be straight forward to plumb in. First in admin/automation_tool.php look for the following code at line 63:
print "<a href='automation_tool_edit.php?id=0'>New Job</a> ";
...and REPLACE with:
print "<a href='automation_tool_edit.php?id=0'>New Job</a> ";
print "<a href='automation_tool_run.php?id=0'>Run All</a> ";
Next, in admin/automation_tool_run.php look for the following code beginning at line 14:
$id = $_GET["id"];
automation_run($id);
...and REPLACE with:
$id = $_GET["id"];
if (!$id)
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."jobs`";
if (database_querySelect($sql,$jobs))
{
foreach($jobs as $job)
{
automation_run($job["id"]);
}
}
}
else
{
automation_run($id);
}
Cheers,
David.
--
PriceTapestry.com