cvs: phpdoc /it/functions mail.xml mcal.xml
| From: | Luca Perugini | Date: | Thu, 14 Dec 2000 00:34:10 +0000 |
| Subject: | cvs: phpdoc /it/functions mail.xml mcal.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969333254@lists.php.net to get a copy of this message | ||
perugini Wed Dec 13 16:34:10 2000 EDT
Modified files:
/phpdoc/it/functions mail.xml mcal.xml
Log:
Sync with en tree.
Index: phpdoc/it/functions/mail.xml diff -u phpdoc/it/functions/mail.xml:1.2 phpdoc/it/functions/mail.xml:1.3 --- phpdoc/it/functions/mail.xml:1.2 Sat Jun 24 00:38:44 2000 +++ phpdoc/it/functions/mail.xml Wed Dec 13 16:34:10 2000 @@ -20,14 +20,18 @@ <paramdef>string <parameter>to</parameter></paramdef> <paramdef>string <parameter>subject</parameter></paramdef> <paramdef>string <parameter>message</parameter></paramdef> - <paramdef>string <parameter><optional>additional_headers</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>additional_headers</optional> + </parameter> + </paramdef> </funcprototype> </funcsynopsis> <simpara> <function>Mail</function> automatically mails the message specified in <parameter>message</parameter> to the receiver specified in <parameter>to</parameter>. Multiple recipients can be specified by - putting a comma between each address in <parameter>to</parameter>.</simpara> + putting a comma between each address in <parameter>to</parameter>. + </simpara> <para> <example> <title>Sending mail.</title> @@ -46,13 +50,86 @@ mail("nobody@aol.com", "the subject", $message, "From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion()); </programlisting> - </example></para> + </example> + You can also use fairly simple string building techniques to + build complex email messages. + <example> + <title>Sending complex email.</title> + <programlisting> +/* recipients */ +$recipient .= "Mary <mary@u.college.edu>" . ", " ; //note the comma +$recipient .= "Kelly <kelly@u.college.edu> . ", "; +$recipient .= "ronabop@php.net"; + +/* subject */ +$subject = "Birthday Reminders for August"; + +/* message */ +$message .= "The following email includes a formatted ASCII table\n"; +$message .= "Day \t\tMonth \t\tYear\n"; +$message .= "3rd \t\tAug \t\t1970\n"; +$message .= "17rd\t\tAug \t\t1973\n"; + +/* you can add a stock signature */ +$message .= "--\r\n"; //Signature delimiter +$message .= "Birthday reminder copylefted by public domain"; + +/* additional header pieces for errors, From cc's, bcc's, etc */ + +$headers .= "From: Birthday Reminder <birthday@php.net>\n"; +$headers .= "X-Sender: <birthday@php.net>\n"; +$headers .= "X-Mailer: PHP\n"; // mailer +$headers .= "X-Priority: 1\n"; // Urgent message! +$headers .= "Return-Path: <birthday@php.net>\n"; // Return path for errors + +/* If you want to send html mail, uncomment the following line */ +// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type + +$headers .= "cc:birthdayarchive@php.net\n"; // CC to +$headers .= "bcc:birthdaycheck@php.net, birthdaygifts@php.net\n"; // BCCs to + +/* and now mail it */ +mail($recipient, $subject, $message, $headers); + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.ezmlm-hash"> + <refnamediv> + <refname>ezmlm_hash</refname> + <refpurpose>Calculate the hash value needed by EZMLM</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ezmlm_hash</function></funcdef> + <paramdef>string <parameter>addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>ezmlm_hash</function> calculates the hash value needed + when keeping EZMLM mailing lists in a MySQL database. + </simpara> + <para> + <example> + <title>Calculating the hash and subscribing a user</title> + <programlisting> +$user = "kris@koehntopp.de"; +$hash = ezmlm_hash ($user); +$query = sprintf ("INSERT INTO sample VALUES (%s, '%s')", $hash, $user); +$db->query($query); // using PHPLIB db interface + </programlisting> + </example> + </para> </refsect1> </refentry> </reference> -<!-- Keep this comment at the end of the file + <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t @@ -62,7 +139,7 @@ sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil -sgml-default-dtd-file:"../manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil Index: phpdoc/it/functions/mcal.xml diff -u phpdoc/it/functions/mcal.xml:1.5 phpdoc/it/functions/mcal.xml:1.6 --- phpdoc/it/functions/mcal.xml:1.5 Sat Jun 24 00:38:44 2000 +++ phpdoc/it/functions/mcal.xml Wed Dec 13 16:34:10 2000 @@ -4,34 +4,35 @@ <partintro> <para> - MCAL stands for Modular Calendar Access Library.</para> - + MCAL stands for Modular Calendar Access Library. + </para> <para> Libmcal is a C library for accessing calendars. It's written to be very modular, with plugable drivers. MCAL is the calendar - equivalent of the IMAP module for mailboxes.</para> - + equivalent of the IMAP module for mailboxes. + </para> <para> With mcal support, a calendar stream can be opened much like the mailbox stream with the IMAP support. Calendars can be local file stores, remote ICAP servers, or other formats that are supported - by the mcal library.</para> - + by the mcal library. + </para> <para> Calendar events can be pulled up, queried, and stored. There is - also support for calendar triggers (alarms) and reoccuring events.</para> - + also support for calendar triggers (alarms) and reoccuring events. + </para> <para> With libmcal, central calendar servers can be accessed and used, removing the need for any specific database or local file - programming.</para> - + programming. + </para> <para> To get these functions to work, you have to compile PHP with <option role="configure">--with-mcal</option>. That requires the - mcal library to be installed. Grab the latest version from <ulink url="http://mcal.chek.com/">http://mcal.chek.com/</ulink> and - compile and install it.</para> - + mcal library to be installed. Grab the latest version from + <ulink url="&url.mcal;">&url.mcal;</ulink> and compile and install + it. + </para> <para> The following constants are defined when using the MCAL module: @@ -67,8 +68,8 @@ unique for each stream. This alleviates the need to pass around large objects between functions. There are convenience functions for setting, initializing, and retrieving the event structure - values.</para> - + values. + </para> </partintro> <refentry id="function.mcal-open"> @@ -84,22 +85,77 @@ <paramdef>string <parameter>calendar</parameter></paramdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter>options</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns an MCAL stream on success, false on error.</para> + Returns an MCAL stream on success, false on error. + </para> <para> <function>mcal_open</function> opens up an MCAL connection to the specified <parameter>calendar</parameter> store. If the optional <parameter>options</parameter> is specified, passes the <parameter>options</parameter> to that mailbox also. The streams - internal event structure is also initialized upon connection.</para> - <para></para> + internal event structure is also initialized upon connection. + </para> </refsect1> </refentry> + <refentry id="function.mcal-popen"> + <refnamediv> + <refname>mcal_popen</refname> + <refpurpose>Opens up a persistant MCAL connection</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mcal_popen</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + <paramdef>string <parameter>username</parameter></paramdef> + <paramdef>string <parameter>password</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns an MCAL stream on success, false on error. + </para> + <para> + <function>mcal_popen</function> opens up an MCAL connection to the + specified <parameter>calendar</parameter> store. If the optional + <parameter>options</parameter> is specified, passes the + <parameter>options</parameter> to that mailbox also. The streams + internal event structure is also initialized upon connection. + </para> + </refsect1> + </refentry> + <refentry id="function.mcal-reopen"> + <refnamediv> + <refname>mcal_reopen</refname> + <refpurpose>Reopens an MCAL connection</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mcal_reopen</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Reopens an MCAL stream to a new calendar. + </para> + <para> + <function>mcal_reopen</function> reopens an MCAL connection to the + specified <parameter>calendar</parameter> store. If the optional + <parameter>options</parameter> is specified, passes the + <parameter>options</parameter> to that mailbox also. + </para> + </refsect1> + </refentry> + <refentry id="function.mcal-close"> <refnamediv> <refname>mcal_close</refname> @@ -114,10 +170,70 @@ <paramdef>int <parameter>flags</parameter></paramdef> </funcprototype> </funcsynopsis> + <para> + Closes the given mcal stream. + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-create-calendar"> + <refnamediv> + <refname>mcal_create_calendar</refname> + <refpurpose>Create a new MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Creates a new calendar named <parameter>calendar</parameter>. + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-rename-calendar"> + <refnamediv> + <refname>mcal_rename_calendar</refname> + <refpurpose>Rename an MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>old_name</parameter></paramdef> + <paramdef>string <parameter>new_name</parameter></paramdef> + </funcprototype> + </funcsynopsis> <para> - Closes the given mcal stream.</para> + Renames the calendar <parameter>old_name</parameter> to + <parameter>new_name</parameter>. + </para> </refsect1> </refentry> + + <refentry id="function.mcal-delete-calendar"> + <refnamediv> + <refname>mcal_delete_calendar</refname> + <refpurpose>Delete an MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Deletes the calendar named <parameter>calendar</parameter>. + </para> + </refsect1> + </refentry> <refentry id="function.mcal-fetch-event"> <refnamediv> @@ -138,7 +254,8 @@ </funcsynopsis> <para> <function>mcal_fetch_event</function> fetches an event from the - calendar stream specified by <parameter>id</parameter>.</para> + calendar stream specified by <parameter>id</parameter>. + </para> <para> Returns an event object consisting of: <itemizedlist> @@ -196,7 +313,7 @@ <refnamediv> <refname>mcal_list_events</refname> <refpurpose> - Return a list of events between two given datetimes + Return a list of IDs for a date or a range of dates. </refpurpose> </refnamediv> <refsect1> @@ -205,35 +322,23 @@ <funcprototype> <funcdef>array <function>mcal_list_events</function></funcdef> <paramdef>int <parameter>mcal_stream</parameter></paramdef> - <paramdef>int - <parameter><optional>begin_year</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>begin_month</optional></parameter> + <paramdef>object<parameter>begin_date</parameter></paramdef> + <paramdef>object + <parameter><optional>end_date</optional></parameter> </paramdef> - <paramdef>int - <parameter><optional>begin_day</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_year</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_month</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_day</optional></parameter> - </paramdef> </funcprototype> </funcsynopsis> <para> - Returns an array of event ID's that are between the start and end + Returns an array of ID's that are between the start and end dates, or if just a stream is given, uses the start and end dates - in the global event structure.</para> + in the global event structure. + </para> <para> <function>mcal_list_events</function> function takes in an - optional beginning date and an end date for a calendar stream. An + beginning date and an optional end date for a calendar stream. An array of event id's that are between the given dates or the - internal event dates are returned.</para> + internal event dates are returned. + </para> </refsect1> </refentry> @@ -253,10 +358,11 @@ </funcsynopsis> <para> <function>mcal_append_event</function> Stores the global event - into an MCAL calendar for the given stream.</para> + into an MCAL calendar for the given stream. + </para> <para> - Returns the uid of the newly inserted event.</para> - <para></para> + Returns the id of the newly inserted event. + </para> </refsect1> </refentry> @@ -276,10 +382,11 @@ </funcsynopsis> <para> <function>mcal_store_event</function> Stores the modifications - to the current global event for the given stream.</para> + to the current global event for the given stream. + </para> <para> - Returns true on success and false on error.</para> - <para></para> + Returns true on success and false on error. + </para> </refsect1> </refentry> @@ -294,14 +401,16 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mcal_delete_event</function></funcdef> - <paramdef>int <parameter>uid</parameter></paramdef> + <paramdef>int <parameter>mcal_stream</parameter></paramdef> + <paramdef>int <parameter><optional>event_id</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>mcal_delete_event</function> deletes the calendar event - specified by the uid.</para> + specified by the event_id.</para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -315,14 +424,16 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mcal_snooze</function></funcdef> - <paramdef>int <parameter>uid</parameter></paramdef> + <paramdef>int <parameter>id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>mcal_snooze</function> turns off an alarm for a - calendar event specified by the uid.</para> + calendar event specified by the id. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -363,12 +474,14 @@ <para> Returns an array of event ID's that has an alarm going off between the start and end dates, or if just a stream is given, - uses the start and end dates in the global event structure.</para> + uses the start and end dates in the global event structure. + </para> <para> <function>mcal_list_events</function> function takes in an optional beginning date and an end date for a calendar stream. An array of event id's that are between the given dates or the - internal event dates are returned.</para> + internal event dates are returned. + </para> </refsect1> </refentry> @@ -390,9 +503,11 @@ <para> <function>mcal_event_init</function> initializes a streams global event structure. this effectively sets all elements of the - structure to 0, or the default settings.</para> + structure to 0, or the default settings. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -414,9 +529,11 @@ </funcsynopsis> <para> <function>mcal_event_set_category</function> sets the streams - global event structure's category to the given string.</para> + global event structure's category to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -438,9 +555,11 @@ </funcsynopsis> <para> <function>mcal_event_set_title</function> sets the streams global - event structure's title to the given string.</para> + event structure's title to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -464,9 +583,11 @@ </funcsynopsis> <para> <function>mcal_event_set_description</function> sets the streams - global event structure's description to the given string.</para> + global event structure's description to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -509,9 +630,11 @@ </funcsynopsis> <para> <function>mcal_event_set_start</function> sets the streams global - event structure's start date and time to the given values.</para> + event structure's start date and time to the given values. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -554,9 +677,11 @@ </funcsynopsis> <para> <function>mcal_event_set_end</function> sets the streams global - event structure's end date and time to the given values.</para> + event structure's end date and time to the given values. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -578,9 +703,11 @@ </funcsynopsis> <para> <function>mcal_event_set_alarm</function> sets the streams global - event structure's alarm to the given minutes before the event.</para> + event structure's alarm to the given minutes before the event. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -603,9 +730,11 @@ <para> <function>mcal_event_set_class</function> sets the streams global event structure's class to the given value. The class is either 1 - for public, or 0 for private.</para> + for public, or 0 for private. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -627,7 +756,8 @@ </funcsynopsis> <para> <function>mcal_is_leap_year</function> returns 1 if the given - year is a leap year, 1 if not.</para> + year is a leap year, 0 if not. + </para> </refsect1> </refentry> @@ -650,7 +780,8 @@ <para> <function>mcal_days_in_month</function> Returns the number of days in the given month, taking into account if the given year is - a leap year or not.</para> + a leap year or not. + </para> </refsect1> </refentry> @@ -673,7 +804,8 @@ </funcsynopsis> <para> <function>mcal_date_valid</function> Returns true if the given - year, month and day is a valid date, false if not.</para> + year, month and day is a valid date, false if not. + </para> </refsect1> </refentry> @@ -696,7 +828,8 @@ </funcsynopsis> <para> <function>mcal_time_valid</function> Returns true if the given - hour, minutes and seconds is a valid time, false if not.</para> + hour, minutes and seconds is a valid time, false if not. + </para> </refsect1> </refentry> @@ -719,7 +852,8 @@ </funcsynopsis> <para> <function>mcal_day_of_week</function> returns the day of the week - of the given date</para> + of the given date. + </para> </refsect1> </refentry> @@ -742,7 +876,8 @@ </funcsynopsis> <para> <function>mcal_day_of_year</function> returns the day of the year - of the given date</para> + of the given date. + </para> </refsect1> </refentry> @@ -766,7 +901,8 @@ </funcsynopsis> <para> <function>mcal_date_compare</function> Compares the two given - dates, returns <0, 0, >0 if a<b, a==b, a>b respectively</para> + dates, returns <0, 0, >0 if a<b, a==b, a>b respectively. + </para> </refsect1> </refentry> @@ -790,7 +926,8 @@ filled with the next date the event occurs, on or after the supplied date. Returns empty date field if event does not occur or something is invalid. Uses weekstart to determine what day is - considered the beginning of the week.</para> + considered the beginning of the week. + </para> </refsect1> </refentry> @@ -814,7 +951,8 @@ <para> <function>mcal_event_set_recur_none</function> sets the streams global event structure to not recur (event->recur_type is set to - MCAL_RECUR_NONE).</para> + MCAL_RECUR_NONE). + </para> </refsect1> </refentry> @@ -842,7 +980,8 @@ <para> <function>mcal_event_set_recur_daily</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a daily basis, ending at the given date.</para> + reoccuring on a daily basis, ending at the given date. + </para> </refsect1> </refentry> @@ -871,7 +1010,8 @@ <para> <function>mcal_event_set_recur_weekly</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a weekly basis, ending at the given date.</para> + reoccuring on a weekly basis, ending at the given date. + </para> </refsect1> </refentry> @@ -900,7 +1040,8 @@ <function>mcal_event_set_recur_monthly_mday</function> sets the streams global event structure's recurrence to the given value to be reoccuring on a monthly by month day basis, ending at the - given date.</para> + given date. + </para> </refsect1> </refentry> @@ -929,7 +1070,8 @@ <function>mcal_event_set_recur_monthly_wday</function> sets the streams global event structure's recurrence to the given value to be reoccuring on a monthly by week basis, ending at the given - date.</para> + date. + </para> </refsect1> </refentry> @@ -957,7 +1099,8 @@ <para> <function>mcal_event_set_recur_yearly</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a yearly basis,ending at the given date .</para> + reoccuring on a yearly basis,ending at the given date. + </para> </refsect1> </refentry> @@ -1029,7 +1172,59 @@ int sec - seconds</simpara></listitem> <listitem><simpara> int alarm - minutes before event to send an alarm</simpara></listitem> - </itemizedlist></para> + </itemizedlist> + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-event-add-attribute"> + <refnamediv> + <refname>mcal_event_add_attribute</refname> + <refpurpose> + Adds an attribute and a value to the streams global event structure + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>void + <function>mcal_event_add_attribute</function> + </funcdef> + <paramdef>int <parameter>stream</parameter></paramdef> + <paramdef>string <parameter>attribute</parameter></paramdef> + <paramdef>string <parameter>value</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>mcal_event_add_attribute</function> adds an attribute + to the stream's global event structure with the value given by + "value". + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-expunge"> + <refnamediv> + <refname>mcal_expunge</refname> + <refpurpose> + Deletes all events marked for being expunged. + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int + <function>mcal_expunge</function> + </funcdef> + <paramdef>int <parameter>stream</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>mcal_expunge</function> Deletes all events which have + been previously marked for deletion. + </para> </refsect1> </refentry> @@ -1045,7 +1240,7 @@ sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil -sgml-default-dtd-file:"../manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil
Index: phpdoc/it/functions/mail.xml diff -u phpdoc/it/functions/mail.xml:1.2 phpdoc/it/functions/mail.xml:1.3 --- phpdoc/it/functions/mail.xml:1.2 Sat Jun 24 00:38:44 2000 +++ phpdoc/it/functions/mail.xml Wed Dec 13 16:34:10 2000 @@ -20,14 +20,18 @@ <paramdef>string <parameter>to</parameter></paramdef> <paramdef>string <parameter>subject</parameter></paramdef> <paramdef>string <parameter>message</parameter></paramdef> - <paramdef>string <parameter><optional>additional_headers</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>additional_headers</optional> + </parameter> + </paramdef> </funcprototype> </funcsynopsis> <simpara> <function>Mail</function> automatically mails the message specified in <parameter>message</parameter> to the receiver specified in <parameter>to</parameter>. Multiple recipients can be specified by - putting a comma between each address in <parameter>to</parameter>.</simpara> + putting a comma between each address in <parameter>to</parameter>. + </simpara> <para> <example> <title>Sending mail.</title> @@ -46,13 +50,86 @@ mail("nobody@aol.com", "the subject", $message, "From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion()); </programlisting> - </example></para> + </example> + You can also use fairly simple string building techniques to + build complex email messages. + <example> + <title>Sending complex email.</title> + <programlisting> +/* recipients */ +$recipient .= "Mary <mary@u.college.edu>" . ", " ; //note the comma +$recipient .= "Kelly <kelly@u.college.edu> . ", "; +$recipient .= "ronabop@php.net"; + +/* subject */ +$subject = "Birthday Reminders for August"; + +/* message */ +$message .= "The following email includes a formatted ASCII table\n"; +$message .= "Day \t\tMonth \t\tYear\n"; +$message .= "3rd \t\tAug \t\t1970\n"; +$message .= "17rd\t\tAug \t\t1973\n"; + +/* you can add a stock signature */ +$message .= "--\r\n"; //Signature delimiter +$message .= "Birthday reminder copylefted by public domain"; + +/* additional header pieces for errors, From cc's, bcc's, etc */ + +$headers .= "From: Birthday Reminder <birthday@php.net>\n"; +$headers .= "X-Sender: <birthday@php.net>\n"; +$headers .= "X-Mailer: PHP\n"; // mailer +$headers .= "X-Priority: 1\n"; // Urgent message! +$headers .= "Return-Path: <birthday@php.net>\n"; // Return path for errors + +/* If you want to send html mail, uncomment the following line */ +// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type + +$headers .= "cc:birthdayarchive@php.net\n"; // CC to +$headers .= "bcc:birthdaycheck@php.net, birthdaygifts@php.net\n"; // BCCs to + +/* and now mail it */ +mail($recipient, $subject, $message, $headers); + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.ezmlm-hash"> + <refnamediv> + <refname>ezmlm_hash</refname> + <refpurpose>Calculate the hash value needed by EZMLM</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ezmlm_hash</function></funcdef> + <paramdef>string <parameter>addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>ezmlm_hash</function> calculates the hash value needed + when keeping EZMLM mailing lists in a MySQL database. + </simpara> + <para> + <example> + <title>Calculating the hash and subscribing a user</title> + <programlisting> +$user = "kris@koehntopp.de"; +$hash = ezmlm_hash ($user); +$query = sprintf ("INSERT INTO sample VALUES (%s, '%s')", $hash, $user); +$db->query($query); // using PHPLIB db interface + </programlisting> + </example> + </para> </refsect1> </refentry> </reference> -<!-- Keep this comment at the end of the file + <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t @@ -62,7 +139,7 @@ sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil -sgml-default-dtd-file:"../manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil Index: phpdoc/it/functions/mcal.xml diff -u phpdoc/it/functions/mcal.xml:1.5 phpdoc/it/functions/mcal.xml:1.6 --- phpdoc/it/functions/mcal.xml:1.5 Sat Jun 24 00:38:44 2000 +++ phpdoc/it/functions/mcal.xml Wed Dec 13 16:34:10 2000 @@ -4,34 +4,35 @@ <partintro> <para> - MCAL stands for Modular Calendar Access Library.</para> - + MCAL stands for Modular Calendar Access Library. + </para> <para> Libmcal is a C library for accessing calendars. It's written to be very modular, with plugable drivers. MCAL is the calendar - equivalent of the IMAP module for mailboxes.</para> - + equivalent of the IMAP module for mailboxes. + </para> <para> With mcal support, a calendar stream can be opened much like the mailbox stream with the IMAP support. Calendars can be local file stores, remote ICAP servers, or other formats that are supported - by the mcal library.</para> - + by the mcal library. + </para> <para> Calendar events can be pulled up, queried, and stored. There is - also support for calendar triggers (alarms) and reoccuring events.</para> - + also support for calendar triggers (alarms) and reoccuring events. + </para> <para> With libmcal, central calendar servers can be accessed and used, removing the need for any specific database or local file - programming.</para> - + programming. + </para> <para> To get these functions to work, you have to compile PHP with <option role="configure">--with-mcal</option>. That requires the - mcal library to be installed. Grab the latest version from <ulink url="http://mcal.chek.com/">http://mcal.chek.com/</ulink> and - compile and install it.</para> - + mcal library to be installed. Grab the latest version from + <ulink url="&url.mcal;">&url.mcal;</ulink> and compile and install + it. + </para> <para> The following constants are defined when using the MCAL module: @@ -67,8 +68,8 @@ unique for each stream. This alleviates the need to pass around large objects between functions. There are convenience functions for setting, initializing, and retrieving the event structure - values.</para> - + values. + </para> </partintro> <refentry id="function.mcal-open"> @@ -84,22 +85,77 @@ <paramdef>string <parameter>calendar</parameter></paramdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter>options</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns an MCAL stream on success, false on error.</para> + Returns an MCAL stream on success, false on error. + </para> <para> <function>mcal_open</function> opens up an MCAL connection to the specified <parameter>calendar</parameter> store. If the optional <parameter>options</parameter> is specified, passes the <parameter>options</parameter> to that mailbox also. The streams - internal event structure is also initialized upon connection.</para> - <para></para> + internal event structure is also initialized upon connection. + </para> </refsect1> </refentry> + <refentry id="function.mcal-popen"> + <refnamediv> + <refname>mcal_popen</refname> + <refpurpose>Opens up a persistant MCAL connection</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mcal_popen</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + <paramdef>string <parameter>username</parameter></paramdef> + <paramdef>string <parameter>password</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns an MCAL stream on success, false on error. + </para> + <para> + <function>mcal_popen</function> opens up an MCAL connection to the + specified <parameter>calendar</parameter> store. If the optional + <parameter>options</parameter> is specified, passes the + <parameter>options</parameter> to that mailbox also. The streams + internal event structure is also initialized upon connection. + </para> + </refsect1> + </refentry> + <refentry id="function.mcal-reopen"> + <refnamediv> + <refname>mcal_reopen</refname> + <refpurpose>Reopens an MCAL connection</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mcal_reopen</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + <paramdef>int <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Reopens an MCAL stream to a new calendar. + </para> + <para> + <function>mcal_reopen</function> reopens an MCAL connection to the + specified <parameter>calendar</parameter> store. If the optional + <parameter>options</parameter> is specified, passes the + <parameter>options</parameter> to that mailbox also. + </para> + </refsect1> + </refentry> + <refentry id="function.mcal-close"> <refnamediv> <refname>mcal_close</refname> @@ -114,10 +170,70 @@ <paramdef>int <parameter>flags</parameter></paramdef> </funcprototype> </funcsynopsis> + <para> + Closes the given mcal stream. + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-create-calendar"> + <refnamediv> + <refname>mcal_create_calendar</refname> + <refpurpose>Create a new MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Creates a new calendar named <parameter>calendar</parameter>. + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-rename-calendar"> + <refnamediv> + <refname>mcal_rename_calendar</refname> + <refpurpose>Rename an MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>old_name</parameter></paramdef> + <paramdef>string <parameter>new_name</parameter></paramdef> + </funcprototype> + </funcsynopsis> <para> - Closes the given mcal stream.</para> + Renames the calendar <parameter>old_name</parameter> to + <parameter>new_name</parameter>. + </para> </refsect1> </refentry> + + <refentry id="function.mcal-delete-calendar"> + <refnamediv> + <refname>mcal_delete_calendar</refname> + <refpurpose>Delete an MCAL calendar </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>stream</function></funcdef> + <paramdef>string <parameter>calendar</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Deletes the calendar named <parameter>calendar</parameter>. + </para> + </refsect1> + </refentry> <refentry id="function.mcal-fetch-event"> <refnamediv> @@ -138,7 +254,8 @@ </funcsynopsis> <para> <function>mcal_fetch_event</function> fetches an event from the - calendar stream specified by <parameter>id</parameter>.</para> + calendar stream specified by <parameter>id</parameter>. + </para> <para> Returns an event object consisting of: <itemizedlist> @@ -196,7 +313,7 @@ <refnamediv> <refname>mcal_list_events</refname> <refpurpose> - Return a list of events between two given datetimes + Return a list of IDs for a date or a range of dates. </refpurpose> </refnamediv> <refsect1> @@ -205,35 +322,23 @@ <funcprototype> <funcdef>array <function>mcal_list_events</function></funcdef> <paramdef>int <parameter>mcal_stream</parameter></paramdef> - <paramdef>int - <parameter><optional>begin_year</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>begin_month</optional></parameter> + <paramdef>object<parameter>begin_date</parameter></paramdef> + <paramdef>object + <parameter><optional>end_date</optional></parameter> </paramdef> - <paramdef>int - <parameter><optional>begin_day</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_year</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_month</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>end_day</optional></parameter> - </paramdef> </funcprototype> </funcsynopsis> <para> - Returns an array of event ID's that are between the start and end + Returns an array of ID's that are between the start and end dates, or if just a stream is given, uses the start and end dates - in the global event structure.</para> + in the global event structure. + </para> <para> <function>mcal_list_events</function> function takes in an - optional beginning date and an end date for a calendar stream. An + beginning date and an optional end date for a calendar stream. An array of event id's that are between the given dates or the - internal event dates are returned.</para> + internal event dates are returned. + </para> </refsect1> </refentry> @@ -253,10 +358,11 @@ </funcsynopsis> <para> <function>mcal_append_event</function> Stores the global event - into an MCAL calendar for the given stream.</para> + into an MCAL calendar for the given stream. + </para> <para> - Returns the uid of the newly inserted event.</para> - <para></para> + Returns the id of the newly inserted event. + </para> </refsect1> </refentry> @@ -276,10 +382,11 @@ </funcsynopsis> <para> <function>mcal_store_event</function> Stores the modifications - to the current global event for the given stream.</para> + to the current global event for the given stream. + </para> <para> - Returns true on success and false on error.</para> - <para></para> + Returns true on success and false on error. + </para> </refsect1> </refentry> @@ -294,14 +401,16 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mcal_delete_event</function></funcdef> - <paramdef>int <parameter>uid</parameter></paramdef> + <paramdef>int <parameter>mcal_stream</parameter></paramdef> + <paramdef>int <parameter><optional>event_id</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>mcal_delete_event</function> deletes the calendar event - specified by the uid.</para> + specified by the event_id.</para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -315,14 +424,16 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mcal_snooze</function></funcdef> - <paramdef>int <parameter>uid</parameter></paramdef> + <paramdef>int <parameter>id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>mcal_snooze</function> turns off an alarm for a - calendar event specified by the uid.</para> + calendar event specified by the id. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -363,12 +474,14 @@ <para> Returns an array of event ID's that has an alarm going off between the start and end dates, or if just a stream is given, - uses the start and end dates in the global event structure.</para> + uses the start and end dates in the global event structure. + </para> <para> <function>mcal_list_events</function> function takes in an optional beginning date and an end date for a calendar stream. An array of event id's that are between the given dates or the - internal event dates are returned.</para> + internal event dates are returned. + </para> </refsect1> </refentry> @@ -390,9 +503,11 @@ <para> <function>mcal_event_init</function> initializes a streams global event structure. this effectively sets all elements of the - structure to 0, or the default settings.</para> + structure to 0, or the default settings. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -414,9 +529,11 @@ </funcsynopsis> <para> <function>mcal_event_set_category</function> sets the streams - global event structure's category to the given string.</para> + global event structure's category to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -438,9 +555,11 @@ </funcsynopsis> <para> <function>mcal_event_set_title</function> sets the streams global - event structure's title to the given string.</para> + event structure's title to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -464,9 +583,11 @@ </funcsynopsis> <para> <function>mcal_event_set_description</function> sets the streams - global event structure's description to the given string.</para> + global event structure's description to the given string. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -509,9 +630,11 @@ </funcsynopsis> <para> <function>mcal_event_set_start</function> sets the streams global - event structure's start date and time to the given values.</para> + event structure's start date and time to the given values. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -554,9 +677,11 @@ </funcsynopsis> <para> <function>mcal_event_set_end</function> sets the streams global - event structure's end date and time to the given values.</para> + event structure's end date and time to the given values. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -578,9 +703,11 @@ </funcsynopsis> <para> <function>mcal_event_set_alarm</function> sets the streams global - event structure's alarm to the given minutes before the event.</para> + event structure's alarm to the given minutes before the event. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -603,9 +730,11 @@ <para> <function>mcal_event_set_class</function> sets the streams global event structure's class to the given value. The class is either 1 - for public, or 0 for private.</para> + for public, or 0 for private. + </para> <para> - Returns true.</para> + Returns true. + </para> </refsect1> </refentry> @@ -627,7 +756,8 @@ </funcsynopsis> <para> <function>mcal_is_leap_year</function> returns 1 if the given - year is a leap year, 1 if not.</para> + year is a leap year, 0 if not. + </para> </refsect1> </refentry> @@ -650,7 +780,8 @@ <para> <function>mcal_days_in_month</function> Returns the number of days in the given month, taking into account if the given year is - a leap year or not.</para> + a leap year or not. + </para> </refsect1> </refentry> @@ -673,7 +804,8 @@ </funcsynopsis> <para> <function>mcal_date_valid</function> Returns true if the given - year, month and day is a valid date, false if not.</para> + year, month and day is a valid date, false if not. + </para> </refsect1> </refentry> @@ -696,7 +828,8 @@ </funcsynopsis> <para> <function>mcal_time_valid</function> Returns true if the given - hour, minutes and seconds is a valid time, false if not.</para> + hour, minutes and seconds is a valid time, false if not. + </para> </refsect1> </refentry> @@ -719,7 +852,8 @@ </funcsynopsis> <para> <function>mcal_day_of_week</function> returns the day of the week - of the given date</para> + of the given date. + </para> </refsect1> </refentry> @@ -742,7 +876,8 @@ </funcsynopsis> <para> <function>mcal_day_of_year</function> returns the day of the year - of the given date</para> + of the given date. + </para> </refsect1> </refentry> @@ -766,7 +901,8 @@ </funcsynopsis> <para> <function>mcal_date_compare</function> Compares the two given - dates, returns <0, 0, >0 if a<b, a==b, a>b respectively</para> + dates, returns <0, 0, >0 if a<b, a==b, a>b respectively. + </para> </refsect1> </refentry> @@ -790,7 +926,8 @@ filled with the next date the event occurs, on or after the supplied date. Returns empty date field if event does not occur or something is invalid. Uses weekstart to determine what day is - considered the beginning of the week.</para> + considered the beginning of the week. + </para> </refsect1> </refentry> @@ -814,7 +951,8 @@ <para> <function>mcal_event_set_recur_none</function> sets the streams global event structure to not recur (event->recur_type is set to - MCAL_RECUR_NONE).</para> + MCAL_RECUR_NONE). + </para> </refsect1> </refentry> @@ -842,7 +980,8 @@ <para> <function>mcal_event_set_recur_daily</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a daily basis, ending at the given date.</para> + reoccuring on a daily basis, ending at the given date. + </para> </refsect1> </refentry> @@ -871,7 +1010,8 @@ <para> <function>mcal_event_set_recur_weekly</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a weekly basis, ending at the given date.</para> + reoccuring on a weekly basis, ending at the given date. + </para> </refsect1> </refentry> @@ -900,7 +1040,8 @@ <function>mcal_event_set_recur_monthly_mday</function> sets the streams global event structure's recurrence to the given value to be reoccuring on a monthly by month day basis, ending at the - given date.</para> + given date. + </para> </refsect1> </refentry> @@ -929,7 +1070,8 @@ <function>mcal_event_set_recur_monthly_wday</function> sets the streams global event structure's recurrence to the given value to be reoccuring on a monthly by week basis, ending at the given - date.</para> + date. + </para> </refsect1> </refentry> @@ -957,7 +1099,8 @@ <para> <function>mcal_event_set_recur_yearly</function> sets the streams global event structure's recurrence to the given value to be - reoccuring on a yearly basis,ending at the given date .</para> + reoccuring on a yearly basis,ending at the given date. + </para> </refsect1> </refentry> @@ -1029,7 +1172,59 @@ int sec - seconds</simpara></listitem> <listitem><simpara> int alarm - minutes before event to send an alarm</simpara></listitem> - </itemizedlist></para> + </itemizedlist> + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-event-add-attribute"> + <refnamediv> + <refname>mcal_event_add_attribute</refname> + <refpurpose> + Adds an attribute and a value to the streams global event structure + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>void + <function>mcal_event_add_attribute</function> + </funcdef> + <paramdef>int <parameter>stream</parameter></paramdef> + <paramdef>string <parameter>attribute</parameter></paramdef> + <paramdef>string <parameter>value</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>mcal_event_add_attribute</function> adds an attribute + to the stream's global event structure with the value given by + "value". + </para> + </refsect1> + </refentry> + + <refentry id="function.mcal-expunge"> + <refnamediv> + <refname>mcal_expunge</refname> + <refpurpose> + Deletes all events marked for being expunged. + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int + <function>mcal_expunge</function> + </funcdef> + <paramdef>int <parameter>stream</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>mcal_expunge</function> Deletes all events which have + been previously marked for deletion. + </para> </refsect1> </refentry> @@ -1045,7 +1240,7 @@ sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil -sgml-default-dtd-file:"../manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil