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


Go Back   Easy PHP Calendar > General Discussion > Customizations (Themes / Templates)

Customizations (Themes / Templates) Help with customizing the themes and templates. Post your own custom themes for others to enjoy.

Closed Thread
 
Thread Tools Search this Thread Display Modes

Demo.php vs Index.php
Old 11-22-2005, 06:11 PM   #1
KathrynBassett
Calendar User
 
KathrynBassett is offline
Join Date: Nov 2005
Posts: 34
Default Demo.php vs Index.php

In another thread http://www.easyphpcalendar.com/forum...2198#post12198 I asked about the demo.php file. I was told that "if you'd check through the code in index.php, you'll see that all it does is check to make sure that this isn't the first time the calendar is used (a new setup) and that everything is running ok. Then it checks what you've chosen in the Setup Manager to see if you've disabled the display of demo.php. If you haven't then it includes demo.php and that's what it displays. You're not using demo.php directly, but you'll see that if you modify demo.php in any way, you'll see those changes by going to /calendar/"

I'm thoroughly confused about this. If I choose http://lacdcs.moonlink.net/calendar/demo.php it comes up the way I want. And if I choose http://lacdcs.moonlink.net/calendar/index.php it also looks right. However, if, in the setup manager, I choose to "Disable Demo: This will prevent users from viewing the index.php file in the main calendar directory." then go to http://lacdcs.moonlink.net/calendar/ without the specific php file, I see nothing. (It's enabled at present as it needs to be seen.

So, if the demo.php is disabled, then what is the purpose of index.php? Am I supposed to be making changes in index.php INSTEAD of demo.php? What happens if I do a copy of the contents of demo.php to replace the content of index.php. What is the purpose of being enabled vs disabled?

I'm sorry, but since php coding is brand new to me (I'm conversant with html coding), I'm finding the instructions at http://docs.easyphpcalendar.com/ to be not very user friendly for beginners. Has anyone written a step-by-step tutorial? Not for the initial installation which is fine, but for how to set up for other than the default, and to integrate a header, etc.

I'd also love to see a few links in this thread with examples of other people's customizations.
 

Old 11-22-2005, 09:13 PM   #2
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,968
Default

Ok, since you're not new to HTML, you should understand that if you go to a directory instead of a specific file, your web server is going to try to feed you one of the index files (index.htm, .html, .php, etc...). That's why there's the index.php file there.

On the first time you run the calendar (after you've completed the upload procedure), the index.php file will detect that it has not been configured and suggest you run the Setup Manager to do so. After the calendar is initially configured, all the index.php file does is redirect you to the demo.php file which is there as an example to display some of the capabilities of the calendar and to give you an example of how to integrate the calendar script into exsting web pages.

If there was no index.php file, depending on your webserver installation, your server might display a file listing or a 404 error... and neither is desirable.

On the other hand, you might not want users to be able to go to /calendar/ and view the calendar. That's why the option is in the Setup Manager to disable the loading of demo.php from index.php. So that if a user goes to /calendar/ all they get is a blank page (not a 404 or a directory listing). It's "prettier" and might be considered a security feature.

Now, if you link directly to demo.php, even if it's disabled in the Setup Manager, it will still display. But since the demo.php file is more of a demonstration of what the calendar can do, and an example of what a properly formated file looks like, demo.php can be deleted after you're satisfied with the way you've integrated the calendar (as long as you're not using it of course).

For integrating it inside some of your own pages (like you're saying "integrate a header") make sure you read the Getting Started Guide and also check out the "Integration" section of the Online Documentation.

A quick way to understand what to do with those instructions is basically, create your own page with all your headers, and menus and all that fun stuff that follows the rest of your site design. Then follow the integration guide to add the little bits of code where you should (like in the <head> section, then right after the <body>, and then finally exactly where you want to show the calendar).

If you run into problems, we're here for that and we'll try to answer in the shortest delays.

[Some text in this post has been modified by Brian]
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-29-2005, 09:04 PM   #3
KathrynBassett
Calendar User
 
KathrynBassett is offline
Join Date: Nov 2005
Posts: 34
Default

All of the first part of your explanation was excellant in understanding the difference between the index and the demo. I've even tried an experiment (successful) - I copied demo.php to a new name called dcscalendar.php so that demo being overwritten is not a problem. Then in index, I changed that requirement to be dcscalendar instead of demo and it works.
http://lacdcs.moonlink.net/calendar/
I know it works because I only added that home page link in the new file.

It will be awhile before I can experiment with the integration for several reasons not important here. But I *will* get back to it. Thanks for the leads.
 
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
How to link Events Index.php to existing page mkillian General Support 1 09-06-2005 06:31 AM
Demo.php vs Index.php vs Calendar.php briggs General 2 07-06-2005 06:32 AM
css on demo.php BigG General Support 3 06-30-2005 08:51 PM
index.php all one line? swong General Support 5 03-04-2005 01:31 PM
add es and ee variable in demo.php alex_m General Support 3 03-16-2004 10:43 PM



All times are GMT -4. The time now is 09:21 AM.


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 |