Page 1 of 1

Fix for prev and next month links and error 404

Posted: Tue Jan 29, 2013 3:37 pm
by jduck777
I had issues with the prev and next month links not working unless I kept the default WordPress permalinks. Here is a work around for that:

Place the following code just after all of the top commented section (just before "// Enable internationalisation").

Code: Select all

$actual_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 
 $get_query = parse_url($actual_url);
 $split_query = parse_str($get_query['query'], $cal_query);
 
  
 $_GET['month'] = $cal_query['month'];
 $_GET['yr'] = $cal_query['yr'];

Re: Fix for prev and next month links and error 404

Posted: Tue Jan 29, 2013 5:04 pm
by jduck777
Had to adjust the script a little because the select box would show the wrong year by default.

Code: Select all

 $actual_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 
 $get_query = parse_url($actual_url);
 $split_query = parse_str($get_query['query'], $cal_query);
 
 if(strlen($cal_query['yr']) < 4) {
 $cal_query['yr'] == strtolower(date("Y", ctwo()));
 }
 
 $_GET['month'] = $cal_query['month'];
 $_GET['yr'] = $cal_query['yr'];

Re: Fix for prev and next month links and error 404

Posted: Sun Mar 29, 2015 6:55 pm
by shrikantshenoy
:D This works! Please take a look at http://www.mahalasa.org/panchang/. Thanks Kieran for a great calendar!

Re: Fix for prev and next month links and error 404

Posted: Fri Jun 05, 2015 8:57 am
by ffxivfans
Thank you for sharing

buy ffxiv gil