Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > General Support

General Support Questions about using the Easy PHP Calendar. (Not installation or customizations)

Closed Thread
 
Thread Tools Search this Thread Display Modes

current and next month only
Old 09-20-2006, 11:53 AM   #1
hotwired
Calendar User
 
hotwired is offline
Join Date: Apr 2004
Posts: 19
Default current and next month only

Is there a way to have available this month and next month only in "text on calendar mode"? My client doesn't want anyone seeing last months and doesn't want competition to know what's up too much in the future. Any thoughts?
 

Old 09-20-2006, 02:27 PM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,887
Default

This can be done by checking and setting the $mo and $yr variables in PHP. If you can program PHP, you should be able to do this. If you need help, just let me know and I'll come up with some code for you.
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 09-20-2006, 03:17 PM   #3
hotwired
Calendar User
 
hotwired is offline
Join Date: Apr 2004
Posts: 19
Default

Please! I would love some code. I don't really know how to program php, strictly an html and css guy, but I'm fairly intuitive, so you won't need to work very hard! Is this editing direcly to the script (calendar) itself? I have tried to open some of the deeper files but they seem to be encoded with Zend, and "protected" so to speak.
 

Old 09-20-2006, 04:12 PM   #4
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,887
Default

Try something like this (add it just before the require statement that displays the calendar):

PHP Code:
 <?php
// DETERMINE CURRENT MONTH AND YEAR
$cDate date("m").date("Y");
$tDate trim($_REQUEST['mo'].$_REQUEST['yr']);

if (
$tDate!="") {

if ((
$tDate-$cDate)<0) {
    
$mo date("m");
    
$yr date("Y");
    }
  
  if ((
$tDate-$cDate)>10000) {
    
$mo date("m")+1;
    
$yr date("Y");
    }
  
  }
?>
If needed, you can change the number of months you can advance by editing the checks above.
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

almost
Old 09-20-2006, 05:06 PM   #5
hotwired
Calendar User
 
hotwired is offline
Join Date: Apr 2004
Posts: 19
Default almost

Thanks!! Now I had to re enable navigation ot make it work./ The only thing that is happening now is that the navigation is "normal", i.e. the drop down lets you select 2007, 2008, and the month drop down lets you select any month but your code simply prevents it from "happening" if they select anything other than this or next month. My solution would be to find the code that makes the navigation possible, and edit it somehow. Or simply find the code that makes "next" month possible, something like that. I bet it's in one of the danged encrypted files though, ya think? I am happy to send you some $$$ if you want to nail it though!!
 

Old 12-12-2006, 05:18 PM   #6
hotwired
Calendar User
 
hotwired is offline
Join Date: Apr 2004
Posts: 19
Default

Hi
I'm hitting a snag with the code you gave me above in that now that we've hit december, "next month" which is january wont' show ... is this maybe because it's a new year?? (see your code above) - to refresh, this limits the << >> navigation from scrolling backwards at all, and limits scrolling to ONLy the next month and no more. I'm happy to hire you to iron this out if you'd like??? Thanks!!
 

Old 12-12-2006, 08:06 PM   #7
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Untested

PHP Code:
<?php
// DETERMINE CURRENT MONTH AND YEAR
$cDate date("m").date("Y");
$tDate trim($_REQUEST['mo'].$_REQUEST['yr']);

if (
$tDate!="") {

    if ((
$tDate-$cDate)<0) {
        
$mo date("m");
        
$yr date("Y");
    }
  
    if ((
$tDate-$cDate)>10000) {
        
$mo date("m")+1;
        
$yr date("Y");
        if (
$mo 12) {
            
$mo 1;
            
$yr $yr 1;
        }
    }
}
?>
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 12-13-2006, 05:32 AM   #8
hotwired
Calendar User
 
hotwired is offline
Join Date: Apr 2004
Posts: 19
Default

Thanks for that. It did not work unfortunately. Again, if you would like to get paid for your time I don't mind hiring you to get it nailed. I can send details if needed. One other little but I didn't notice is that this code AND the previous code, although disallowing looking at last month or more than one month ahead, DOES allow going exactly to the current month in ANY future year, i.e. if you're in December, you can view december in 2007, 2008, etc. etc.
 

Old 12-14-2006, 06:13 AM   #9
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

I will try to take a deeper look at this this afternoon. I had only quickly skimmed the previous posts and kinda jumped to a conclusion. After reading more attentively, I don't think that my "fix" would've worked at all.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 12-14-2006, 07:39 AM   #10
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Ok, I got to it earlier than I thought. Try this out.

PHP Code:
// DETERMINE CURRENT MONTH AND YEAR
$cDate date("Y").sprintf("%02u",date("m"));
$tDate trim($_REQUEST['yr'].sprintf("%02u",$_REQUEST['mo']));

if (
$tDate!="") {

    if ((
$tDate-$cDate)<0) {
        
$mo date("m");
        
$yr date("Y");
    }
  
    if ((
$tDate-$cDate)>1) {
        
$mo date("m")+1;
        
$yr date("Y");
        if (
$mo 12) {
            
$mo 1;
            
$yr $yr 1;
        }
    }

It now lets you go to January of next year, and also stops you from being able to see one (or more) year in the future.

Let me know if you run into any more problems.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -4. The time now is 05:33 PM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |