X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FEmailReminder%2FEmailReminderPlugin.php;h=9ac6275537afd6535de0a64f4e1aa0f23ae8157b;hb=546a03b5eac5f172d543a889625e2f4de446e8b7;hp=701d04e01647d76aa86260b40b2fd905d9d0b654;hpb=aebab2742a66712bf2d33f7f75c093a4be6cb795;p=quix0rs-gnu-social.git diff --git a/plugins/EmailReminder/EmailReminderPlugin.php b/plugins/EmailReminder/EmailReminderPlugin.php index 701d04e016..9ac6275537 100644 --- a/plugins/EmailReminder/EmailReminderPlugin.php +++ b/plugins/EmailReminder/EmailReminderPlugin.php @@ -61,32 +61,6 @@ class EmailReminderPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false - * means stop. - */ - function onAutoload($cls) { - $base = dirname(__FILE__); - $lower = strtolower($cls); - - $files = array("$base/classes/$cls.php", - "$base/lib/$lower.php"); - if (substr($lower, -6) == 'action') { - $files[] = "$base/actions/" . substr($lower, 0, -6) . ".php"; - } - foreach ($files as $file) { - if (file_exists($file)) { - include_once $file; - return false; - } - } - return true; - } - /** * Register our queue handlers * @@ -135,6 +109,11 @@ class EmailReminderPlugin extends Plugin if (self::sendReminderEmail($type, $object, $subject, $title)) { try { Email_reminder::recordReminder($type, $object, $day); + common_log( + LOG_INFO, + "Sent {$type} reminder to {$object->address}.", + __FILE__ + ); } catch (Exception $e) { // oh noez common_log(LOG_ERR, $e->getMessage(), __FILE__); @@ -163,7 +142,7 @@ class EmailReminderPlugin extends Plugin $inviterurl = null; if ($type == UserInviteReminderHandler::INVITE_REMINDER) { - $user = User::staticGet($object->user_id); + $user = User::getKV($object->user_id); if (!empty($user)) { $profile = $user->getProfile(); $inviter = $profile->getBestName(); @@ -200,13 +179,14 @@ class EmailReminderPlugin extends Plugin * @param type $versions * @return type */ - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array( 'name' => 'EmailReminder', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Zach Copley', 'homepage' => 'http://status.net/wiki/Plugin:EmailReminder', + // TRANS: Plugin description. 'rawdescription' => _m('Send email reminders for various things.') ); return true;