If you read the notation in this code it states what it does but in reverse to what I need. I want the earliest time to be displayed first not the latest. I'm not a coder but I can hack and slash a few things. I'm sure it's something simple but I just dont see it.
Code:
// view=images
if($_GET['view'] == "images")
{
if($_GET['action'] == "masspublish")
{
$idz= $_POST['moderate_image_boxes'];
// This is rather interesting since when multiple pictures have the same datetime stamp only the last one
// will be shown. This means we have to construct single queries for each selected id and give them a
// unique datetimestamp.
// Since the latest image is displayed first we need to sort the idz because the lowest id have to be
// published first.
sort($idz);
$minute_offset = 1;
$current_hour = date("H");
$current_minutes = date("i");
$current_seconds = date("s");
$ids = count($idz) - 1;
$query = "UPDATE ".$pixelpost_db_prefix."pixelpost SET datetime = ";
for ($i=0; $i < count($idz); $i++)
{
$datetimestamp = gmdate("Y-m-d H:i:s", mktime($current_hour, $current_minutes-($minute_offset*($ids-$i)), $current_seconds, date("m"), date("d"), date("Y"))+(3600 * $tz));
$finalquery=$query."'".$datetimestamp."' WHERE id = '".(int)$idz[$i]."'";
$finalquery = sql_query($finalquery);
}
$c = count($idz);
echo "<div class='jcaption confirm'>$admin_lang_imgedit_published $c $admin_lang_imgedit_unpublished_cmnts</div>";
}