* a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * @author Peter Goodman * @author Geoffrey Goodman * @author James Logsdon * @version $Id: mail.php,v 1.1 2005/05/24 20:05:09 k4st Exp $ * @package k42 */ error_reporting(E_ALL); if (!defined('IN_K4')) { exit; } $lang += array('L_FORUMS' => 'Forums', 'L_REPLYTO' => 'Reply to', 'L_TOPICPOSTIN' => 'Topic posted in', 'L_TOPICSUBSCRIBEEMAIL' => "Hello %s,\r\n\r\n%s has just replied to a topic you have subscribed to entitled: %s.\r\n\r\nThe topic is located at:\r\n" . forum_url() . "/viewtopic.php?id=%s\r\n\r\n\r\nThere may be other replies as well, however you will not receive any more notifications until you visit the forum topic again.\r\n\r\nYours,\r\n%s team.\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nUnsubscription Information:\r\n\r\nTo unsubscribe from this topic, please visit this page:\r\n" . forum_url() . "/viewtopic.php?act=untrack&id=%s", 'L_FORUMSUBSCRIBEEMAIL' => "Hello %s,\r\n\r\n%s has just posted a topic in the forum you have subscribed to entitled: %s.\r\n\r\nThe topic is located at:\r\n" . forum_url() . "/viewforum.php?id=%s\r\n\r\n\r\nThere may be other topics as well, however you will not receive any more notifications until you visit the forum again.\r\n\r\nYours,\r\n%s team.\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nUnsubscription Information:\r\n\r\nTo unsubscribe from this forum, please visit this page:\r\n" . forum_url() . "/viewforum.php?act=untrack&id=%s");
/** * Execute our mail queue by sending out an appropriate amount of emails at once */ function execute_mail_queue(&$dba, $mailqueue) { global $_SETTINGS, $_URL; if (is_array($mailqueue) && !empty($mailqueue)) { array_values($mailqueue); if (isset($mailqueue[0])) { $queue = $mailqueue[0]; $users = force_unserialize($mailqueue[0]['userinfo']); if (is_array($users) && !empty($users)) { /* Reset the starting point of this array */ $users = array_values($users); $count = count($users); $user_query = ''; /* Loop through the users */ for ($i = 0; $i < EMAIL_INTERVAL; $i++) { if (isset($users[$i]) && is_array($users[$i]) && intval($users[$i]['id']) != 0) { $temp_i = $i; if ($users[$i]['name'] != $users[$i]['poster_name']) { $message = sprintf($mailqueue[0]['message'], $users[$i]['name'], $users[$i]['poster_name']); $page =& new FAUrl(forum_url()); $page->args = array(); $page->file = FALSE; $page->path = FALSE; $page->anchor = FALSE; $page->scheme = FALSE; /* Email our user */ mail($users[$i]['email'], $mailqueue[0]['subject'], $message, "From: \"" . $_SETTINGS['bbtitle'] . " Forums\" <noreply@" . $page->__toString() . ">"); $user_query .= $i == 0 ? 'user_id = ' . intval($users[$i]['id']) : ' OR user_id = ' . intval($users[$i]['id']); unset($users[$i]); } } } /* Update the subscriptions 'requires revisit' field */ $dba->executeUpdate("UPDATE " . K4SUBSCRIPTIONS . " SET requires_revisit = 1 WHERE post_id = " . $queue['row_id'] . " " . ($user_query != '' ? "AND (" . $user_query . ")" : '')); /* If we have finished with this queue item */ if ($count <= EMAIL_INTERVAL) { $dba->executeUpdate("DELETE FROM " . K4MAILQUEUE . " WHERE id = " . intval($mailqueue[0]['id'])); } else { $users = array_values($users); $update = $dba->prepareStatement("UPDATE " . K4MAILQUEUE . " SET userinfo=? WHERE id=?"); $update->setString(1, serialize($users)); $update->setInt(2, $mailqueue[0]['id']); $update->executeUpdate(); } } else { $dba->executeUpdate("DELETE FROM " . K4MAILQUEUE . " WHERE id = " . intval($mailqueue[0]['id'])); } reset_cache('email_queue'); } } }
</li> <li class="nav-item"> <a class="nav-link" href="<?php echo elib_url(); ?> ">ELIBRARY</a> </li> <li class="nav-item"> <a class="nav-link" href="<?php echo virtualclass_url(); ?> ">KELAS ONLINE</a> </li> <li class="nav-item"> <a class="nav-link" href="<?php echo forum_url(); ?> ">FORUM</a> </li> <li class="nav-item"> <a href="<?php echo konsultasi_url(); ?> " class="nav-link">KONSULTASI</a> </li> <li class="nav-item"> <a href="<?php echo vicon_url(); ?> " class="nav-link">VIRTUAL CONFERENCE</a> </li>
/** * Execute our mail queue by sending out an appropriate amount of emails at once */ function execute_mail_queue() { global $_DBA, $_MAILQUEUE, $_SETTINGS; if (is_array($_MAILQUEUE) && !empty($_MAILQUEUE)) { array_values($_MAILQUEUE); $page =& new Url(forum_url()); $page->args = array(); $page->file = FALSE; $page->path = FALSE; $page->anchor = FALSE; $page->scheme = FALSE; if (isset($_MAILQUEUE[0])) { $queue = $_MAILQUEUE[0]; $users = unserialize($_MAILQUEUE[0]['userinfo']); if (is_array($users) && !empty($users)) { /* Reset the starting point of this array */ $users = array_values($users); $count = count($users); $user_query = ''; /* Loop through the users */ for ($i = 0; $i < EMAIL_INTERVAL; $i++) { if (isset($users[$i]) && is_array($users[$i]) && intval($users[$i]['id']) != 0) { if ($users[$i]['name'] != $users[$i]['poster_name']) { $message = sprintf($_MAILQUEUE[0]['message'], $users[$i]['name'], $users[$i]['poster_name']); /* Email our user */ mail($users[$i]['email'], $_MAILQUEUE[0]['subject'], $message, "From: \"" . $_SETTINGS['bbtitle'] . " Forums\" <noreply@" . $page->__toString() . ">"); unset($users[$i]); } $user_query .= $i == 0 ? 'user_id = ' . intval($users[$i]['id']) : ' OR user_id = ' . intval($users[$i]['id']); } } /* Update the subscriptions 'requires revisit' field */ $_DBA->executeUpdate("UPDATE " . SUBSCRIPTIONS . " SET requires_revisit = 1 WHERE topic_id = " . $queue['row_id'] . " AND (" . $user_query . ")"); /* If we have finished with this queue item */ if ($count <= EMAIL_INTERVAL) { $_DBA->executeUpdate("DELETE FROM " . MAILQUEUE . " WHERE id = " . intval($_MAILQUEUE[0]['id'])); } else { $users = array_values($users); $update = $_DBA->prepareStatement("UPDATE " . MAILQUEUE . " SET userinfo=? WHERE id=?"); $update->setString(1, serialize($users)); $update->setInt(2, $_MAILQUEUE[0]['id']); $update->executeUpdate(); } /* Reset the filetime on our email cache file */ if (!@touch(CACHE_EMAIL_FILE, time() - 86460)) { @unlink(CACHE_EMAIL_FILE); } } else { $_DBA->executeUpdate("DELETE FROM " . MAILQUEUE . " WHERE id = " . intval($_MAILQUEUE[0]['id'])); /* Reset the filetime on our email cache file */ if (!@touch(CACHE_EMAIL_FILE, time() - 86460)) { @unlink(CACHE_EMAIL_FILE); } } } } }