Site Map and Page-o-mation
Site Map and Page-o-mation
am 13.11.2008 04:11:32 von Ron Piggott
I need help with a site map I am making using PHP. The site map is of an
online photo gallery.
In the code below I am trying to determine the value for the
photo theme (category) thumbnail image pages. Each of the photo theme
(category) pages may display up to 18 thumbnail images and then the next
web page is made. I use page-o-mation to offer the subsequent pages for
photos that are of similar content.
The code below is what I have come up with so far. Where I am stuck is
determining the most recent photo_gallery_index.last_update value for
the up to 18 photos thumbnails which are being displayed.
I am wondering if I should be doing this WHILE loop, to scan the up to
18 images.
So far my results only incorporate the first image being displayed.
Any suggestions?
Ron
$page_link=1;
$ii=0;
$last_update = "0000-00-00";
while ($ii < $number_of_images) {
$current_photo_last_update = mysql_result($image_result,
$ii,"photo_gallery_index.last_update");
if ( $current_photo_last_update > $last_update ) { $last_update =
$current_photo_last_update; }
$site_map .= " \r\n";
$site_map .= "
http://www.rons-home.net/photo-gallery-category/" .
stripslashes($photo_gallery_category) . "/" . $page_link . "/\r
\n";
$site_map .= " " . $last_update . "\r\n";
$site_map .= " weekly\r\n";
$site_map .= " 1\r\n";
$site_map .= " \r\n";
++$page_link;
$ii=$ii+18;
}
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Site Map and Page-o-mation
am 13.11.2008 04:28:44 von dmagick
Ron Piggott wrote:
> I need help with a site map I am making using PHP. The site map is of an
> online photo gallery.
>
> In the code below I am trying to determine the value for the
> photo theme (category) thumbnail image pages. Each of the photo theme
> (category) pages may display up to 18 thumbnail images and then the next
> web page is made. I use page-o-mation to offer the subsequent pages for
> photos that are of similar content.
>
> The code below is what I have come up with so far. Where I am stuck is
> determining the most recent photo_gallery_index.last_update value for
> the up to 18 photos thumbnails which are being displayed.
select * from table order by last_update_time desc limit 18;
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Site Map and Page-o-mation
am 13.11.2008 04:47:53 von Ron Piggott
This doesn't take into account the page - o - mation though.
The query that determines which up to 18 images display on the
thumbnails page is:
SELECT * FROM photo_gallery_category INNER JOIN photo_gallery_index ON
photo_gallery_index.photo_gallery_category_reference =
photo_gallery_category.reference WHERE
photo_gallery_category.category_name = '$photo_gallery_category' ORDER
BY photo_gallery_index.filename ASC LIMIT " . ( ($page*18) -18) . " , 18
I see where you are coming from Chris. What I need to know is from the
18 images which has the most recent last_update value. I need the site
map to match what is being displayed on the thumbnails page.
Ron
On Thu, 2008-11-13 at 14:28 +1100, Chris wrote:
> Ron Piggott wrote:
> > I need help with a site map I am making using PHP. The site map is of an
> > online photo gallery.
> >
> > In the code below I am trying to determine the value for the
> > photo theme (category) thumbnail image pages. Each of the photo theme
> > (category) pages may display up to 18 thumbnail images and then the next
> > web page is made. I use page-o-mation to offer the subsequent pages for
> > photos that are of similar content.
> >
> > The code below is what I have come up with so far. Where I am stuck is
> > determining the most recent photo_gallery_index.last_update value for
> > the up to 18 photos thumbnails which are being displayed.
>
> select * from table order by last_update_time desc limit 18;
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Site Map and Page-o-mation
am 13.11.2008 05:30:12 von dmagick
Ron Piggott wrote:
> This doesn't take into account the page - o - mation though.
>
> The query that determines which up to 18 images display on the
> thumbnails page is:
>
> SELECT * FROM photo_gallery_category INNER JOIN photo_gallery_index ON
> photo_gallery_index.photo_gallery_category_reference =
> photo_gallery_category.reference WHERE
> photo_gallery_category.category_name = '$photo_gallery_category' ORDER
> BY photo_gallery_index.filename ASC LIMIT " . ( ($page*18) -18) . " , 18
>
> I see where you are coming from Chris. What I need to know is from the
> 18 images which has the most recent last_update value. I need the site
> map to match what is being displayed on the thumbnails page.
You can order by two fields.
order by filename asc, last_update_time desc limit ...
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Site Map and Page-o-mation
am 13.11.2008 10:01:30 von Ron Piggott
Chris I had tried this solution before I e-mailed the list. It didn't
work, the image filenames are sequential order ( 00001.JPG, 00002.JPG,
etc.)
I have simply decided to put the most updated images showing on the
first page of thumbnails by reversing the ORDER BY to have the date
field first and file name second.
Thanks for your input.
Ron
On Thu, 2008-11-13 at 15:30 +1100, Chris wrote:
> Ron Piggott wrote:
> > This doesn't take into account the page - o - mation though.
> >
> > The query that determines which up to 18 images display on the
> > thumbnails page is:
> >
> > SELECT * FROM photo_gallery_category INNER JOIN photo_gallery_index ON
> > photo_gallery_index.photo_gallery_category_reference =
> > photo_gallery_category.reference WHERE
> > photo_gallery_category.category_name = '$photo_gallery_category' ORDER
> > BY photo_gallery_index.filename ASC LIMIT " . ( ($page*18) -18) . " , 18
> >
> > I see where you are coming from Chris. What I need to know is from the
> > 18 images which has the most recent last_update value. I need the site
> > map to match what is being displayed on the thumbnails page.
>
> You can order by two fields.
>
> order by filename asc, last_update_time desc limit ...
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php