Chapter 16: Command-Line PHP Utilities 581 doRemind() This (Make my own web site)

Chapter 16: Command-Line PHP Utilities 581 doRemind() This function obtains four things: the user s reminder directory ($userDir, which is USER_REMINDER_DIR set in reminder.conf), the user reminder file name ($userFile, which is USER_REMINDER_FILE set in reminder.conf), $username, and the user s home directory ($homeDir). It first determines whether the user has a reminder file in the reminder directory inside the user s home directory. If there is no reminder configuration (reminders.txt) file, the function returns. That ends the user s reminder processing. However, because the user does have a reminders.txt file in the reminders directory, the getRemindersForToday() function is called see if any of the reminders are meant for the current day. The getRemindersForToday() method parses the reminders.txt file and if any reminder matches, it returns the associated reminder mail file. For example, suppose a user has the following configuration in reminders.txt: weekly:mon:my_monday_tasklist.txt weekly:tue:my_tuesday_tasklist.txt weekly:wed:my_wednesday_tasklist.txt weekly:thu:my_thursday_tasklist.txt weekly:fri:my_friday_tasklist.txt weekly:sat:my_saturday_plans.txt weekly:sun:my_sunday_plans.txt Whenever the reminder is run, one of the weekly reminders will match, as the user has a weekly reminder for each day. The matching reminder mail file will be returned in an array called $mailings by the getRemindersForToday() function. For each of the entries in $mailings, the doMail() method is called only if the mail file exists. In other words, if it is Monday, the preceding configuration will return $mailings = array( monday_tasklist.txt ). If ~username/reminders/ monday_tasklist.txt exists, then doMail() will send out the mail. In the case of a missing file, log entries will be created. The log is later written to the ~username/reminders/username.log file so that the user can review it and fix the configuration file or create missing mail files. doMail() This function sends the mail out. It receives a reminder mail filename, which exists in the ~username/reminders directory. The function loads the file into an array called $lines using the file() function. Each line is parsed for mail headers, such as To:, From:, Cc:, Bcc:, Subject:, and Content-Type:. These headers are stored in appropriate format in the $headers array. The other lines are considered part of the body of the message, and are stored in the $messages array.

WordPress database error: [Table 'armadillowebhosting_com_-_jsp.wp_comments' doesn't exist]
SELECT * FROM wp_comments WHERE comment_post_ID = '637' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply