View previous topic :: View next topic |
Author |
Message |
ThraxD
Joined: 11 Mar 2003 Posts: 4
|
Posted: Tue Mar 11, 2003 3:44 pm Post subject: Help with B2Calendar_Plus |
|
|
I do understand that the b2calendar_plus is a hack, but my question would probably apply to the regular B2 calendar.
Ok so I have two questions.
1) How do I change the calendar so that the day of the week starts with a Sunday instead of a Monday?
2) I have my website setup with frames. I want to click on the post of a day of the week and it appear it a seperate frame. I can get it to do that so far. Problem is that if I click the back arrow to go to the previous month, the target frame will update with the posts from that new month, but the B2 calendar still says it is March, so the person cannot click on any posts for February because the calendar is still saying March.
Not sure if this will help anyone to help me with this, but my website URL is http://raydilly.com and the b2calendar is http://raydilly.com/b2/b2calendar.php
Any suggestions? |
|
Back to top |
|
 |
dtdgoomba
Joined: 05 Aug 2002 Posts: 179 Location: Cambridge, MA
|
Posted: Tue Mar 11, 2003 5:21 pm Post subject: |
|
|
for 1) that should be an option i your b2config file, it says something like Start of the week = 1 or something, just put 0 for sunday... |
|
Back to top |
|
 |
ThraxD
Joined: 11 Mar 2003 Posts: 4
|
Posted: Tue Mar 11, 2003 6:42 pm Post subject: |
|
|
dtdgoomba wrote: | for 1) that should be an option i your b2config file, it says something like Start of the week = 1 or something, just put 0 for sunday... |
Yup I found it and that part works great. Thank you
So can anyone think of what might I do to correct the calendar issue in regards to the frames though? |
|
Back to top |
|
 |
