PDA

View Full Version : Calendar issue


gustiferjones
11-20-2006, 08:22 AM
I am wondering how I can highlight the day of the month the viewer is looking at.

austriaka
11-20-2006, 03:40 PM
open calendar.php
look for these lines:
if($dayimage == "true") {
$class = "td-calendar-days-imagefound";
(in original file from 1.5 it is line 178 and 179)

replace with these lines:
if($dayimage == "true") {
$query = mysql_query("select datetime from ".$pixelpost_db_prefix."pixelpost where id = '".$_GET['showimage']."'");
while(list($imgdate) = mysql_fetch_row($query)) $thisimgdate = $imgdate;
if (substr($thisimgdate,0,10) == $curr_year."-".$thismonth."-".$day_count) {
$class = "td-calender-days-thisday";
}
else $class = "td-calendar-days-imagefound";
define ".td-calender-days-thisday" in your css and give it the look you like

gustiferjones
11-20-2006, 04:10 PM
thanks for the help.

Now that i have made that change, when I click my photo to go to the previous image it changes the calendar to January. The second image in my post was taken on Saturday, but for some reason sends me back to January. I am really not sure why, but it makes no sense to me. CSS and PHP aren't a strength of mine - or at all - so any help would be groovy!

thanks!

jdleung
11-20-2006, 04:15 PM
are you using the new version?
please post your link.

austriaka
11-20-2006, 04:31 PM
I am really not sure why, but it makes no sense to me.
It really doesn't make sense because my "hack" should not interfere with the "lining up" of the pictures. It justs asks in the Database for the date of the current image (wich is given via showimage in the link: "$_GET['showimage']"), and if it matches the day you are looking at ($curr_year."-".$thismonth."-".$day_count), the CSS-class is different. Order of the images is not changed.

Please check out, perhaps you replaced more than the two lines?
Does it work correctly without my hack?
What does the link say, when you mouseover the image you are looking at?

And: my hack was described for "normal" calender. If you use horizontal calendar, you can change the same two lines in line 240 + 241.
But not changing both (normal and horizontal) should not affect the calendar. It is just that my hack wouldn't work on the other calendar style.

gustiferjones
11-20-2006, 07:36 PM
I made the reflected changes in 240/240 (and reverted back to the original code in lines 178/179). Still an issue with clicking the image (to get the previous) and I get a January calendar.

I am using the newest version of Pixelpost 1.5. The link again, is; www.ariehsinger.com/Pixelpost

Thanks!

jdleung
11-21-2006, 01:49 AM
I mean the calendar version. and if you had hacked it, it's hard to tell you clear.

try the new version first.

gustiferjones
11-21-2006, 03:36 AM
I tested it on the clean version from the Pixelpost site, and the image dates go all wonky. I have also done Austraika's tip and it still gives me the previous image with January's calendar.

Any help is great! Thanks!

austriaka
11-21-2006, 07:18 AM
"wonky" means it does not work correct?
So my hack has nothing to do with the problem and it is the problem of the original pixelpost calendar?
Have you tried the improved calendar.php by jdleung? Calendar (http://www.pixelpost.org/v1/index.php?x=downloads&details=172)

austriaka
11-21-2006, 07:39 AM
ok, I had a look at your site. I guess it is the odd "month before october"-problem. It works well at your site as long as you are in July or August, it makes it "wonky" (?) when you are in October or November.

There is a bug in the original version of calender.php (which is 1.1.4, have a look at the top lines of calendar.php).
The line $curr_month = substr($img_datetime,6,1); which is line 83 in version 1.1.4 reads only the second number of the month char, which is ok when month char is 01 - 09. In the moment you go to October or November, the second number is "0" or "1". So you jump to January when you are in November and to nothing, when you are in October. (Tiny PHP tutorial for you)

jdleung has corrected this bug in his calendar version 1.1.5 (reading first both numbers of the month, then asking if the first number is "0" and only if it is, stripping it away to get a clear order of the months (1,2,3...11,12).

You should update your calendar.php with jdleungs version and afterwards make the changes with my hack.

Perhaps it woud make sense if the actual download version of PP 1.5 would be updated with the corrected calendar.php

KArin

gustiferjones
11-22-2006, 03:33 AM
Great! I have updated to the new version of the calendar. Is there a way, though, to get it to display the month as a word, and not a number?

Thanks!

jdleung
11-22-2006, 04:09 AM
just set "$use_lang_var = 1;" in calendar.php

gustiferjones
11-22-2006, 04:17 AM
this looks brilliant! Thanks a bunch eh!

How do i highlight the date that it is on - as in make the background of that date dark gray?

austriaka
11-22-2006, 06:19 AM
use my hack
in the updated version of calendar.php it is line 180 + 181 for "normal" calendar and line 242 + 243 for horizontal calendar

gustiferjones
11-22-2006, 03:21 PM
I have done this hack. Is there any way to make it dark gray instead of only white?

austriaka
11-23-2006, 06:09 AM
you have to define the class "td-calender-days-thisday" in the css file as I wrote in my very first post.

Try this:
.td-calender-days-thisday {
padding:1px;
text-align:center;
border:1px solid #999;
background:#666;
}
.td-calender-days-thisday a {
text-decoration:none;
color:#fff;
}

gustiferjones
11-25-2006, 05:11 AM
thanks for your help eh!