PDA

View Full Version : looking for a "most recent images page"


jux58
07-15-2007, 07:35 AM
hello,

in my blog, the default page load the most recent image in time, but not the last post.
sometimes, i send older images, and i would like to display a page with the last ten or twenty posted images. i think it can use the ID of the image for that use.

do you know an addon fot that purpose ?
or do you have a php modele to build this page.

i precise that i can edit pages , because i have basic knowledge of programming but i'm not a specialist who can start from a white page !

thank you for your help !

http://lesphotosdejules.free.fr/blog/

Dkozikowski
07-15-2007, 01:04 PM
I thought there was an addon for this already.

I scanned quickly and did not see anything listed. I'm sure if I searched the forums I could come up with something but its been a few weeks since my last addon and this is such an easy task i'll make an addon for you shortly.

Dkozikowski
07-15-2007, 01:49 PM
Here it is:

You did nothing wrong. It's my fault. Try the new version 0.6.1

[download removed] - See post 7 bellow for new link

Upload recent_images.php to your addons folder.

Check out the readme file for detailed information.

jux58
07-18-2007, 08:21 PM
it doesn't work properly :confused:
it shows the first 5 (my choice) posted images: #3, #7, #8, #10, #10.
the #1, #2, #4, #5, #6, #9 were destroyed and dsen't exist in my website.
the last posted is #113.

you can see it at http://lesphotosdejules.free.fr/blog/index.php?x=browse

what is the wrong parameter that i used ?

thank for your help

Dkozikowski
07-18-2007, 08:41 PM
You did nothing wrong. It's my fault. Try the new version 0.6.1

[download removed] - See 2 posts bellow for new link

jux58
07-23-2007, 12:03 PM
:confused:

http://lesphotosdejules.free.fr/blog/index.php?x=browse
it is programmed to appear after the list of objectives

i have pixelpost 1.5. do i need 1.6 ?

Dkozikowski
07-23-2007, 02:44 PM
Haha. Nope, my stupidity again.

This will work fine with Pixelpost v1.5 / 1.6

I have so many addons that I am continually updating I get confused easily.

This next version (0.6.2) is guaranteed to work ;)

Follow the "Check for updates" link in your admin > addons panel or click the link in my signature to goto My Addons RSS Feed, or:

