RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Fast Way to Export / Import or pre setup for Installation
Posted:  03 Dec 2012 00:15
For my current project I am installing / setting up perhaps 100 calendars (got 6 installed today) and will be testing multiple sessions.

First there is the install which I now have that down pretty quick. In my case I have the following settings.

Time Zone: America/New_York
Self Registration Enabled with Post Own
Date m.d.y
m,d
m,y

Can I change these in install.php so I don't have to manually change them in each one?

I also want to be able to export my current categories and their colour formats to import but I only seem to be able to export or import events. I've got to find a faster way as it will take me days to set up the number of calendars I need.

Thanks
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  03 Dec 2012 04:26
It pays to read the documentation sometimes. Install.php appears to be where the settings are that I can change for user self registration etc. About the only thing I don't see is any way to easily update the category names and colours for each calendar. Perhaps it there and I just haven't found it yet.

About the only way I can think to do it is configure one calendar the way I want it and then do a uncompressed backup. After that is done change the database name that is stored within the backup and then restore it to the next calendar.

If anyone can confirm that should work or give me a better or easier way I would appreciate it.

Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  03 Dec 2012 11:49   Last Edited By: Roel B.
Hi Dan,
Sounds like an impressive project!

In the same install.php file on line 217 you can see how the event category "no cat" is added to the database. You could use this as an example and your default categories in the same way.

However, if at a later stage you would like to change a category or a setting you will have to update and re-run the install script, which won't work because the install script refuses to run if it finds already existing tables in the database. So more changes in the install.php file would be required.

Because I've the impression your project is an interesting challenge, I'm offering to produce for your project a small tailor made configuration/initialization script to load the database with initial preset data.
We're currently using a similar kind of script for our test sites. It deletes all existing entries from the categories tables and thereafter adds preset values to this table.
In your case this script could delete existing entries from the categories table, the settings tables, and, if you want, from the users table and add preset data to all three of these tables. The advantage: you can use the default install.php script for the initial installation and thereafter you can run the configuration/initialization script at any time and as often as you want.
Roel
Posted:  03 Dec 2012 19:41
Hi Roel,

You're right, it's requiring a number of installs. Since the calendar is City specific you can't just install one. I figured on installing one for each fair size city and then additional ones to cover a number of small towns or rural area. It's tempting to lump them together but would you want to see a event for a place 100 miles / 160 kms away.

That would be sweet. Right now I'm just setting everything up so other than the admin account there are no users and just the "No Cat" category. The robots.txt file is set to disallow and I'm not putting out the word it's there.

About the only drawback I can see with what you are proposing, I'm not complaining, is it would get the categories but not the custom colours or if perhaps it is a repeating event. Perhaps what you are talking about will do that I don't know.

If you are going to custom do something, as long as it wouldn't take any more time, I'm wondering if an export / import routine would work not only for me but for others in the future.

Just like a template. The person installs a calendar and then sets it up the way that they want it. Once they have that done they export the settings to a file. When they install the next calendar they do the import after it is installed.
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  04 Dec 2012 19:30
I'm close but not quite there.

With the install.php I have been able to pre-configure most of the items at installation, there are only a couple of items getting in the way. I believe this is the area of code I need. You can see here I have changed "No Cat" to "No Category", works like a champ. biggrin

In this section where the category gets set up, can I add more categories including their colours?

Code:


//insert initial data
        $crypt_pw=md5($_POST['adminPword']);
        $category = mysql_query("INSERT INTO ".$_POST['dbPfix']."categories (category_id, name, sequence) VALUES (1,'No Category',1)");
        $public_user = mysql_query("INSERT INTO ".$_POST['dbPfix']."users (user_id, user_name, email, privs) VALUES (1,'Public Access',' ',1)");
        $admin_user = mysql_query("INSERT INTO ".$_POST['dbPfix']."users (user_id, user_name, email, password, sedit, privs) VALUES (NULL,'".$_POST['adminUname']."','".$_POST['adminEmail']."','".$crypt_pw."',1,3)");
        if (!$category or !$public_user or !$admin_user) {
            echo "<br><h5 class="hilight">Error: Problem writing to tables</h5><br>n";
            echo "<p>Created tables, but can not write to tables. Please check your database permissions. You will need to clean out the tables in the database and try again.</p>n";
            break;
        }


For example to the code above to add these categories with text and background colours at the time of installation.
1    Church / Non Profit Events    #FFFFFF    #5555FF
2    Entertainment    #0000FF    #FFFFFF


The other part is the Admin login and password at the end. I can see ['adminPword'] above. How exactly would I pre-poplate the admin login and password?

Thanks
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  04 Dec 2012 23:54
Hi Dan,
Yes, this is indeed the right area to populate the database tables with a few more initial values at installation time.
Tomorrow I will send you by email some further details on how to add text and background colors to the categories and also how to deal with passwords in the users table.
Roel