Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Show Events by Week - FIX
kjackson
Junior Member

Posts: 6
Registered: 6/18/2007
Member Is Offline
posted on 6/18/2007 at 08:33 PM Reply With Quote
Show Events by Week - FIX


While configuring everything in the Control Panel and testing everything out I realized that when looking at the events in the Week that it would display a week ahead and also display the events one day ahead (i.e. if I put an event on the 4/11/07, then it would display the event on 4/12/07).

This is how I fixed it.

Open calendar.php and scroll way down to the function show_week.

on the "$cw=" line, go to the end of it and it will be adding one ( +1). Delete the addition!

i.e.

old line:
$cw = date('W',mktime(0, 0, 0, $this->a_selected_date['m'], $this->a_selected_date['d'], $this->a_selected_date['y']))+1;

new line:
$cw = date('W',mktime(0, 0, 0, $this->a_selected_date['m'], $this->a_selected_date['d'], $this->a_selected_date['y']));

Now on the line that says "$cd=" delete the increment in it

i.e.

old line:
$cd = ($cw-1)*7 - $dwf + 1 + !$this->a_template['is_american'];

new line:
$cd = ($cw-1)*7 - $dwf + !$this->a_template['is_american'];

Those two changes fix the wrong week problem and it should now display the correct week.

There is now one last small change to make the events fall under the correct date.

Go a couple of lines down and you will find a line that looks like the following:

$c=0;

Change the 0 to a -1

$c=-1;


I am not sure if anyone else has had any problems like this, but I thought it might be a good idea to document just in case. If anyone has a better fix than this please let me know (I have no idea if I broke anything else doing this... I dont think i did, but who knows)!
View User's Profile View All Posts By User U2U Member
Ethan
Junior Member

Posts: 2
Registered: 3/17/2009
Member Is Offline
posted on 3/17/2009 at 05:58 AM Reply With Quote

Kjackson, thanks for that working solution!
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free/Trial Script Download Free Download
Product Documentation Documentation
Documentation page
Change Log
Support Forum Support Forum
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004