Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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.
Attachments
101362-holidays.zip (0 Bytes, 43 downloads)

Sponsored Links
Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
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

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Yep quite a few bugs in this one.

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.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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...

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
gregoriantojd() is only found in some php installs... [:"blue"] [/]

Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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..


function GregorianToJD($month, $day, $year)
{
$a = floor((14-$month)/12);
$y = floor($year+4800-$a);
$m = floor($month+12*$a-3);
$jd = $day+floor((153*m+2)/5)+$y*365
$jd += floor($y/4)-floor($y/100)+floor($y/400)-32045;

return $jd;
}

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Did you also fix every one of your mysql queries

The format is this

query" QUERY HERE ";

You had an extra semicolon on every INSERT QUERY after the VALUE LINE before the closing tag ";

NOT

query" QUERY HERE ;";

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
hopefully

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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 adjusted those and it works.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
How did you adjust them?

Sponsored Links
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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 />

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Hmm thats done in the zip I just downloaded from above? can you download the zip above and see if thats what you meant?

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
well the one I downloaded with your gregorian function added in had it still. Did you upload a third time?

I just checked again and they are gone but they were there when you first updated it with the gregorian function as I downloaded and tried it out.

By the way it does not work.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Thats what I saw saying the function did not work



Nope dont have it installed on my server and actually most probally wont.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Just wanted to say that it worked perfectly for me the first time.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
If it worked fine for you first time where are your Jewish Holidays and others

You have the same problem that everyone else does as the majority of servers do not have gregoriantojd() defined.

It inputed all the fixed holidays but not the one that change datewise year to year.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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..

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
You mean you did not have to recompile PHP?

Then I may just get the source and compile it on my server as well.

Scoungr,

I just had to laugh at DLWeb as he thought he had no problems

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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...

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
I tried the updated version and still no workie for me. I do like the idea...

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
any hints on filename? I find nothing for calendar


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)