alex_t_king
Joined: 09 Oct 2002 Posts: 194
|
Posted: Tue Mar 11, 2003 11:49 pm Post subject: |
|
|
Well, basically you need to tell the calendar frame that it needs to reload and show a different month.
Easiest (hacky) way I can think of to do it would be with JavaScript so you can location.href both frames... but you'll still have weird circumstances where the calendar is out of sync with the main viewing area. I think a better solution would be to have javascript called onload in the main viewing area that does a calendarFrame.location.href="b2calendar.php?m=<? echo $m; ?>";
This way, the calendar frame is always updated to the month that is shown in the main viewing area.
When you do this, you may also need to add some of the code from blog.header.php, etc as I think some of the variable initialization is done there... you'll need to track down what is needed.
For the record, I'd remove the frames... _________________ Yahoo! Messenger ID: alex_t_king |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Tue Mar 11, 2003 11:52 pm Post subject: |
|
|
Richard,
It should be do-able!
You will need to effectively change two frames at once. You can only do that in JavaScript.
Instead of your 'arrow' link being
Code: |
<a href="http://www.raydilly.com/b2/index.php?m=200302" style="text-decoration: none;" target="mainwindow">
|
It needs to be something like
Code: |
<a href="javascript: document.calendar.location='http://www.raydilly.com/b2/b2calendar.php?m=200302'; document.mainwindow.location='http://www.raydilly.com/b2/index.php?m=200302';"
style="text-decoration: none;">
|
I'm not sure off the top of my head the correct syntax to refenence each frame like that. It may be "window.framename".
Something along those lines should work.
Hope this helps,
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
alex_t_king
Joined: 09 Oct 2002 Posts: 194
|
Posted: Wed Mar 12, 2003 12:04 am Post subject: |
|
|
Mike, I tried adding the m=200302 to the calendar page directly and it didn't change the month... _________________ Yahoo! Messenger ID: alex_t_king |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Wed Mar 12, 2003 12:30 am Post subject: |
|
|
You are right Alex.
You need to add in the following code (I put it round about line 51 /*stop editing...)
Code: |
$b2varstoreset = array('calendar','m');
for ($i=0; $i<count($b2varstoreset); $i += 1) {
$b2var = $b2varstoreset[$i];
if (!isset($$b2var)) {
if (empty($HTTP_POST_VARS["$b2var"])) {
if (empty($HTTP_GET_VARS["$b2var"])) {
$$b2var = '';
} else {
$$b2var = $HTTP_GET_VARS["$b2var"];
}
} else {
$$b2var = $HTTP_POST_VARS["$b2var"];
}
}
}
|
The calendar code will make use of a variable 'calendar' if it is set or fall back to 'm' or fall back to 'now' if neither are set. Without the above code, neither are set when the file is used standalone.
That should fix it.
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
ThraxD
Joined: 11 Mar 2003 Posts: 4
|
Posted: Wed Mar 12, 2003 12:46 am Post subject: |
|
|
Ok I think I'm a relatively intelligent guy, but you two have totally lost me
What files should editing here? B2calendar.php, b2config.php, index.php, my index.html, etc etc?
Also that arrow that is linking to the month seems to be generated by the b2calendar.php file, so I don't think I can change it directly. Poop!
Sorry to bug you guys about this stuff. Thanks for the assistance!
Oh and Alex King, I'd get rid of the frames and use tables or something, but how do I call an external file (like b2calendar.php) into an html file that would have tables? |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Wed Mar 12, 2003 1:18 am Post subject: |
|
|
Richard,
Sorry for the confusion.
In both cases you will need to change the file b2calendar itself.
(the code from) My second message needs to be inserted where I described in b2calendar.php.
My first message about changing the links needs to go in b2calendar.phph somewhere around line 114 (after the above) where $ak_previous_month_active and $ak_next_month_active are defined.
You will need to change that code to setup the javascript I described.
Hope this clarifies things,
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
alex_t_king
Joined: 09 Oct 2002 Posts: 194
|
Posted: Wed Mar 12, 2003 2:46 am Post subject: |
|
|
just make the page a PHP page and use include(thisfile.php) or require(thisfile.php) _________________ Yahoo! Messenger ID: alex_t_king |
|
Back to top |
|
 |
ThraxD
Joined: 11 Mar 2003 Posts: 4
|
Posted: Wed Mar 12, 2003 2:48 pm Post subject: |
|
|
I tried doing it without frames, but when I click on the link in the calendar, it opens up the post for that date but it's the whole page (without the calendar and sidebar etc etc.
Maybe I'll just go without the calendar until I have a better understanding of PHP. Thanks though!  |
|
Back to top |
|
 |
annaweb
Joined: 03 May 2003 Posts: 3
|
Posted: Sat May 03, 2003 4:57 am Post subject: |
|
|
Hi, I have exactly the same problem with a nonupdating calendar in a separate frame, and so on....
I was about to try this:
mikelittle wrote: | Richard,
Instead of your 'arrow' link being
Code: |
<a href="http://www.raydilly.com/b2/index.php?m=200302" style="text-decoration: none;" target="mainwindow">
|
It needs to be something like
Code: |
<a href="javascript: document.calendar.location='http://www.raydilly.com/b2/b2calendar.php?m=200302'; document.mainwindow.location='http://www.raydilly.com/b2/index.php?m=200302';"
style="text-decoration: none;">
|
|
But I don't know how to do this when the only code I can find in b2calendar.php with <a href...> looks like this...
Code: | $ak_previous_month_active = '<a href="'.$archive_link_m.$ak_previous_year.zeroise($ak_previous_month,2).'"><img src="ak-img/arrow_left.gif" align="absbottom" border="0" alt="previous month" /></a> ';
$ak_next_month_dim = ' <img src="ak-img/arrow_right_dim.gif" align="absbottom" alt="no posts after this month"/>';
$ak_next_month_active = ' <a href="'.$archive_link_m.$ak_next_year.zeroise($ak_next_month,2).'"<img src="ak-img/arrow_right.gif" align="absbottom" alt="next month" border="0" /></a>'; |
Can someone help me out here?
Is it maybe possible to make the script skip the change to an earlier post, and just change the calendar when one clicks "prev. arrow"??? I don't really care if the post change, as long as the the calendar "jumps back" to previous month....
//anna |
|
Back to top |
|
 |
|