Mod Name / Version: Input a years Holidays into the 6.4 Calendar with one touch
Description: Simple Script that when Ran asks for the year and your username.. if your username isn't correct nothing is inputted into the calendar table of Threads 6.4 but if its correct it goes to work and inputs about 20+ Holidays. You can adapt it to your own schematic.. Only do this if you know what your doing..
Working Under: UBB.Threads 6.4
Mod Status: Beta
Any pre-requisites:
Author(s): scroungr
Date: 12/08/03
Credits:
Files Altered:
New Files: holidays.php
Database Altered: yes - inputs records into calendar table
Info/Instructions:
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Fatal error: Call to undefined function: gregoriantojd() in /home2/www/steelheader/ubbthreads/holidays.php on line 1756
Then when I try to run it .... all kinds of errors
New Years Day = 01/01/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('4', '2', '01', '01', '2003', 'yearly', 'New Years Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Squirrel Appreciation Day = 01/21/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('5', '2', '21', '01', '2003', 'yearly', 'Squirrel Appreciation Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Martin Luther King Day = 01/20/2003 Ground Hogs Day = 02/02/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('7', '2', '02', '02', '2003', 'yearly', 'Ground Hogs Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Valentines Day = 02/14/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('8', '2', '14', '02', '2003', 'yearly', 'Valentines Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Presidents Day = 02/17/2003 St. Patricks Day = 03/17/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('10', '2', '17', '03', '2003', 'yearly', 'St. Patricks Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 April Fools Day = 04/01/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('11', '2', '01', '04', '2003', 'yearly', 'April Fools Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Arm Forces Day = 04/19/2003 Easter = 04/20/2003 Good Friday = 04/18/2003 Cinco De Mayo = 05/05/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('15', '2', '05', '05', '2003', 'yearly', 'Cinco De Mayo','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Mothers Day = 05/11/2003 Daylight Savings Time Begins = 04/06/2003 Daylight Savings Time Ends = 10/26/2003 Taxes Due = 04/15/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('19', '2', '15', '04', '2003', 'yearly', 'Taxes Due','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Memorial Day = 05/26/2003 Fathers Day = 06/15/2003 Flag Day = 06/14/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('22', '2', '14', '06', '2003', 'yearly', 'Flag Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Independence Day = 07/04/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('23', '2', '04', '07', '2003', 'yearly', 'Independence Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Labor Day = 09/01/2003 Columbus Day = 10/13/2003 Halloween = 10/31/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('26', '2', '31', '10', '2003', 'yearly', 'Halloween','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Election Day = 11/04/2003 Veterans Day = 11/11/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('28', '2', '11', '11', '2003', 'yearly', 'Veterans Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Thanksgiving = 11/27/2003 Christmas Day = 12/25/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('30', '2', '25', '12', '2003', 'yearly', 'Christmas Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Rosh Hashanah =
Fatal error: Call to undefined function: gregoriantojd() in /home2/www/steelheader/ubbthreads/holidays.php on line 1756
Okay after all the INSERT QUERIES there is this after the value fields VALUES(BLAH BLAH);"; There is an extra ; afterwards. Should be VALUES(BLAH BLAH)";
Also take note any holiday that has this a fixed date will be entered. However any holiday that has to calculate the date does not get entered. So in all about 13 holidays out of 20 some get entered.
okay... should have mentioned that you need to have php compiled with the calendar module.. if ya don't have the calendar module you will get those errors... figured that out last nite after not being able to use this on my internal box but being able to use this on my ervr1snet.com box...
heres a copy of the a replacement function.. its in the file now so try and use it.. also you may need to dump the c_entry variable depending on whether or not your mysql adds records to it recursively.. if it down't work then move on..
OKay well I just downloaded it and they are still there.
That is why Smilesforu was getitng these
New Years Day = 01/01/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('4', '2', '01', '01', '2003', 'yearly', 'New Years Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Squirrel Appreciation Day = 01/21/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('5', '2', '21', '01', '2003', 'yearly', 'Squirrel Appreciation Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Martin Luther King Day = 01/20/2003 Ground Hogs Day = 02/02/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('7', '2', '02', '02', '2003', 'yearly', 'Ground Hogs Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Valentines Day = 02/14/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('8', '2', '14', '02', '2003', 'yearly', 'Valentines Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Presidents Day = 02/17/2003 St. Patricks Day = 03/17/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('10', '2', '17', '03', '2003', 'yearly', 'St. Patricks Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 April Fools Day = 04/01/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('11', '2', '01', '04', '2003', 'yearly', 'April Fools Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Arm Forces Day = 04/19/2003 Easter = 04/20/2003 Good Friday = 04/18/2003 Cinco De Mayo = 05/05/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('15', '2', '05', '05', '2003', 'yearly', 'Cinco De Mayo','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Mothers Day = 05/11/2003 Daylight Savings Time Begins = 04/06/2003 Daylight Savings Time Ends = 10/26/2003 Taxes Due = 04/15/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('19', '2', '15', '04', '2003', 'yearly', 'Taxes Due','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Memorial Day = 05/26/2003 Fathers Day = 06/15/2003 Flag Day = 06/14/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('22', '2', '14', '06', '2003', 'yearly', 'Flag Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Independence Day = 07/04/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('23', '2', '04', '07', '2003', 'yearly', 'Independence Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Labor Day = 09/01/2003 Columbus Day = 10/13/2003 Halloween = 10/31/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('26', '2', '31', '10', '2003', 'yearly', 'Halloween','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Election Day = 11/04/2003 Veterans Day = 11/11/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('28', '2', '11', '11', '2003', 'yearly', 'Veterans Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Thanksgiving = 11/27/2003 Christmas Day = 12/25/2003SQL ERROR: Unable to do_query: INSERT INTO w3t_Calendar (`C_Entry`, `C_Owner`, `C_Date`, `C_Month`, `C_Year`, `C_Recurring`, `C_Brief`, `C_Notes`, `C_Type`) VALUES ('30', '2', '25', '12', '2003', 'yearly', 'Christmas Day','', 'public'); You have an error in your SQL syntax near '; ' at line 5 Rosh Hashanah =
I removed that ; you had before the closing query ";
I posted this above showing you how it had to be
Code
<br />The format is this <br /> <br />query" QUERY HERE "; <br /> <br />You had an extra semicolon on every INSERT QUERY after the VALUE LINE before the closing tag "; <br /> <br />NOT <br /> <br />query" QUERY HERE ;"; <br />
Yeah did it three times.. The Original.. with the Gregorian Function.. and last was without those quotes Did you have to use the function or is gregorianttojd on your server? wondering if that function actually works
yeah I actually had the calendar php functions on my ever1 server but not on my home box so I had to scramble and look for it.. its really easy to add.. its a src rpm.. you can add the ones that change year to year by selecting that year as your source.. it will skip the ones that are on the same date..
NP and nope no recompiling of it was neccessary just had to do a hefty search for the src.rpm for my particular version of php.. I am using 4.3.3 so had to find the calender.src.rpm for that version and found it on rpmfind.net... then i just ran the rpm command and it added it np...
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.