[UPHPU] SQL insert for recurring event using piCal module inXOOPS

Lars Rasmussen lrasmussen at nomtg.com
Fri Apr 23 11:39:13 MDT 2004


That makes a lot more sense - Now I can loop it n times(years) for the
insert.

And I need to put it in a form.

If all goes well, I'm going to be using this to hack the XOOPS 2.06
registration page to allow for unmoderated, unsecured, event entry for
birthdays & anniversaries for users registering on the site.

People are lazy in my family.  If I can get them to type their email address
& all the family birthdays at the same time they register for the site, I'm
much more likely to have some valuable content posted on the Event Calnedar.

I probably should moderate it - maybe just assign a special user id to these
inserts that needs to be approved before they're posted.  I need to get it
the form working first.

Thanks!

Lars

-----Original Message-----
From: Ryan Erickson
Sent: Friday, April 23, 2004 11:15 AM
To: Lars Rasmussen
Cc: list at uphpu.org
Subject: RE: [UPHPU] SQL insert for recurring event using piCal module
inXOOPS


Lars,

This one is distinctly different from your first one.

This one is a valid date unix timestamp.  Last time was one in the year
2037, the last year unix timestamps apply.

The two stamps in this one are:

2004-04-22 18:00:00 and 2004-04-23 18:00:00

Maybe your last example came from the LAST date it inserted the event
for, which makes sense would be the last one that unix timestamps would
apply for...

They're calculated using UNIX_TIMESTAMP values...  You can either have
MySQL generate them for you (select UNIX_TIMESTAMP('2004-04-22
18:00:00') returns 1082678400), or you can have PHP

In PHP, here's how you do it:

http://us3.php.net/strtotime

Good Luck.

Ryan
uphpu at ericksonfamily.com
http://www.ericksonfamily.com


On Fri, 2004-04-23 at 11:00, Lars Rasmussen wrote:
> I created a new example starting with today's date & recurring annually to
> represent Shakespeare's birthday.
>
> I don't think piCal is using a special epoch year to indicate an event is
> recurring, because piCal acutally inserts a record in the database for
every
> occurrence of the event - 100 actually(nobody lives longer than that, I
> guess), when it isn't given an end date for recurrence.
>
> Here's what I exported from phpMyAdmin based on the first row that appears
> with this event.
>
> INSERT INTO `xoops_pical_event` (`id`, `uid`, `groupid`, `summary`,
> `location`, `organizer`, `sequence`, `contact`, `tzid`, `description`,
> `dtstamp`, `categories`, `transp`, `priority`, `admission`, `class`,
> `rrule`, `rrule_pid`, `unique_id`, `allday`, `start`, `end`, `start_date`,
> `end_date`, `cid`, `comments`, `event_tz`, `server_tz`, `poster_tz`,
> `extkey0`, `extkey1`) VALUES (0000000339, 00000001, 00000, 'Shakespeare\'s
> Birthday', '', '', '0', '', 'GMT', 'William Shakespeare was born in
> Stratford-on-Avon on April 23, 1564', 20040423163634, '', 1, 0, 1,
'PUBLIC',
> 'FREQ=YEARLY;INTERVAL=1;BYMONTH=4;WKST=SU', 00000339,
> 'pical060-6a93b8046a4a793acf5a9e775867b1c1', 5, 1082678400, 1082764800,
> NULL, NULL, 00000, 0, 0, 0, 0, 0000000000, 0000000000);
>
>
> -----Original Message-----
> From: Fred Larsen
> Sent: Friday, April 23, 2004 9:56 AM
> To: Lars Rasmussen
> Subject: Re: [UPHPU] SQL insert for recurring event using piCal module
> in XOOPS
>
>
> It almost looks like a doubled Unix time-stamp.  What is the start and end
> dates in your example?
>
> Fred
>
> On Fri, 23 Apr 2004, Lars Rasmussen wrote:
>
> > I'm trying to create a page that will insert several recurring events
> > (birthdays) into piCal's database.
> >
> > I don't understand how the 'start' & 'end' fields are calculated.
> >
> > I know that they are 84600 seconds apart - 1 day - but I don't
understand
> > how the other part of the value is calculated.
> >
> > Any help is appreciated.
> >
> > -Lars
> >
> > INSERT INTO `xoops_pical_event` ( `id` , `uid` , `groupid` , `summary` ,
> > `location` , `organizer` , `sequence` , `contact` , `tzid` ,
`description`
> ,
> > `dtstamp` , `categories` , `transp` , `priority` , `admission` , `class`
,
> > `rrule` , `rrule_pid` , `unique_id` , `allday` , `start` , `end` ,
> > `start_date` , `end_date` , `cid` , `comments` , `event_tz` ,
`server_tz`
> ,
> > `poster_tz` , `extkey0` , `extkey1` ) VALUES ( '', '00000001', '00000',
> > 'Test Event', '', '', '0', '', 'GMT', 'test event desc', NOW( ) , '',
'1',
> > '0', '1', 'PUBLIC', 'FREQ=YEARLY;INTERVAL=1;BYMONTH=6;WKST=SU', '',
> > 'pical060-md5hash-that-is-unique', '5', '2122848000', '2122934400', NULL
,
> > NULL , '00000', '0', '0', '0', '0', '0000000000', '0000000000' );
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: list-unsubscribe at uphpu.org
> > For additional commands, e-mail: list-help at uphpu.org
> >
> >
>
> --
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: list-unsubscribe at uphpu.org
> For additional commands, e-mail: list-help at uphpu.org
>
>








More information about the UPHPU mailing list