WHERE f.id = ' . $id); $channels_text = db_array('SELECT c.title' . langExt($lang) . ' FROM bb_topics_to_channels t2c JOIN channels c ON t2c.channel_id = c.id WHERE t2c.topic_id = ' . $_POST['topic_id']); $channels_text = implode(', ', $channels_text); $message = '<p style="font-weight:bold;">' . $reply['firstname'] . ' ' . $reply['lastname'] . ' ' . getString('bb_followup', $lang) . '</p> <p>' . getString('title', $lang) . ': ' . draw_link(url_base() . '/bb/topic.php?id=' . $id, $topic['title']) . '</p> <p>' . getString('channels_label', $lang) . ': ' . $channels_text . '</p>'; if ($topic['type']) { $message .= '<p>' . getString('category', $lang) . ': ' . $topic['type'] . '</p>'; } $message .= '<div style="color:#555; border-top:1px dotted #555; padding-top:5px; margin-top:5px;">' . $reply['description'] . '</div>'; emailUser($emails, 'RE: ' . $topic['title'], $message); } } bbDrawRss(); url_change(); } elseif (isset($_GET['delete'])) { db_delete('bb_topics'); bbDrawRss(); url_change('/bb/'); } elseif (isset($_GET['deleteFollowupID'])) { db_delete('bb_followups', $_GET['deleteFollowupID']); bbDrawRss(); url_query_drop('deleteFollowupID'); } //get topic data if (!($r = bbDrawTopic($_GET['id']))) { url_change('/bb/'); } echo drawTop(); echo $r; echo drawBottom();
<?php include 'include.php'; if ($posting) { error_debug('handling bb post', __FILE__, __LINE__); format_post_bits('is_admin'); langTranslatePost('title,description'); $id = db_save('bb_topics'); db_query('UPDATE bb_topics SET thread_date = GETDATE(), replies = (SELECT COUNT(*) FROM bb_followups WHERE topic_id = ' . $id . ') WHERE id = ' . $id); if (getOption('channels')) { db_checkboxes('channels', 'bb_topics_to_channels', 'topic_id', 'channel_id', $id); } //notification if ($_POST['is_admin'] == '1') { //get addresses of everyone & send with message emailUser(db_array('SELECT email FROM users WHERE is_active = 1'), $_POST['title'], drawEmail(bbDrawTopic($id, true))); } elseif (getOption('bb_notifypost') && getOption('channels') && getOption('languages')) { //get addresses of everyone with indicated interests and send $channels = array_post_checkboxes('channels'); $languages = db_table('SELECT id, code FROM languages'); foreach ($languages as $l) { $addresses = db_array('SELECT DISTINCT u.email FROM users u JOIN users_to_channels_prefs u2cp ON u.id = u2cp.user_id WHERE u.is_active = 1 AND u.language_id = ' . $l['id'] . ' AND u2cp.channel_id IN (' . implode(',', $channels) . ')'); $topic = db_grab('SELECT ISNULL(u.nickname, u.firstname) firstname, u.lastname, t.title' . langExt($l['code']) . ' title, t.description' . langExt($l['code']) . ' description, y.title' . langExt($l['code']) . ' type, t.created_date FROM bb_topics t LEFT JOIN bb_topics_types y ON t.type_id = y.id