View Full Version : More than one photo a day on the same page.
aswilliamson
04-06-2005, 09:13 PM
Would it be possible for someone to make a mod that would make pixelpost display all the photos submitted on the same day appear on one page.
This has been talked about in this thread http://www.pixelpost.org/forum/viewtopic.php?t=654
that way if say you take 3 pictures which are related you post them all in one day similar to this
http://www.sh1ft.org/shutterbug/
The advandage of this would be they all show up on the same page but continue to have seperate thumbs
thanks
blinking8s
04-07-2005, 09:12 AM
version 1.4 which will be released very soon will take care of this.
aswilliamson
04-07-2005, 08:08 PM
ohh nice
raminia
04-08-2005, 06:00 AM
no! v1.4 does not support this. is supports posting serveral photos in the same day, in the same minute but does not show them in the same page!
There could be a simple addon for this with a new HTML tag. no need for modification of index.php!!
aswilliamson
04-08-2005, 07:42 PM
ok, anyone know howto do this?
it's not just as simple as a saying display current image, and then display prevous image, it should only display a prevous image on the same page, if the Date is the same, and this would have to be specified somewhere in the admin page.
raminia
04-08-2005, 08:41 PM
I'm writing here witout testing
you can put this into an addon/
if($_GET['showimage'] == "") {
$today_date = date("D",$cdate);
$query = mysql_query("select * from ".$pixelpost_db_prefix."pixelpost where datetime='$today_date' order by datetime DESC limit 0,1");
$today_image_thumbnails = "";
while(list($image_id,$image_title,$image_name) = mysql_fetch_row($query)) {
$today_image_thumbnails .= "<a href='$PHP_SELF?showimage=$image_id'><img src='thumbnails/thumb_$image_name' alt='$image_title' title='$image_title' width='' height='' /></a>";
}
$tpl = ereg_replace("<TODAY_IMAGE_THUMBNAILS>",$today_image_thumbnails,$tpl);
}
raminia
04-08-2005, 09:30 PM
Ok I made it. compatible with bot v1.3 and v1.4
new tags to show the thumbnails and images of the same day in the main page.
new tags
<TODAY_IMAGE_THUMBNAILS>
<TODAY_IMAGES>
btw I don't have any use for this :)
tha addon code:
<?php
/*
Requires Pixelpost version 1.3
Today Images version 0.1
Written by: Ramin Mehran
Contact: raminia@yahoo.com
Pixelpost www: http://www.pixelpunk.se/software/
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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
$addon_name = "Today Images";
$addon_description = "Images of today in the main page.";
$addon_version = "0.1";
if($_GET['showimage'] == "") {
//$tz = $cfgrow['timezone'];
//$cdate = gmdate("Y-m-d H:i:s",time()+(3600 * $tz)); // current date+time
$query = mysql_query("select id from ".$pixelpost_db_prefix."pixelpost where datetime<='" .$cdate ."' order by datetime DESC limit 0,1");
$row= mysql_fetch_array($query);
$currect_image_id = $row['id'];
$query = mysql_query("select datetime from ".$pixelpost_db_prefix."pixelpost where id='" .$currect_image_id ."'");
$row= mysql_fetch_array($query);
$currect_image_date = strtotime($row['datetime']);
$currect_image_date = strtotime($row['datetime']);
$currect_image_date = date("y-m-d",$currect_image_date);
makethumb($currect_image_date);
}
else
{
$query = mysql_query("select datetime from ".$pixelpost_db_prefix."pixelpost where id='" .$_GET['showimage'] ."'");
$row= mysql_fetch_array($query);
$currect_image_date = strtotime($row['datetime']);
$currect_image_date = date("y-m-d",$currect_image_date);
makethumb($currect_image_date);
}
//// functions
function makethumb($the_date)
{
global $tpl,$pixelpost_db_prefix;
$query = mysql_query("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where datetime like '%$the_date%' order by datetime DESC");
$today_image_thumbnails = "";
$today_images = "";
while(list($image_id,$image_title,$image_name) = mysql_fetch_row($query)) {
$today_image_thumbnails .= "<a href='$PHP_SELF?showimage=$image_id'><img src='thumbnails/thumb_$image_name' alt='$image_title' title='$image_title' /></a>";
$today_images .= "<a href='$PHP_SELF?showimage=$image_id'><img src='images/$image_name' alt='$image_title' title='$image_title' /></a>";
}
$tpl = ereg_replace("<TODAY_IMAGE_THUMBNAILS>",$today_image_thumbnails,$tpl);
$tpl = ereg_replace("<TODAY_IMAGES>",$today_images,$tpl);
}
?>
NOTE THAT THIS MESSAGE IS UPDATED MAKE SURE YOU HAVE THE LATEST VERSION.
raminia
04-08-2005, 09:38 PM
It always shows these images and thumbs. now you modify it to show when you choose them to be shown :D :))
blinking8s
04-08-2005, 11:17 PM
im sorry, i thought he meant multiple photos on one day for some reason! *smacks self* i need to get more sleep
aswilliamson
04-09-2005, 05:43 AM
wooh you guys are amazing
aswilliamson
04-09-2005, 06:03 AM
so now is there a way to show all the photos from today on the image_template when you first view the site, and then still have it regular at ohter time, like when looking at prevous page and archives etc?
raminia
04-09-2005, 06:28 AM
It shows the all photos on the same day as the image you are viewing on photoblog. Even if it is on the same date as today or if it is an image shown by clicking on one of the thumbnails in the archive. It's exactly what you wanted unless is does not cosider any limitation for not showing this on some days that you select.
aswilliamson
04-09-2005, 07:47 PM
ok so.. how would I replace
<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><img id="image" src="images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="go to <IMAGE_PREVIOUS_TITLE>" /></a>
with
<TODAY_IMAGES>
Joe[y]
04-11-2005, 09:50 AM
does that method not rely on there being at least one photo posted each day?
ie, if a photo isn't posted the <today_image> tag won't show anything?
raminia
04-11-2005, 05:58 PM
no if there is no photo at a day there would show nothing on that day. but if you browse the main page it will show the latest photo at least. try it yourself instead of asking. plz
Joris
04-11-2005, 06:14 PM
It works unless you try to get to the previous photo by clicking on one of the current photos. Both photos should be linking to the previous day instead of just the previous photo.
raminia
04-11-2005, 06:25 PM
sorry that a matter of template design.
or if you want links to photos on the same day you can extract the id of the photos and make new tags in the addon.
Anonymous
04-12-2005, 10:05 AM
I think i just used the provided tags, no links in the template, but I'll check
Joris
04-12-2005, 10:06 AM
.. that was me, forgot to login
cmckibbin
04-22-2005, 11:14 AM
It works unless you try to get to the previous photo by clicking on one of the current photos. Both photos should be linking to the previous day instead of just the previous photo.
I found that this works:
In image_template "<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><TODAY_IMAGES></a>"
In addon file "$today_images .= "<img id='image' src='images/$image_name' alt='$image_title' title='$image_title' />";" (take out the <a> tag)
cmckibbin
05-06-2005, 10:27 PM
I would still like to see this post 2 images on one page, but only be one entry...
adriandaine
05-14-2005, 02:56 PM
Ok, I get it, but...
Where do I have to write the "addon code"? index.php?
Thx.
Joe[y]
05-14-2005, 03:31 PM
Ok, I get it, but...
Where do I have to write the "addon code"? index.php?
Thx.
create a new php file and save it in the addons directory. index.php automatically calls up the addon script itself.
adriandaine
05-14-2005, 03:35 PM
Thank you very much!
link to previous image doesn't work.
It's something in the add-on file
In here maybe?
$today_image_thumbnails .= "<a href='$PHP_SELF?showimage=$image_id'><img src='thumbnails/thumb_$image_name' alt='$image_title' title='$image_title' /></a>";
$today_images .= "<a href='$PHP_SELF?showimage=$image_id'><img src='images/$image_name' alt='$image_title' title='$image_title' /></a>";
/// cmckibbin version
$today_images .= "<img_id='image' src='images/$image_name' alt='$image_title' title='$image_title' />"
Neither of these link correctly.
raminia
05-23-2005, 08:26 AM
I don't underestand the problem here... Does the code work or not?
faraari
06-13-2005, 02:32 PM
hello :)
thank you for the great addon.
is it possible to add something to the code so that the thumbnails only show up when there is more than one image posted on that day?
thanks again,
faraari.
faraari
07-24-2005, 09:19 AM
no body? :(
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.