|
#1
|
||||
|
||||
|
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! |
|
#2
|
|||
|
|||
|
yeah, and even better, the day of post could be evidenced ...
|
|
#3
|
||||
|
||||
|
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: |
|
#4
|
||||
|
||||
|
is this very hard to do...?
|
|
#5
|
|||
|
|||
|
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++;
}
|
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
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"); }
*/
|
|
#8
|
|||
|
|||
|
i forgot to say: in both sections - the normal and the horizontal function
|
|
#9
|
|||
|
|||
|
amalydia,
would you like to make an addon out of this? That would be really great! And welcome here! |
|
#10
|
|||
|
|||
|
schould i post my complete calendar.php as code?
|
| Post Reply |
| Thread Tools | |
|
|