One of the features I see lacking in WordPress 1.5 “Strayhorn” definitely is a calendar for navigating.
I’m sure development versions would have include a calendar already. But since I’m using the “stable” release, its time for me to try out some hacks. When I created my own blog engine last year, this was one of the feature. The are countless of js or php calendars out there, so this surely would have been thought before, and others would have done a better job for WP.
Do some simple searching at first. So there infact is support for calendar. Just place this code < ?php get_calendar(); ?> in the (sidebar) template.
A search on the net leads me to find a xmlhttprequest calendar, a cool plugin which uses javascript, xmlhttprequest and xml-rpc (ajax), sort of stuff Google seems to like as seen in Gmail (like email autocompleting), and Google Suggest.
Sidetracked, something cranky on Google Sg servers that I see messages like
Network Error (dns_unresolved_hostname)Your requested host “www.google.com” could not be resolved by DNS.
For assistance, contact your network support team.
And I found a more update site (and neater looking) that uses this AJAX calendar called LiveCalendar. So I’ve decided to use this. Try it for yourself, you would be able to look at the calendar without refreshing the entire page. RPC calls to XML feeds (sort of like a webservice) integrated WordPress would show any blog posted on the date of the calendar.
Pretty cool technology right?
Sad it doesnt allows me to go forward in time, and no marking for the current date. If you want to install it without doing the manual plugin way, try WP Plugin-Manager for one-click install. Not bad after all.
And this page shows how to customise colours example on weekends using css mainly.
Try clicking back and forth the months on the calendar now on the right column.
Glad that you like LiveCalendar!
If you want to go forward in time, you can edit the mechanism that generates the link. It’ll generate the calendar in the future just fine but there won’t be any posts made available.
Other calendar plugins such as EventCalendar2 might help you out if that’s a crucial feature for you though.
And the current date is marked with a class called “Today” but in your css that means that it gets a white background, maybe changing that would help you out.
Thanks for the clarification
Wow, I didnt know my post in WP would notify you automatically (trace/postback?)
I figured I would need to use CSS to highlight’s Today date, and I couldnt think of what to use, so I used a white background first. And like you say, more customisation like greying out future dates, or colouring could get help from Eventcalendar2 or a little change in php codes.
Thanks for your LiveCalendar!
Dear Jon, we have a problem. Live calendar doesnt work if I try to access it using another domain. Eg.
http://www.lab4games.net/zz85/blog/ works but http://lab4games.net/zz85/blog/ doesnt.
http://ganunu.info/blog/ works but
http://www.ganunu.info/blog/ doesnt.
The javascript error?
Error: [Exception... "'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent]” nsresult: “0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “” data: no]
Yea, funny how the interweb works these days huh!
The error comes because the plugin asks WordPress what the address of the blog is in order to set the address to call the rest of the supporting javascript. As a testament to my lack of coding prowless and knowhow to reroute javascript/cross-site errors, the code I wrote is not all that robust and so if you have “www” in your siteurl but then access the site without using it, the plugin breaks.
Its a known issue though.
I do think this is a security issue rather than a technical issue. IMHO, Browsers would not allow the script to request offsite to prevent malious use.
Try,
http://google.com/webhp?complete=1&hl=en and it will redirect you to
http://www.google.com/webhp?complete=1&hl=en.
Try,
http://www.maps.google.com and it will redirect you to maps.google.com
Try differents domains to login to gmail and you still end up in http://gmail.google.com/
This means, they are only limiting their scripts to point to a particular domain.
2 suggestions I have.
1) If domain is not correct, (maybe javascript can detect), redirect to main page.
2) Instead of linking the js file to the url defined in the settings, link it reletively, as in src=”../wp-content/…” something like that. That however would cause issues with paralinking, which in turn could perhaps have a workaround in the .htaccess file or the php files.
I would think method 1 is easier to be done. Method 2 if done would show solutions to other problems like linking uploaded files. Maybe you could find help in WordPress Support Forums.
You’re right that it’s a security issue. Browsers rightly refuse to allow XMLHTTPRequest calls to domains other than the one the script was loaded from. If not, then you could have ad servers tracking every key press you make (etc).
The mechanism which notifies an author that you have linked to their article is called Trackback. It’s pretty useful.
Jon has done a great job making my code usable by the public. I generally write a piece of code, then lose interest and go onto the next challenge.
Pingback: kepo-ing Zz85 » Blog Archive » Easy workaround/fix for an AJAX problem