Download v0.6.2 (http://dwilkinsjr.com/public/pixelpost/myaddons/recent_images_v0.6.2.zip)

jux58
07-27-2007, 05:57 AM
but i needed to change the template and come back to pixelgrain to make it appear

thanks for your help

julien

http://lesphotosdejules.free.fr/blog/

jux58
07-27-2007, 06:24 AM
if you're not bored yet with me :confused:

i would like to remove the list and align the pictures like the classical brwose page.

how can i do ?
i tried to understand the code of the recent_images.php and i didn't found the parameter. what is the recent_image class ?
thanks a lot

julien

http://lesphotosdejules.free.fr/blog/

Dkozikowski
07-27-2007, 02:35 PM
but i needed to change the template and come back to pixelgrain to make it appear

thanks for your help

julien

http://lesphotosdejules.free.fr/blog/

I'm not sure what you mean by this.

Dkozikowski
07-27-2007, 02:57 PM
if you're not bored yet with me :confused:

i would like to remove the list and align the pictures like the classical brwose page.

how can i do ?
i tried to understand the code of the recent_images.php and i didn't found the parameter. what is the recent_image class ?
thanks a lot

julien

http://lesphotosdejules.free.fr/blog/

The .recentimages class can be used to style the list to make it look any way you wish via style sheets.

To remove the "bullets" from the recent images list, open the pixelgrain css file and add the following code to it:


.recentimages {
list-style: none;
}


Or, if you wish to place the images within a div instead of a list, copy the bellow code and use it to replace the original recent images code.

I'll whip up yet another version where you can define what kind of tag wished to be used via the template tag variables if you wish to wait.


<?php
/*

Pixelpost 1.6 FINAL
Written by: Dwilkinsjr
Written for: Pixelpost www: http://www.pixelpost.org/

<!--

__ _ ____ _ _
____/ / __(_) / /__(_)___ _____ (_)____
/ __ / | /| / / / / //_/ / __ \/ ___/ / / ___/ RECENT IMAGES v0.6.2
/ /_/ /| |/ |/ / / / ,< / / / / (__ ) / / /
\__,_/ |__/|__/_/_/_/|_/_/_/ /_/____/_/ /_/
http://dwilkinsjr.com/___/


-->

Contact: dwilkinsjr@dwilkinsjr.com
Copyright (c) 2007 <http://wwww.dwilkinsjr.com>

License: http://www.gnu.org/copyleft/gpl.html

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

*/

/**
* Pixelpost Addon variables
* No need to edit bellow this line
*
*/
$addon_name = "Recent Images";
$addon_version = "0.6.2";
$addon_description = "This addon will display the specified number of last published images as an unordered list.<br /><br />New Tag: <code>&lt;RECENT_IMAGES max=\"15\" order=\"DESC\"&gt;</code><br /><br />CSS Class: <code>.recentimages</code><br /><br />ADDON Author: Dwilkinsjr (<a href='http://www.dwilkinsjr.com/myaddons' target='_blank'>dwilkinsjr.com</a>) (<a href=\"http://versioncheckr.com/34/".$addon_version."/\">Check for updates</a>)";

/**
* Only run when the magpie template tag is found on page
*
*/
if(preg_match("<RECENT_IMAGES.*?>", $tpl)) {

/**
* Match ALL tags, not just the first one
*
*/
preg_match("/<RECENT_IMAGES\s*((.*?(<.*?>)?)*)\s*>/s", $tpl, $arg_string);
$arg_string = $arg_string[1];

while($arg_string != "") {
preg_match("/^(.*?)=('|\")?(.*?)\\2\s*(.*)$/s", $arg_string, $out);

$args[$out[1]] = $out[3];
$arg_string = $out[4];
}

/**
* Set defaults
*
*/
$max = "10";
$order = "DESC";

if($args['max']) {
$max = $args['max'];
$max = eregi_replace('[^0-9]+','',$max);
}
if($args['order']) {
$order = $args['order'];
$order = eregi_replace('[^a-zA-Z]+','',$order);
$order = strtoupper($order);
}
echo $order;

/**
* Gather the information from the database
*
*/
$query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."pixelpost WHERE `datetime` <= '$cdate' ORDER BY `datetime` $order LIMIT 0,$max") or die(mysql_error());

/**
* Begin the output string
*
*/
$recent_images = "<div class=\"recentimages\">\n";

while($row = mysql_fetch_array($query)) {

$headline = pullout($row['headline']);
$parent_id = $row['id'];

### Print out the contents of each row
$recent_images .= "\t<a href=\"".$siteURL."index.php?showimage=".$parent_id."\" id=\"ri".$parent_id."\"><img src=\"".$siteURL."thumbnails/thumb_".$row['image']."\" alt=\"".$headline."\" title=\"".$headline."\" /></a>\n";
}

$recent_images .= "</div>\n";

/**
* Only replace ONE!
*
*/
$tpl = preg_replace("/<RECENT_IMAGES\s*((.*?(<.*?>)?)*)\s*>/", $recent_images, $tpl);
}
?>

jux58
07-27-2007, 02:58 PM
in fact when i upload the recent_images.php.php to the addon directory, and the browse_template.html, nothing appears when i refresh the browse_template.html in my browser (firefox 2.0.0.5).

these days, i'm trying to change from pixelgrain to 235skinv2. so, in the admin page, i change pixelgrain to 235skinv2. and this morning, when i tried to come back to pixelgrain, i found the list of recent image in my browse_template.html .
i dont understand what happened.

Dkozikowski
07-27-2007, 03:09 PM
in fact when i upload the recent_images.php.php to the addon directory, and the browse_template.html, nothing appears when i refresh the browse_template.html in my browser (firefox 2.0.0.5).

these days, i'm trying to change from pixelgrain to 235skinv2. so, in the admin page, i change pixelgrain to 235skinv2. and this morning, when i tried to come back to pixelgrain, i found the list of recent image in my browse_template.html .
i dont understand what happened.

Ok, well the file name should be recent_images.php not recent_images.php.php

and if you wish to use this with the 235 skin, you must also place the template tag within the 235's browse_template.html file.

jux58
07-31-2007, 06:43 AM
with the 1.61 version

but not in the 1.65 version, which display the list ordered by date of shoot.
(in use in my site, [URL="http://lesphotosdejules.free.fr/blog/index.php?x=last"]).

thanks for the CSS file and de tag (i use Div, because you can see faster the complete list).

last, i don't understand the difference between ASC and DESC. i've trie it and i didn't see a difference.

thanks again

julien

Dkozikowski
07-31-2007, 06:50 PM
Don't worry about ASC and DESC. It just orders the photos a different way.

Using ASC would display the oldest photo first and the newest last as DESC does the opposite and displays the newest first and oldest last.

The default is set to DESC so there is no need to declare this value.