VisiblePhoto
10-26-2008, 02:55 AM
for some reasn maintaining categories in the image view seems to have been over looked. I have added it and here are the changes needed from version 1.7.1:
index.php line 508 change to:
if (isset($_GET['category'])) {
$previous_row = sql_array("select ".$pixelpost_db_prefix."pixelpost.image,".$pixelpost_db_prefix."pixelpost.alt_headline,".$pixelpost_db_prefix."pixelpost.headline,".$pixelpost_db_prefix."pixelpost.id,".$pixelpost_db_prefix."pixelpost.datetime from ".$pixelpost_db_prefix."pixelpost, ".$pixelpost_db_prefix."catassoc where (".$pixelpost_db_prefix."pixelpost.datetime < '$image_datetime') and (datetime<='$cdate') and ".$pixelpost_db_prefix."pixelpost.id=image_id and cat_id=" . $_GET['category'] . " order by ".$pixelpost_db_prefix."pixelpost.datetime desc limit 0,1");
} else {
$previous_row = sql_array("SELECT id,headline,alt_headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime < '$image_datetime') and (datetime<='$cdate') ORDER BY datetime desc limit 0,1");
}
index.php line 527 change to:
$image_category_inc = (isset($_GET['category']))?('&category='.$_GET['category']):'';
$image_previous_link = "<a href='$showprefix$image_previous_id$image_category _inc'>$lang_previous</a>";
index.php line 546 change to:
if (isset($_GET['category'])) {
$next_row = sql_array("select ".$pixelpost_db_prefix."pixelpost.image,".$pixelpost_db_prefix."pixelpost.alt_headline,".$pixelpost_db_prefix."pixelpost.headline,".$pixelpost_db_prefix."pixelpost.id,".$pixelpost_db_prefix."pixelpost.datetime from ".$pixelpost_db_prefix."pixelpost, ".$pixelpost_db_prefix."catassoc where (".$pixelpost_db_prefix."pixelpost.datetime > '$image_datetime') and (datetime<='$cdate') and ".$pixelpost_db_prefix."pixelpost.id=image_id and cat_id=" . $_GET['category'] . " order by ".$pixelpost_db_prefix."pixelpost.datetime ASC limit 0,1");
} else {
$next_row = sql_array("SELECT id,headline,alt_headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime > '$image_datetime') and (datetime<='$cdate') ORDER BY datetime asc limit 0,1");
}
index.php line 565 change to:
$image_next_link = "<a href='$showprefix$image_next_id$image_category_inc '>$lang_next</a>";
Once these changes are made if an image is opended with &category= then the next and previous will take into account that category and the &category= will be included in the links. If opened without then it will work exactly the same as it does now.
index.php line 508 change to:
if (isset($_GET['category'])) {
$previous_row = sql_array("select ".$pixelpost_db_prefix."pixelpost.image,".$pixelpost_db_prefix."pixelpost.alt_headline,".$pixelpost_db_prefix."pixelpost.headline,".$pixelpost_db_prefix."pixelpost.id,".$pixelpost_db_prefix."pixelpost.datetime from ".$pixelpost_db_prefix."pixelpost, ".$pixelpost_db_prefix."catassoc where (".$pixelpost_db_prefix."pixelpost.datetime < '$image_datetime') and (datetime<='$cdate') and ".$pixelpost_db_prefix."pixelpost.id=image_id and cat_id=" . $_GET['category'] . " order by ".$pixelpost_db_prefix."pixelpost.datetime desc limit 0,1");
} else {
$previous_row = sql_array("SELECT id,headline,alt_headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime < '$image_datetime') and (datetime<='$cdate') ORDER BY datetime desc limit 0,1");
}
index.php line 527 change to:
$image_category_inc = (isset($_GET['category']))?('&category='.$_GET['category']):'';
$image_previous_link = "<a href='$showprefix$image_previous_id$image_category _inc'>$lang_previous</a>";
index.php line 546 change to:
if (isset($_GET['category'])) {
$next_row = sql_array("select ".$pixelpost_db_prefix."pixelpost.image,".$pixelpost_db_prefix."pixelpost.alt_headline,".$pixelpost_db_prefix."pixelpost.headline,".$pixelpost_db_prefix."pixelpost.id,".$pixelpost_db_prefix."pixelpost.datetime from ".$pixelpost_db_prefix."pixelpost, ".$pixelpost_db_prefix."catassoc where (".$pixelpost_db_prefix."pixelpost.datetime > '$image_datetime') and (datetime<='$cdate') and ".$pixelpost_db_prefix."pixelpost.id=image_id and cat_id=" . $_GET['category'] . " order by ".$pixelpost_db_prefix."pixelpost.datetime ASC limit 0,1");
} else {
$next_row = sql_array("SELECT id,headline,alt_headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime > '$image_datetime') and (datetime<='$cdate') ORDER BY datetime asc limit 0,1");
}
index.php line 565 change to:
$image_next_link = "<a href='$showprefix$image_next_id$image_category_inc '>$lang_next</a>";
Once these changes are made if an image is opended with &category= then the next and previous will take into account that category and the &category= will be included in the links. If opened without then it will work exactly the same as it does now.