Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > MISCELLANEOUS > Archives > Bug Report 1.4.x

Post Reply
 
Thread Tools
  #1  
Old 09-16-2005, 03:46 PM
mello Offline
forum loafer
 
Join Date: Sep 2005
Posts: 1
Issue with paged_archive and images with no category

Hey,

I ran into an issue with images that don't have a category associated with them and the paged_archive addon. Basically when viewing 'all' images, the images with no category are not shown. I tested this with both the paged_archive addon from pp 1.4.2 and also the latest from cvs.

Here's a fix for it as well:

Originally paged_archive.php contains about halfway through, the following:

Quote:
// did user select a category?

if($_GET['category'] != "") { $where = "and (t2.cat_id ='".$_GET['category']."')"; }

// do you use links with page number?
if ($_GET['pagenum'] != "") {
$start = $maxnumber_thumbs*($_GET['pagenum']-1);// calculate start and end of the thumbs in the selected page
$limit = " limit $start , $maxnumber_thumbs "; // create the limit command (in MS-SQL this should be TOP)
}// end if ($_GET['pagenum'] != "")

// build query
if ($_GET['archivedate']=="")
{
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1
inner join {$pixelpost_db_prefix}catassoc as t2
where (t1.datetime<='$cdate')
$where
and t1.id = t2.image_id
group by t1.id
order by t1.datetime desc" .$limit;
I modified this, to look as follows:

Quote:
// did user select a category?

if($_GET['category'] != "") { $where = "and (t2.cat_id ='".$_GET['category']."') and t1.id = t2.image_id"; }

// do you use links with page number?
if ($_GET['pagenum'] != "") {
$start = $maxnumber_thumbs*($_GET['pagenum']-1);// calculate start and end of the thumbs in the selected page
$limit = " limit $start , $maxnumber_thumbs "; // create the limit command (in MS-SQL this should be TOP)
}// end if ($_GET['pagenum'] != "")

// build query
if ($_GET['archivedate']=="")
{
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1
inner join {$pixelpost_db_prefix}catassoc as t2
where (t1.datetime<='$cdate')
$where
group by t1.id
order by t1.datetime desc" .$limit;
so basically, I moved the
Quote:
and t1.id = t2.image_id
out of the $query definition up into the
Quote:
if($_GET['category'] != "")
statement.

regards,

mello
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 09:40 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs