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

Jump Menu
Old 05-14-2004, 08:49 AM   #1
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Lightbulb Jump Menu

I want to have a calendar on every page of part of my site. I want a drop down menu listing months / years as you have on the demo calendar. Can someone tell me what code I need on the drop down to move the calendar to the required month/year and refresh the page? Thanks.
 

Old 05-14-2004, 09:08 AM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Try this code where you want the jump menu to appear...


PHP Code:
        <?php
if (!isset($mo)) $mo date("m",time() - date('Z') + ($gmt 3600));
if (!isset(
$yr)) $yr date("Y",time() - date('Z') + ($gmt 3600));
    
?>
     <form name="form3" method="post" action="<?php echo $PHP_SELF ?>">
        <select name="mo" id="mo">
         <?php
for ($N=1$N<=12$N++) {
    echo 
"<option value='$N'";
    if (
$N==$mo) echo " SELECTED";
    echo 
">$mth[$N]</option>";
    }
    
?>
        </select>
        <select name="yr" id="yr">
         <?php
for ($N=2000$N<=2036$N++) {
    echo 
"<option";
    if (
$N==$yr) echo " SELECTED";
    echo 
">$N</option>";
    }
    
?>
        </select>
        <input type="submit" name="Submit" value="Go">
     </form>
__________________
-- Brian

Questions?

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

Old 05-14-2004, 09:23 AM   #3
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Default

Thanks Brian - Years work - months don't show up on the drop down but if you randomly click the menu the month does change - any idea why the month names are not showing properly?? Thaks again for the speedy response!
 

Old 05-14-2004, 09:43 AM   #4
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Can you provide a link to your page?
__________________
-- Brian

Questions?

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

Old 05-14-2004, 09:58 AM   #5
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Default

http://www.emevents.co.uk/events/ch.php


only a test page at the moment.
 

Old 05-14-2004, 01:01 PM   #6
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Default

Brian,


I have 'almost' got this going though not in as elegant a fashion as you could! The drop down works but the 'month' in the drop down always shows 'may' - presumably the current month - rather than moving on to thje month shown in the calendar. Still be grateful if yu could take a look at the page and let me know your thoughts. many thanks.

www.emevents.co.uk/events/ch.php
 

Old 05-14-2004, 03:17 PM   #7
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

The problem with the first thing is that "$mth[$N]" is not declared by the time you use it. So it doesn't display the month's names. And the same thing is true for your problem with the fact the month's name isn't selected for the month displayed. Since it's relying on $mo to verify if the $N is up to the $mo, but at the begining it says "if (!isset($mo)) $mo = date("m",time()..." which always resets $mo to the current month if it's not set previously.

So here, I'm guessing that your globals are off.... you're probably going to have to do a request so that your variables are initialized.

a la: $mo = $_REQUEST['mo'];

try to add that line just before the code that Brian gave you and see if the month sticks to the right spot on the select box.

(sorry for the very jumbled post... i'm not making much sense, hope you can decipher )
 

Old 05-15-2004, 02:49 PM   #8
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Default

Briam,


any comment after seeing the page? www.emevents.co.uk/events/test.php
with help from the forum I have got it vloser but the year keeps defaulting to 2004 instead of 'year'. Any thoughts - this is a commercial client - I have to get this working.
It obviously can be done becaue it works properly on your demo - so where am I going wrong? Thanks.
 

Old 05-15-2004, 04:43 PM   #9
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Please PM me the full code to that page and I'll take a look...
__________________
-- Brian

Questions?

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

My $0.02
Old 05-16-2004, 01:00 PM   #10
tomB
Calendar User
 
tomB's Avatar
 
tomB is offline
Join Date: Oct 2003
Location: Santa Rosa, CA
Posts: 68
Send a message via AIM to tomB Send a message via MSN to tomB Send a message via Yahoo to tomB
Default My $0.02

ve9gra is correct in that the $mo is getting reset. The $mo needs to be set to the value returned (posted) by the form.

If you can send me the full code for the test.php file and the form, I'll see what I can do to fix it.

Cheers,

tomB
 

Old 05-17-2004, 06:52 PM   #11
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Even if you don't use overLIB, add the code for it to your page(s) from the instructions and see if that helps with the drop-down script from the top of this thread.
__________________
-- Brian

Questions?

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

it works!
Old 05-18-2004, 05:18 AM   #12
andrew
Calendar User
 
andrew is offline
Join Date: May 2004
Posts: 6
Smile it works!

It works! Many thanks Brian - and to everyone who offered help and advice.

regards,

Andrew
 

Old 05-18-2004, 09:43 AM   #13
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Fantastic !

After reviewing the code from your page I saw that it did not include the overLIB code. The variables you need for the drop-down are initialized when the overLIB code is run.
__________________
-- Brian

Questions?

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

Having similar Probelm
Old 02-23-2005, 02:47 PM   #14
ashaman01
Calendar User
 
ashaman01 is offline
Join Date: Feb 2005
Posts: 2
Exclamation Having similar Probelm

I am having the same problem andrew had, i have the overlib code at the top of my page, and i have tried what ve9gra said to do as well and neither seem to be working... I am running an older version, 4.4

http://clubs.cob.rit.edu/misst/index.php

that is the page I am trying to get it to work with.

any help would be greatly appreciated

Thanks
 

Old 02-24-2005, 06:36 AM   #15
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Ok, you're on the right track... but you're following instructions for a later version...

The overLib section that was talked about here, is the automated version... the PHP code looks like this
PHP Code:
<?php $OL=1; require ("calendar/showCalendar.php"); ?>
Since you're using an older version, you have two options...

1- Move your drop-downs below the calendar - which will be processed after the calendar is hence having the mth[] array initialized with the proper month's names...

2- You can replace the $mth[$N] by gmdate("F", mktime(0,0,0,$N))

Or you could also create yourself an array that's the same as mth[] or you could include escalConfig.php before the drop-downs, but those are not-so-clean ways of doing it...

Good luck
 

Thanks!
Old 02-24-2005, 01:57 PM   #16
ashaman01
Calendar User
 
ashaman01 is offline
Join Date: Feb 2005
Posts: 2
Thumbs up Thanks!

That worked, thank you very much
 
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clarification on Category Filter Menu Options coppercup General Support 3 10-25-2006 06:02 PM
Drop Down Menu and List Boxes Tex General Support 4 11-28-2005 09:45 PM
Jump Menu Mark MT General Support 14 05-02-2005 12:22 PM
No Setup and Configuration Management menu (newbie) Steve General Support 2 08-10-2004 03:37 AM
Jump menu Amhen General Support 2 02-11-2004 07:12 PM



All times are GMT -4. The time now is 06:09 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 |