View Full Version : Counting calendar?
kicki
08-27-2005, 03:12 PM
I would really like my calendar to show if there is more than one photo/day (I had different colours in my previous blog, blue for one photo, yellow for two and red for more than two). As far as I understand, all the calendar does today is check if there is posts or not on a certain day (true/false), I would need some sort of counting.... anyone have any tips?
Yeap it can be done quite simple. There must be only small modyfication of SQL statement and 1-2 lines more of code.
Putting it:
$numb_of_imgs = mysql_num_rows($query);
after lines:
$query = mysql_query("select * from ".$pixelpost_db_prefix."pixelpost where (datetime like '$image_search%') and (datetime<='$cdate')");
will give you a number of photos for each day.
PS Dev Team:
While after this SQL statement is not necessary!
It will be enough:
if($numb_of_imgs > 0){
$dayimage = "true";
$curr_image_id = $img_id;
}
instead of:
while(list($img_id, $img_datetime, $img_headline, $img_body, $img_image) = mysql_fetch_row($query)) {...
kicki
08-28-2005, 05:08 PM
I figured as much, but how? (Well, I could probably figure it out myself, but SHOULD use my time for studies instead... =) )
Check update of my previous post.
Adding conditional statements you can change colors of any cell of table which do you like.
raminia
08-28-2005, 06:05 PM
study hard;)
I like to do that too.
kicki
08-22-2007, 09:06 PM
Well, it only took me 2 years to find the time and energy to actually DO this mod!! :-D But I'm quite satisfied with it!
http://kicki.kanske.net/index.php?curr_month=5&curr_year=2007&showimage=1249
Blue = 1 pic
Yellow = 2pics
Red = more than 2pics
Green = 1 pic / hour (a Swedish photo project - members get two dates/month when they should take one photo every hour and post in their blog)
I was a bit lazy and defined all days with more than 9pics as 1pic/hour, since I never DO post that amount of pics if it's not one of those days... :)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.