Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 04-26-2005, 01:56 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
calendar addon: months changing...

a feature that would be very nice and useful:

the calendar months changing according to the month of the image that is displayed.

visitors are missing something, when they browse the images while the calendar always shows just the current month.

i think, an update of the calendar addon would be great for everyone!
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #2  
Old 04-26-2005, 03:31 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
yeah, and even better, the day of post could be evidenced ...
Reply With Quote
  #3  
Old 04-26-2005, 03:40 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
oh yeah!!

this would be a fantastic update of the calendar addon!
but WHO would be kind enough, skilled enough, willing enough, and has a big heart for us, ever demanding people, to do that???

:wink: :wink: :wink:
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #4  
Old 05-03-2005, 10:53 AM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
is this very hard to do...?
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #5  
Old 05-26-2005, 03:04 PM
amalydia Offline
pp regular
 
Join Date: May 2005
Location: Bernburg, Germany
Posts: 21
Send a message via ICQ to amalydia
i've edited my index.php to get month and year from sql and add the curr_month and curr_year vars to the link.. works very fine right now... hope so

sorry for my bad english... i'll try my best

Code:
if(function_exists(gd_info)) {
    $gd_info = gd_info();
    if($gd_info != "") { // check that gd is here before this
        $aheadnumb = sql_array("select count(*) as count from ".$pixelpost_db_prefix."pixelpost where (datetime > '$image_datetime') and (datetime<='$cdate')");
        $aheadnumb = $aheadnumb['count'];
        $behindnumb = sql_array("select count(*) as count from ".$pixelpost_db_prefix."pixelpost where (datetime < '$image_datetime') and (datetime<='$cdate')");
        $behindnumb = $behindnumb['count'];
        $aheadlimit = round(($cfgrow['thumbnumber']-1)/2);
        $behindlimit = round(($cfgrow['thumbnumber']-1)/2);
        if($aheadnumb <= $aheadlimit) {
            $behindlimit = ($cfgrow['thumbnumber']-1)-$aheadnumb;
            $aheadlimit = $aheadnumb;
            }
        if($behindnumb <= $behindlimit) {
            $aheadlimit = ($cfgrow['thumbnumber']-1)-$behindnumb;
            $behindlimit = $behindnumb;
            }
        $totalthumbcounter = 1;
        $ahead_thumbs = "";
        $ahead_thumbs_reverse  ="";
        $thumbs_ahead = mysql_query("select id,headline,image,datetime from ".$pixelpost_db_prefix."pixelpost where (datetime > '$image_datetime') and (datetime<='$cdate') order by datetime asc limit 0,$aheadlimit");
        while(list($id,$headline,$image,$datetime) = mysql_fetch_row($thumbs_ahead)) {
        $thumbs_datetime     = $row['datetime'];
		$thumbs_date_year_full   = substr($row['datetime'],0,4);
		//$image_date_year   = substr($row['datetime'],2,2);
		$thumbs_date_month = substr($row['datetime'],5,2);
		if ($thumbs_date_month != '10') {$thumbs_date_month = str_replace('0','',$thumbs_date_month);}
        $headline = pullout($headline);
		$headline = htmlspecialchars($headline,ENT_QUOTES);
	list($local_width,$local_height,$type,$attr) = getimagesize("thumbnails/thumb_$image_name");
            $ahead_thumbs .= "<a href='$showprefix$id&curr_month=$thumbs_date_month&curr_year=$thumbs_date_year_full'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>";
            $ahead_thumbs_reverse = "<a href='$showprefix$id&curr_month=$thumbs_date_month&curr_year=$thumbs_date_year_full'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>" .$ahead_thumbs_reverse ;
            $totalthumbcounter++;
            }
        $behind_thumbs = "";
        $behind_thumbs_reverse ="";
        $thumbs_behind = mysql_query("select id,headline,image,datetime from ".$pixelpost_db_prefix."pixelpost where (datetime < '$image_datetime') and (datetime<='$cdate') order by datetime desc limit 0,$behindlimit");
        while(list($id,$headline,$image,$datetime) = mysql_fetch_row($thumbs_behind)) {
        	$thumbs_datetime     = $row['datetime'];
			$thumbs_date_year_full   = substr($row['datetime'],0,4);
			//$image_date_year   = substr($row['datetime'],2,2);
			$thumbs_date_month = substr($row['datetime'],5,2);
			if ($thumbs_date_month != '10') {$thumbs_date_month = str_replace('0','',$thumbs_date_month);}
            $headline = pullout($headline);
			$headline = htmlspecialchars($headline,ENT_QUOTES);
        	list($local_width,$local_height,$type,$attr) = getimagesize("thumbnails/thumb_$image_name");
            $behind_thumbs = "<a href='$showprefix$id&curr_month=$thumbs_date_month&curr_year=$thumbs_date_year_full'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>$behind_thumbs";
            $behind_thumbs_reverse .= "<a href='$showprefix$id&curr_month=$thumbs_date_month&curr_year=$thumbs_date_year_full'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>";
            $totalthumbcounter++;
            }
Reply With Quote
  #6  
Old 05-26-2005, 03:11 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
very interesting,
thank you, amalydia!

but for me, there's still a function missing:
when browsing the images, the calendar still doesn't change the month according to the date of the image that is currently displayed.

the best would be a modification or a new version of the calendar addon, keeping the index.php untouched.
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #7  
Old 05-26-2005, 07:11 PM
amalydia Offline
pp regular
 
Join Date: May 2005
Location: Bernburg, Germany
Posts: 21
Send a message via ICQ to amalydia
ok you are right.. leave the index.php clean and make some changes at the calendar.php in addons..

replace the outquoted source by this:

Code:
if (!$curr_year) {
$img_dates = mysql_query("select datetime from ".$pixelpost_db_prefix."pixelpost where (id = '$image_id')");
        while(list($datetime) = mysql_fetch_row($img_dates)) {
      // $hmpf = mysql_fetch_row($img_dates);
		$curr_year   = substr($row['datetime'],0,4);
		$curr_month = substr($row['datetime'],5,2);
		if ($curr_month != '10') {$curr_month = str_replace('0','',$curr_month);}
		}
}
/*
$curr_month = $_GET['curr_month'];
$curr_year = $_GET['curr_year'];
if(!$curr_year) { $curr_year = date("Y"); }
if(!$curr_month) { $curr_month = date("n"); }
if(!$curr_day) { $curr_day = date("j"); }
*/
Reply With Quote
  #8  
Old 05-26-2005, 07:12 PM
amalydia Offline
pp regular
 
Join Date: May 2005
Location: Bernburg, Germany
Posts: 21
Send a message via ICQ to amalydia
i forgot to say: in both sections - the normal and the horizontal function
Reply With Quote
  #9  
Old 05-26-2005, 07:16 PM
Connie
Guest
 
Posts: n/a
amalydia,

would you like to make an addon out of this?
That would be really great!

And welcome here!
Reply With Quote
  #10  
Old 05-26-2005, 07:19 PM
amalydia Offline
pp regular
 
Join Date: May 2005
Location: Bernburg, Germany
Posts: 21
Send a message via ICQ to amalydia
schould i post my complete calendar.php as code?
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 11:25 AM.

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