mark
02-24-2005, 07:35 PM
Seems I forgot one additional change to your index.php file.....this little bug was spotted by "tseneadza"...thanks man!
To build your browse archive screen properly (per category), you'll have to make some changes....This part is semi-tricky, because i really dont know what you may have or have not done to your "browse" section...This seems like an area that everyone has customized...
For consistency, i'll show what you'll need to change if you were using the original "browse" section of pixelpost 1.3 with no mods...
Change:
if($_GET['x'] == "browse") {
$thumb_output = "";
$where = "";
if($_GET['category'] != "") { $where = "and (category='".$_GET['category']."')"; }
$query = mysql_query("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') $where order by datetime desc");
while(list($id,$title,$name) = mysql_fetch_row($query)) {
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
}
$tpl = ereg_replace("<THUMBNAILS>",$thumb_output,$tpl);
}
// build browse menu
To:
if($_GET['x'] == "browse") {
$thumb_output = "";
$where = "";
if($_GET['category'] != "") {
$query = mysql_query("select t2.id,headline,image,datetime from ".$pixelpost_db_prefix."catassoc as t1 inner join ".$pixelpost_db_prefix."pixelpost t2 on t2.id = t1.image_id where t1.cat_id = '".$_GET['category']."' order by datetime desc");
} ELSE IF ($_GET['archivedate'] != "") {
$where = "and (DATE_FORMAT(datetime, '%Y-%m')='".$_GET['archivedate']."')"; //DATE_FORMAT(foo, '%Y-%m-%d')
$query = mysql_query("select id,headline,image, datetime from ".$pixelpost_db_prefix."pixelpost where (datetime<='$adjusted_datetime') $where order by datetime desc");
} ELSE {
$query = mysql_query("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') order by datetime desc");
}
while(list($id,$title,$name) = mysql_fetch_row($query)) {
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
}
$tpl = ereg_replace("<THUMBNAILS>",$thumb_output,$tpl);
}
// build browse menu
Thats it....I also update the download zip file to include these directions...
Sorry everyone... :!:
To build your browse archive screen properly (per category), you'll have to make some changes....This part is semi-tricky, because i really dont know what you may have or have not done to your "browse" section...This seems like an area that everyone has customized...
For consistency, i'll show what you'll need to change if you were using the original "browse" section of pixelpost 1.3 with no mods...
Change:
if($_GET['x'] == "browse") {
$thumb_output = "";
$where = "";
if($_GET['category'] != "") { $where = "and (category='".$_GET['category']."')"; }
$query = mysql_query("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') $where order by datetime desc");
while(list($id,$title,$name) = mysql_fetch_row($query)) {
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
}
$tpl = ereg_replace("<THUMBNAILS>",$thumb_output,$tpl);
}
// build browse menu
To:
if($_GET['x'] == "browse") {
$thumb_output = "";
$where = "";
if($_GET['category'] != "") {
$query = mysql_query("select t2.id,headline,image,datetime from ".$pixelpost_db_prefix."catassoc as t1 inner join ".$pixelpost_db_prefix."pixelpost t2 on t2.id = t1.image_id where t1.cat_id = '".$_GET['category']."' order by datetime desc");
} ELSE IF ($_GET['archivedate'] != "") {
$where = "and (DATE_FORMAT(datetime, '%Y-%m')='".$_GET['archivedate']."')"; //DATE_FORMAT(foo, '%Y-%m-%d')
$query = mysql_query("select id,headline,image, datetime from ".$pixelpost_db_prefix."pixelpost where (datetime<='$adjusted_datetime') $where order by datetime desc");
} ELSE {
$query = mysql_query("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') order by datetime desc");
}
while(list($id,$title,$name) = mysql_fetch_row($query)) {
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
}
$tpl = ereg_replace("<THUMBNAILS>",$thumb_output,$tpl);
}
// build browse menu
Thats it....I also update the download zip file to include these directions...
Sorry everyone... :!: