public function deletepost($id) { global $lang_common, $lang_post, $pd; if ($this->user->g_read_board == '0') { message($lang_common['No view'], '403'); } // Fetch some informations about the post, the topic and the forum $cur_post = $this->model->get_info_delete($id); if ($this->config['o_censoring'] == '1') { $cur_post['subject'] = censor_words($cur_post['subject']); } // Sort out who the moderators are and if we are currently a moderator (or an admin) $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array(); $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false; $is_topic_post = $id == $cur_post['first_post_id'] ? true : false; // Do we have permission to edit this post? if (($this->user->g_delete_posts == '0' || $this->user->g_delete_topics == '0' && $is_topic_post || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) { message($lang_common['No permission'], '403'); } if ($is_admmod && $this->user->g_id != FEATHER_ADMIN && in_array($cur_post['poster_id'], get_admin_ids())) { message($lang_common['No permission'], '403'); } // Load the delete.php language file require FEATHER_ROOT . 'lang/' . $this->user->language . '/delete.php'; if ($this->feather->request()->isPost()) { $this->model->handle_deletion($is_topic_post, $id, $cur_post['tid'], $cur_post['fid']); } $page_title = array(feather_escape($this->config['o_board_title']), $lang_delete['Delete post']); define('FEATHER_ACTIVE_PAGE', 'delete'); $this->header->setTitle($page_title)->display(); require FEATHER_ROOT . 'include/parser.php'; $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']); $this->feather->render('delete.php', array('lang_common' => $lang_common, 'lang_delete' => $lang_delete, 'cur_post' => $cur_post, 'id' => $id, 'is_topic_post' => $is_topic_post)); $this->footer->display(); }
public function editpost($id) { global $lang_common, $lang_prof_reg, $lang_post, $lang_register; if ($this->user->g_read_board == '0') { message($lang_common['No view'], '403'); } // Fetch some informations about the post, the topic and the forum $cur_post = $this->model->get_info_edit($id); // Sort out who the moderators are and if we are currently a moderator (or an admin) $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array(); $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false; $can_edit_subject = $id == $cur_post['first_post_id']; if ($this->config['o_censoring'] == '1') { $cur_post['subject'] = censor_words($cur_post['subject']); $cur_post['message'] = censor_words($cur_post['message']); } // Do we have permission to edit this post? if (($this->user->g_edit_posts == '0' || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) { message($lang_common['No permission'], '403'); } if ($is_admmod && $this->user->g_id != FEATHER_ADMIN && in_array($cur_post['poster_id'], get_admin_ids())) { message($lang_common['No permission'], '403'); } // Load the post.php language file require FEATHER_ROOT . 'lang/' . $this->user->language . '/post.php'; // Load the bbeditor.php language file require FEATHER_ROOT . 'lang/' . $this->user->language . '/bbeditor.php'; // Start with a clean slate $errors = array(); if ($this->feather->request()->isPost()) { // Let's see if everything went right $errors = $this->model->check_errors_before_edit($id, $can_edit_subject, $errors); // Setup some variables before post $post = $this->model->setup_variables($cur_post, $is_admmod, $can_edit_subject, $errors); // Did everything go according to plan? if (empty($errors) && !$this->request->post('preview')) { // Edit the post $this->model->edit_post($id, $can_edit_subject, $post, $cur_post, $is_admmod); redirect(get_link('post/' . $id . '/#p' . $id), $lang_post['Post redirect']); } } else { $post = ''; } $page_title = array(feather_escape($this->config['o_board_title']), $lang_post['Edit post']); $required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']); $focus_element = array('edit', 'req_message'); define('FEATHER_ACTIVE_PAGE', 'edit'); $this->header->setTitle($page_title)->setFocusElement($focus_element)->setRequiredFields($required_fields)->display(); if ($this->request->post('preview')) { require_once FEATHER_ROOT . 'include/parser.php'; $preview_message = parse_message($post['message'], $post['hide_smilies']); } else { $preview_message = ''; } $this->feather->render('edit.php', array('lang_common' => $lang_common, 'cur_post' => $cur_post, 'lang_post' => $lang_post, 'errors' => $errors, 'preview_message' => $preview_message, 'id' => $id, 'feather_config' => $this->config, 'feather_user' => $this->user, 'checkboxes' => $this->model->get_checkboxes($can_edit_subject, $is_admmod, $cur_post, 1), 'feather' => $this->feather, 'can_edit_subject' => $can_edit_subject, 'post' => $post, 'lang_bbeditor' => $lang_bbeditor)); $this->footer->display(); }
function evgs_item_div($topic_id) { global $db, $pun_user, $pun_config, $lang_topic, $lang_common; $result = $db->query('SELECT * FROM ' . $db->prefix . 'glossary_items WHERE topic_id=' . $topic_id) or error('Could not fetch glossary item info', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { return; } $cur_gloss = $db->fetch_assoc($result); $cur_gloss['description'] = parse_message($cur_gloss['description'], '1'); $username = '******' . $cur_gloss['user_id'] . '">' . pun_htmlspecialchars($cur_gloss['username']) . '</a>'; show_gloss_item($cur_gloss, 'viewtopic'); }
public function view() { if (isset($this->id)) { if (FALSE === ($user_rep = $this->reputation->get_by_id($this->id))) { message(App::$lang_common['Bad request']); } // Fix notice for fancy_video global $smilies, $forum_user, $ext_info; if (!defined('FORUM_PARSER_LOADED')) { require FORUM_ROOT . 'include/parser.php'; } $user_rep['reason'] = parse_message($user_rep['reason'], 0); App::send_json(array('message' => $user_rep['reason'])); } if (FALSE === ($user_rep = $this->reputation->get_user($this->uid))) { message(App::$lang_common['Bad request']); } App::$forum_page['form_action'] = forum_link(App::$forum_url['reputation_delete'], $this->uid); View::$instance = View::factory($this->view . 'view', array('heading' => sprintf(App::$lang['User reputation'], forum_htmlencode($user_rep['username'])) . ' <strong>[+' . $user_rep['count_rep_plus'] . ' / -' . $user_rep['count_rep_minus'] . '] </strong>')); $count = $this->reputation->count_by_user_id($this->uid); if ($count > 0) { // Fix notice for fancy_video global $smilies, $forum_user, $ext_info; if (!defined('FORUM_PARSER_LOADED')) { require FORUM_ROOT . 'include/parser.php'; } App::paginate($count, App::$forum_user['disp_topics'], App::$forum_url['reputation_view'], array($this->uid)); if (App::$forum_user['g_id'] == FORUM_ADMIN) { /* * Fix table layout described on: http://punbb.ru/post31786.html#p31786 */ App::$forum_loader->add_css('#brd-reputation table{table-layout:inherit;}', array('type' => 'inline')); $template = 'view_admin'; } else { $template = 'view_user'; } View::$instance->content = View::factory($this->view . $template, array('records' => $this->reputation->get_info($this->uid, App::$forum_user['g_id'], App::$forum_page['start_from'], App::$forum_page['finish_at']))); } else { View::$instance->content = View::factory($this->view . 'view_empty', array('lang' => App::$lang)); } App::$forum_page['crumbs'][] = array(sprintf(App::$lang['User reputation'], forum_htmlencode($user_rep['username'])), forum_link(App::$forum_url['reputation_view'], $this->uid)); }
} // Load cached feed if (isset($cache_id) && file_exists(FORUM_CACHE_DIR . 'cache_' . $cache_id . '.php')) { include FORUM_CACHE_DIR . 'cache_' . $cache_id . '.php'; } $now = time(); if (!isset($feed) || $cache_expire < $now) { // Setup the feed $feed = array('title' => $luna_config['o_board_title'] . $forum_name, 'link' => '/index.php', 'description' => sprintf(__('The most recent threads at %s.', 'luna'), $luna_config['o_board_title']), 'items' => array(), 'type' => 'topics'); // Fetch $show topics $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_poster, p.message, p.hide_smilies, u.email_setting, u.email, p.poster_id, p.poster_email FROM ' . $db->prefix . 'topics AS t INNER JOIN ' . $db->prefix . 'posts AS p ON p.id=' . ($order_posted ? 't.first_post_id' : 't.last_post_id') . ' INNER JOIN ' . $db->prefix . 'users AS u ON u.id=p.poster_id LEFT JOIN ' . $db->prefix . 'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id=' . $luna_user['g_id'] . ') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL' . $forum_sql . ' ORDER BY ' . ($order_posted ? 't.posted' : 't.last_post') . ' DESC LIMIT ' . (isset($cache_id) ? 50 : $show)) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); while ($cur_topic = $db->fetch_assoc($result)) { if ($luna_config['o_censoring'] == '1') { $cur_topic['subject'] = censor_words($cur_topic['subject']); } $cur_topic['message'] = parse_message($cur_topic['message']); $item = array('id' => $cur_topic['id'], 'title' => $cur_topic['subject'], 'link' => '/viewtopic.php?id=' . $cur_topic['id'] . ($order_posted ? '' : '&action=new'), 'description' => $cur_topic['message'], 'author' => array('name' => $order_posted ? $cur_topic['poster'] : $cur_topic['last_poster']), 'pubdate' => $order_posted ? $cur_topic['posted'] : $cur_topic['last_post']); if ($cur_topic['poster_id'] > 1) { if ($cur_topic['email_setting'] == '0' && !$luna_user['is_guest']) { $item['author']['email'] = $cur_topic['email']; } $item['author']['uri'] = '/profile.php?id=' . $cur_topic['poster_id']; } elseif ($cur_topic['poster_email'] != '' && !$luna_user['is_guest']) { $item['author']['email'] = $cur_topic['poster_email']; } $feed['items'][] = $item; } // Output feed as PHP code if (isset($cache_id)) { if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) { require FORUM_ROOT . 'include/cache.php';
$forum_page['post_ident']['num'] = '<span class="post-num">' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span>'; $forum_page['post_ident']['byline'] = '<span class="post-byline">' . sprintf($cur_set['pid'] == $cur_set['first_post_id'] ? $lang_topic['Topic byline'] : $lang_topic['Reply byline'], '<strong>' . forum_htmlencode($cur_set['pposter']) . '</strong>') . '</span>'; $forum_page['post_ident']['link'] = '<span class="post-link"><a class="permalink" rel="bookmark" title="' . $lang_topic['Permalink post'] . '" href="' . forum_link($forum_url['post'], $cur_set['pid']) . '">' . format_time($cur_set['pposted']) . '</a></span>'; ($hook = get_hook('se_results_posts_row_pre_item_ident_merge')) ? eval($hook) : null; // Generate the topic title $forum_page['item_subject'] = '<a class="permalink" rel="bookmark" title="' . $lang_topic['Permalink topic'] . '" href="' . forum_link($forum_url['topic'], array($cur_set['tid'], sef_friendly($cur_set['subject']))) . '">' . sprintf($cur_set['pid'] == $cur_set['first_post_id'] ? $lang_topic['Topic title'] : $lang_topic['Reply title'], forum_htmlencode($cur_set['subject'])) . '</a> <small>' . sprintf($lang_topic['Search replies'], forum_number_format($cur_set['num_replies']), '<a href="' . forum_link($forum_url['forum'], array($cur_set['forum_id'], sef_friendly($cur_set['forum_name']))) . '">' . forum_htmlencode($cur_set['forum_name']) . '</a>') . '</small>'; // Generate author identification $forum_page['user_ident'] = $cur_set['poster_id'] > 1 && $forum_user['g_view_users'] == '1' ? '<strong class="username"><a title="' . sprintf($lang_search['Go to profile'], forum_htmlencode($cur_set['pposter'])) . '" href="' . forum_link($forum_url['user'], $cur_set['poster_id']) . '">' . forum_htmlencode($cur_set['pposter']) . '</a></strong>' : '<strong class="username">' . forum_htmlencode($cur_set['pposter']) . '</strong>'; // Generate the post actions links $forum_page['post_actions'] = array(); $forum_page['post_actions']['forum'] = '<span><a href="' . forum_link($forum_url['forum'], array($cur_set['forum_id'], sef_friendly($cur_set['forum_name']))) . '">' . $lang_search['Go to forum'] . '<span>: ' . forum_htmlencode($cur_set['forum_name']) . '</span></a></span>'; if ($cur_set['pid'] != $cur_set['first_post_id']) { $forum_page['post_actions']['topic'] = '<span><a class="permalink" rel="bookmark" title="' . $lang_topic['Permalink topic'] . '" href="' . forum_link($forum_url['topic'], array($cur_set['tid'], sef_friendly($cur_set['subject']))) . '">' . $lang_search['Go to topic'] . '<span>: ' . forum_htmlencode($cur_set['subject']) . '</span></a></span>'; } $forum_page['post_actions']['post'] = '<span><a class="permalink" rel="bookmark" title="' . $lang_topic['Permalink post'] . '" href="' . forum_link($forum_url['post'], $cur_set['pid']) . '">' . $lang_search['Go to post'] . '<span> ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; $forum_page['message'] = parse_message($cur_set['message'], $cur_set['hide_smilies']); // Give the post some class $forum_page['item_status'] = array('post', $forum_page['item_count'] % 2 != 0 ? 'odd' : 'even'); if ($forum_page['item_count'] == 1) { $forum_page['item_status']['firstpost'] = 'firstpost'; } if ($forum_page['start_from'] + $forum_page['item_count'] == $forum_page['finish_at']) { $forum_page['item_status']['lastpost'] = 'lastpost'; } if ($cur_set['pid'] == $cur_set['first_post_id']) { $forum_page['item_status']['topicpost'] = 'topicpost'; } ($hook = get_hook('se_results_posts_row_pre_display')) ? eval($hook) : null; ?> <div class="<?php echo implode(' ', $forum_page['item_status']);
} // Load cached feed if (isset($cache_id) && file_exists(LUNA_CACHE_DIR . 'cache_' . $cache_id . '.php')) { include LUNA_CACHE_DIR . 'cache_' . $cache_id . '.php'; } $now = time(); if (!isset($feed) || $cache_expire < $now) { // Setup the feed $feed = array('title' => $luna_config['o_board_title'] . $forum_name, 'link' => '/index.php', 'description' => sprintf(__('The most recent threads at %s.', 'luna'), $luna_config['o_board_title']), 'items' => array(), 'type' => 'threads'); // Fetch $show threads $result = $db->query('SELECT t.id, t.commenter, t.subject, t.commented, t.last_comment, t.last_commenter, p.message, p.hide_smilies, u.email_setting, u.email, p.commenter_id, p.commenter_email FROM ' . $db->prefix . 'threads AS t INNER JOIN ' . $db->prefix . 'comments AS p ON p.id=' . ($order_commented ? 't.first_comment_id' : 't.last_comment_id') . ' INNER JOIN ' . $db->prefix . 'users AS u ON u.id=p.commenter_id LEFT JOIN ' . $db->prefix . 'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id=' . $luna_user['g_id'] . ') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL' . $forum_sql . ' ORDER BY ' . ($order_commented ? 't.commented' : 't.last_comment') . ' DESC LIMIT ' . (isset($cache_id) ? 50 : $show)) or error('Unable to fetch thread info', __FILE__, __LINE__, $db->error()); while ($cur_thread = $db->fetch_assoc($result)) { if ($luna_config['o_censoring'] == '1') { $cur_thread['subject'] = censor_words($cur_thread['subject']); } $cur_thread['message'] = parse_message($cur_thread['message']); $item = array('id' => $cur_thread['id'], 'title' => $cur_thread['subject'], 'link' => '/thread.php?id=' . $cur_thread['id'] . ($order_commented ? '' : '&action=new'), 'description' => $cur_thread['message'], 'author' => array('name' => $order_commented ? $cur_thread['commenter'] : $cur_thread['last_commenter']), 'pubdate' => $order_commented ? $cur_thread['commented'] : $cur_thread['last_comment']); if ($cur_thread['commenter_id'] > 1) { if ($cur_thread['email_setting'] == '0' && !$luna_user['is_guest']) { $item['author']['email'] = $cur_thread['email']; } $item['author']['uri'] = '/profile.php?id=' . $cur_thread['commenter_id']; } elseif ($cur_thread['commenter_email'] != '' && !$luna_user['is_guest']) { $item['author']['email'] = $cur_thread['commenter_email']; } $feed['items'][] = $item; } // Output feed as PHP code if (isset($cache_id)) { if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) { require LUNA_ROOT . 'include/cache.php';
function RenderBody() { global $main; foreach ($this->data as $c) { $rating = $c->rating>0 ? "rulez" : ($c->rating<0 ? "sucks" : ""); $p = $c->comment; $p = parse_message($p); $author = false; if (array_search($c->user->id,$this->credits)!==false) $author = true; echo "<div class='comment cite-".$c->user->id."".($author?" author":"")."' id='c".$c->id."'>\n"; echo " <div class='content'>".$p."</div>\n"; echo " <div class='foot'>\n"; if ($c->rating) echo "<span class='vote ".$rating."'>".$rating."</span>"; if ($main->userCDCs[$c->user->id]) { echo "<span class='vote cdc'>cdc</span>"; unset($main->userCDCs[$c->user->id]); } echo "<span class='tools' data-cid='".$c->id."'></span> added on the <a href='prod.php?post=".$c->id."'>".$c->addedDate."</a> by "; echo $c->user->PrintLinkedName()." ".$c->user->PrintLinkedAvatar(); echo "</div>\n"; echo "</div>\n"; } $this->paginator->RenderNavbar(); }
} if ($show_as == 'posts') { ++$post_count; $icon_type = 'icon'; if (!$pun_user['is_guest'] && $cur_search['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_search['tid']]) || $tracked_topics['topics'][$cur_search['tid']] < $cur_search['last_post']) && (!isset($tracked_topics['forums'][$cur_search['forum_id']]) || $tracked_topics['forums'][$cur_search['forum_id']] < $cur_search['last_post'])) { $item_status = 'inew'; $icon_type = 'icon icon-new'; $icon_text = $lang_topic['New icon']; } else { $item_status = ''; $icon_text = '<!-- -->'; } if ($pun_config['o_censoring'] == '1') { $cur_search['message'] = censor_words($cur_search['message']); } $message = parse_message($cur_search['message'], $cur_search['hide_smilies']); $pposter = pun_htmlspecialchars($cur_search['pposter']); if ($cur_search['poster_id'] > 1) { if ($pun_user['g_view_users'] == '1') { $pposter = '<strong><a href="profile.php?id=' . $cur_search['poster_id'] . '">' . $pposter . '</a></strong>'; } else { $pposter = '<strong>' . $pposter . '</strong>'; } } ?> <div class="blockpost<?php echo $post_count % 2 == 0 ? ' roweven' : ' rowodd'; if ($cur_search['pid'] == $cur_search['first_post_id']) { echo ' firstpost'; } if ($post_count == 1) {
public function display_posts_view($tid, $start_from) { global $pd, $lang_topic; $post_data = array(); require FEATHER_ROOT . 'include/parser.php'; $post_count = 0; // Keep track of post numbers // Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data $find_ids = DB::for_table('posts')->select('id')->where('topic_id', $tid)->order_by('id')->limit($this->user->disp_posts)->offset($start_from)->find_many(); foreach ($find_ids as $id) { $post_ids[] = $id['id']; } // Retrieve the posts (and their respective poster) $select_display_posts_view = array('u.title', 'u.num_posts', 'g.g_id', 'g.g_user_title', 'p.id', 'p.poster', 'p.poster_id', 'p.message', 'p.hide_smilies', 'p.posted', 'p.edited', 'p.edited_by'); $result = DB::for_table('posts')->table_alias('p')->select_many($select_display_posts_view)->inner_join('users', array('u.id', '=', 'p.poster_id'), 'u')->inner_join('groups', array('g.g_id', '=', 'u.group_id'), 'g')->where_in('p.id', $post_ids)->order_by('p.id')->find_many(); foreach ($result as $cur_post) { $post_count++; // If the poster is a registered user if ($cur_post->poster_id > 1) { if ($this->user->g_view_users == '1') { $cur_post->poster_disp = '<a href="' . get_link('user/' . $cur_post->poster_id . '/') . '">' . feather_escape($cur_post->poster) . '</a>'; } else { $cur_post->poster_disp = feather_escape($cur_post->poster); } // get_title() requires that an element 'username' be present in the array $cur_post->username = $cur_post->poster; $cur_post->user_title = get_title($cur_post); if ($this->config['o_censoring'] == '1') { $cur_post->user_title = censor_words($cur_post->user_title); } } else { $cur_post->poster_disp = feather_escape($cur_post->poster); $cur_post->user_title = $lang_topic['Guest']; } // Perform the main parsing of the message (BBCode, smilies, censor words etc) $cur_post->message = parse_message($cur_post->message, $cur_post->hide_smilies); $post_data[] = $cur_post; } return $post_data; }
<ul> <?php while (list(, $cur_error) = each($errors)) { echo "\t\t\t\t" . '<li><strong>' . $cur_error . '</strong></li>' . "\n"; } ?> </ul> </div> </div> </div> <?php } else { if (isset($_POST['preview'])) { require_once PUN_ROOT . 'include/parser.php'; $preview_message = parse_message($p_message, !$smilies); ?> <div id="postpreview" class="blockpost"> <h2><span><?php echo $lang_post['Post preview']; ?> </span></h2> <div class="box"> <div class="inbox"> <div class="postright"> <div class="postmsg"> <?php echo $preview_message . "\n"; ?> </div> </div>
_e('Post errors', 'luna'); ?> </h3> </div> <div class="panel-body"> <?php foreach ($errors as $cur_error) { echo "\t\t\t\t" . $cur_error . "\n"; } ?> </div> </div> <?php } elseif (isset($_POST['preview'])) { require_once FORUM_ROOT . 'include/parser.php'; $preview_message = parse_message($p_message); ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Post preview', 'luna'); ?> </h3> </div> <div class="panel-body"> <p><?php echo $preview_message . "\n"; ?> </p> </div> </div>
echo $id == $cur_post['first_post_id'] ? $lang_post['Edit topic'] : $lang_post['Edit reply']; ?> </span></h2> </div> <?php // If preview selected and there are no errors if (isset($_POST['preview']) && empty($forum_page['errors'])) { if (!defined('FORUM_PARSER_LOADED')) { require FORUM_ROOT . 'include/parser.php'; } // Generate the post heading $forum_page['post_ident'] = array(); $forum_page['post_ident']['num'] = '<span class="post-num">#</span>'; $forum_page['post_ident']['byline'] = '<span class="post-byline">' . sprintf($id == $cur_post['first_post_id'] ? $lang_post['Topic byline'] : $lang_post['Reply byline'], '<strong>' . forum_htmlencode($cur_post['poster']) . '</strong>') . '</span>'; $forum_page['post_ident']['link'] = '<span class="post-link">' . format_time(time()) . '</span>'; $forum_page['preview_message'] = parse_message($message, $hide_smilies); ($hook = get_hook('ed_preview_pre_display')) ? eval($hook) : null; ?> <div class="main-subhead"> <h2 class="hn"><span><?php echo $id == $cur_post['first_post_id'] ? $lang_post['Preview edited topic'] : $lang_post['Preview edited reply']; ?> </span></h2> </div> <div id="post-preview" class="main-content main-frm"> <div class="post singlepost"> <div class="posthead"> <h3 class="hn"><?php echo implode(' ', $forum_page['post_ident']); ?> </h3>
} } } if ($sf_user->getId() > 1 && $comment['poster_id'] > 1) { echo ' ' . f_link_to(__('PM'), 'message_send.php?id=' . $comment['poster_id'] . '&pid=' . $comment['id']); } ?> </dd> </dl> </div> <div class="postright"> <div class="postmsg"> <p> <?php $text = $comment->message; $text = parse_message($text, false, $post_id_list); $text = htmlspecialchars_decode($text, ENT_NOQUOTES); // parse_message always use html_special_chars, and so does retrieval of the text echo $text; ?> </p> </div> </div> <div class="clearer"></div> <div class="postfootright"> <ul><?php if ($sf_user->getId() > 1) { echo '<li class="postreport">' . f_link_to(__('Report'), 'misc.php?report=' . $comment->id) . ' | '; } else { echo '<li class="postreport">' . f_link_to(__('Report'), 'misc.php?email=' . sfConfig::get('app_moderator_forum_user_id') . '&doc=' . urlencode('/forums/viewtopic.php?pid=' . $comment->id . '#p' . $comment->id)) . ' | '; }
</p> <ul class="error-list"> <?php foreach ($errors as $cur_error) { echo "\t\t\t\t" . '<li><strong>' . $cur_error . '</strong></li>' . "\n"; } ?> </ul> </div> </div> </div> <?php } elseif ($feather->request->post('preview')) { require_once FEATHER_ROOT . 'include/parser.php'; $preview_message = parse_message($post['message'], $post['hide_smilies']); ?> <div id="postpreview" class="blockpost"> <h2><span><?php echo $lang_post['Post preview']; ?> </span></h2> <div class="box"> <div class="inbox"> <div class="postbody"> <div class="postright"> <div class="postmsg"> <?php echo $preview_message . "\n"; ?> </div>
function RenderContent() { echo parse_message( $_POST["message"] ); }
} // Setup the feed $feed = array('title' => $forum_config['o_board_title'] . $forum_name, 'link' => forum_link($forum_url['index']), 'description' => sprintf($lang_common['RSS description'], $forum_config['o_board_title']), 'items' => array(), 'type' => 'topics'); // Fetch $show topics $query = array('SELECT' => 't.id, t.poster, t.posted, t.subject, p.message, p.hide_smilies, u.email_setting, u.email, p.poster_id, p.poster_email', 'FROM' => 'topics AS t', 'JOINS' => array(array('INNER JOIN' => 'posts AS p', 'ON' => 'p.id = t.first_post_id'), array('INNER JOIN' => 'users AS u', 'ON' => 'u.id = p.poster_id'), array('LEFT JOIN' => 'forum_perms AS fp', 'ON' => '(fp.forum_id = t.forum_id AND fp.group_id = ' . $forum_user['g_id'] . ')')), 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum = 1) AND t.moved_to IS NULL', 'ORDER BY' => ($sort_by == 'last_post' ? 't.last_post' : 't.posted') . ' DESC', 'LIMIT' => $show); if (isset($forum_sql)) { $query['WHERE'] .= $forum_sql; } ($hook = get_hook('ex_qr_get_topics')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); while ($cur_topic = $forum_db->fetch_assoc($result)) { if ($forum_config['o_censoring'] == '1') { $cur_topic['subject'] = censor_words($cur_topic['subject']); $cur_topic['message'] = censor_words($cur_topic['message']); } $cur_topic['message'] = parse_message($cur_topic['message'], $cur_topic['hide_smilies']); $item = array('id' => $cur_topic['id'], 'title' => $cur_topic['subject'], 'link' => forum_link($forum_url['topic_new_posts'], array($cur_topic['id'], sef_friendly($cur_topic['subject']))), 'description' => $cur_topic['message'], 'author' => array('name' => $cur_topic['poster']), 'pubdate' => $cur_topic['posted']); if ($cur_topic['poster_id'] > 1) { if ($cur_topic['email_setting'] == '0' && !$forum_user['is_guest']) { $item['author']['email'] = $cur_topic['email']; } $item['author']['uri'] = forum_link($forum_url['user'], $cur_topic['poster_id']); } else { if ($cur_topic['poster_email'] != '' && !$forum_user['is_guest']) { $item['author']['email'] = $cur_topic['poster_email']; } } $feed['items'][] = $item; ($hook = get_hook('ex_modify_cur_topic_item')) ? eval($hook) : null; } ($hook = get_hook('ex_pre_forum_output')) ? eval($hook) : null;
function cleanup_inactive_users() { global $db, $prefix, $x7c; $warn_list = ''; $del_list = ''; $del_day = ''; $time = time(); // We do this check once per day $now = date("d/m/Y"); // We reset at 5 in the morning $before = date("d/m/Y", $x7c->settings['last_cleanup'] + 5 * 3600); if ($now == $before) { return; } update_daily_statistics(); $db->DoQuery("UPDATE {$prefix}settings SET setting = '{$time}' WHERE variable = 'last_cleanup'"); // Reset daily counters $db->DoQuery("UPDATE {$prefix}users SET daily_post = 0, daily_lotus = 0"); $db->DoQuery("UPDATE {$prefix}rooms SET daily_post = 0"); $db->DoQuery("UPDATE {$prefix}objects SET daily_use = 0"); //First we send wanring to old pg $exptime = time() - $x7c->settings['pg_expire_warn']; $query = $db->DoQuery("SELECT username, email FROM {$prefix}users WHERE exp_warn='0' AND time<'{$exptime}' AND frozen = 0 ORDER BY username"); while ($row = $db->Do_Fetch_Assoc($query)) { include_once './lib/message.php'; $db->DoQuery("UPDATE {$prefix}users SET exp_warn='1' WHERE username='******'username']}'"); $warn_list .= $row['username'] . "\n"; $warn_day = $x7c->settings['pg_expire_warn'] / (24 * 3600); $del_day = ($x7c->settings['pg_expire'] - $x7c->settings['pg_expire_warn']) / (24 * 3600); $obj = "Avviso imminente cancellazione account"; $body = "Attenzione, l\\'account {$row['username']} risulta inativo da {$warn_day} giorni. Se non to colleghi entro {$del_day} giorni sara\\' cancellato senza ulteriore avviso"; mail($row['email'], $obj, "{$body}\r\n", "From: {$x7c->settings['site_name']} <{$x7c->settings['admin_email']}>\r\n" . "Reply-To: {$x7c->settings['admin_email']}\r\n" . "X-Mailer: PHP/" . phpversion()); $body = parse_message($body); } //First we send wanring to old pg $exptime = time() - $x7c->settings['pg_expire']; $query = $db->DoQuery("SELECT username, email FROM {$prefix}users WHERE time<'{$exptime}' AND frozen = 0 ORDER BY username"); while ($row = $db->Do_Fetch_Assoc($query)) { delete_user($row['username']); $del_list .= $row['username'] . "\n"; } if ($warn_list != '' || $del_list != '') { $admin = $x7c->settings['usergroup_admin']; $query = $db->DoQuery("SELECT username FROM {$prefix}groups WHERE usergroup='{$admin}'"); include_once './lib/message.php'; $obj = "Avviso cancellazione pg"; $body = ''; if ($warn_list != '') { $body .= "I seguenti account saranno automaticamente rimossi tra {$del_day} giorni\n" . $warn_list . "\n\n"; } if ($del_list != '') { $body .= "I seguenti account sono stati automaticamente rimossi\n" . $del_list . "\n\n"; } $body = parse_message($body); while ($row = $db->Do_Fetch_Assoc($query)) { send_offline_msg($row['username'], $obj, $body, "Buio"); } } }
public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod) { global $lang_topic, $lang_common, $pd; $post_data = array(); $post_count = 0; // Keep track of post numbers // Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data $result = DB::for_table('posts')->select('id')->where('topic_id', $topic_id)->order_by('id')->limit($this->user->disp_topics)->offset($start_from)->find_many(); $post_ids = array(); foreach ($result as $cur_post_id) { $post_ids[] = $cur_post_id['id']; } if (empty($post_ids)) { error('The post table and topic table seem to be out of sync!', __FILE__, __LINE__); } // Retrieve the posts (and their respective poster/online status) $select_print_posts = array('u.email', 'u.title', 'u.url', 'u.location', 'u.signature', 'u.email_setting', 'u.num_posts', 'u.registered', 'u.admin_note', 'p.id', 'username' => 'p.poster', 'p.poster_id', 'p.poster_ip', 'p.poster_email', 'p.message', 'p.hide_smilies', 'p.posted', 'p.edited', 'p.edited_by', 'g.g_id', 'g.g_user_title', 'g.g_promote_next_group', 'is_online' => 'o.user_id'); $result = DB::for_table('posts')->table_alias('p')->select_many($select_print_posts)->inner_join('users', array('u.id', '=', 'p.poster_id'), 'u')->inner_join('groups', array('g.g_id', '=', 'u.group_id'), 'g')->raw_join('LEFT OUTER JOIN ' . $this->feather->prefix . 'online', "o.user_id!=1 AND o.idle=0 AND o.user_id=u.id", 'o')->where_in('p.id', $post_ids)->order_by('p.id')->find_array(); foreach ($result as $cur_post) { $post_count++; $cur_post['user_avatar'] = ''; $cur_post['user_info'] = array(); $cur_post['user_contacts'] = array(); $cur_post['post_actions'] = array(); $cur_post['is_online_formatted'] = ''; $cur_post['signature_formatted'] = ''; // If the poster is a registered user if ($cur_post['poster_id'] > 1) { if ($this->user->g_view_users == '1') { $cur_post['username_formatted'] = '<a href="' . get_base_url() . '/user/' . $cur_post['poster_id'] . '/">' . feather_escape($cur_post['username']) . '</a>'; } else { $cur_post['username_formatted'] = feather_escape($cur_post['username']); } $cur_post['user_title_formatted'] = get_title($cur_post); if ($this->config['o_censoring'] == '1') { $cur_post['user_title_formatted'] = censor_words($cur_post['user_title_formatted']); } // Format the online indicator $cur_post['is_online_formatted'] = $cur_post['is_online'] == $cur_post['poster_id'] ? '<strong>' . $lang_topic['Online'] . '</strong>' : '<span>' . $lang_topic['Offline'] . '</span>'; if ($this->config['o_avatars'] == '1' && $this->user->show_avatars != '0') { if (isset($avatar_cache[$cur_post['poster_id']])) { $cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']]; } else { $cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']] = generate_avatar_markup($cur_post['poster_id']); } } // We only show location, register date, post count and the contact links if "Show user info" is enabled if ($this->config['o_show_user_info'] == '1') { if ($cur_post['location'] != '') { if ($this->config['o_censoring'] == '1') { $cur_post['location'] = censor_words($cur_post['location']); } $cur_post['user_info'][] = '<dd><span>' . $lang_topic['From'] . ' ' . feather_escape($cur_post['location']) . '</span></dd>'; } $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Registered'] . ' ' . format_time($cur_post['registered'], true) . '</span></dd>'; if ($this->config['o_show_post_count'] == '1' || $this->user->is_admmod) { $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Posts'] . ' ' . forum_number_format($cur_post['num_posts']) . '</span></dd>'; } // Now let's deal with the contact links (Email and URL) if (($cur_post['email_setting'] == '0' && !$this->user->is_guest || $this->user->is_admmod) && $this->user->g_send_email == '1') { $cur_post['user_contacts'][] = '<span class="email"><a href="mailto:' . feather_escape($cur_post['email']) . '">' . $lang_common['Email'] . '</a></span>'; } elseif ($cur_post['email_setting'] == '1' && !$this->user->is_guest && $this->user->g_send_email == '1') { $cur_post['user_contacts'][] = '<span class="email"><a href="' . get_link('mail/' . $cur_post['poster_id'] . '/') . '">' . $lang_common['Email'] . '</a></span>'; } if ($cur_post['url'] != '') { if ($this->config['o_censoring'] == '1') { $cur_post['url'] = censor_words($cur_post['url']); } $cur_post['user_contacts'][] = '<span class="website"><a href="' . feather_escape($cur_post['url']) . '" rel="nofollow">' . $lang_topic['Website'] . '</a></span>'; } } if ($this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && $this->user->g_mod_promote_users == '1') { if ($cur_post['g_promote_next_group']) { $cur_post['user_info'][] = '<dd><span><a href="' . get_base_url() . '/user/' . $cur_post['poster_id'] . '/action/promote/pid/' . $cur_post['id'] . '">' . $lang_topic['Promote user'] . '</a></span></dd>'; } } if ($this->user->is_admmod) { $cur_post['user_info'][] = '<dd><span><a href="' . get_link('moderate/get-host/post/' . $cur_post['id'] . '/') . '" title="' . feather_escape($cur_post['poster_ip']) . '">' . $lang_topic['IP address logged'] . '</a></span></dd>'; if ($cur_post['admin_note'] != '') { $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Note'] . ' <strong>' . feather_escape($cur_post['admin_note']) . '</strong></span></dd>'; } } } else { $cur_post['username_formatted'] = feather_escape($cur_post['username']); $cur_post['user_title_formatted'] = get_title($cur_post); if ($this->user->is_admmod) { $cur_post['user_info'][] = '<dd><span><a href="moderate.php?get_host=' . $cur_post['id'] . '" title="' . feather_escape($cur_post['poster_ip']) . '">' . $lang_topic['IP address logged'] . '</a></span></dd>'; } if ($this->config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$this->user->is_guest && $this->user->g_send_email == '1') { $cur_post['user_contacts'][] = '<span class="email"><a href="mailto:' . feather_escape($cur_post['poster_email']) . '">' . $lang_common['Email'] . '</a></span>'; } } // Generation post action array (quote, edit, delete etc.) if (!$is_admmod) { if (!$this->user->is_guest) { $cur_post['post_actions'][] = '<li class="postreport"><span><a href="' . get_link('report/' . $cur_post['id'] . '/') . '">' . $lang_topic['Report'] . '</a></span></li>'; } if ($cur_topic['closed'] == '0') { if ($cur_post['poster_id'] == $this->user->id) { if ($start_from + $post_count == 1 && $this->user->g_delete_topics == '1' || $start_from + $post_count > 1 && $this->user->g_delete_posts == '1') { $cur_post['post_actions'][] = '<li class="postdelete"><span><a href="' . get_link('edit/' . $cur_post['id'] . '/') . '">' . $lang_topic['Delete'] . '</a></span></li>'; } if ($this->user->g_edit_posts == '1') { $cur_post['post_actions'][] = '<li class="postedit"><span><a href="' . get_link('edit/' . $cur_post['id'] . '/') . '">' . $lang_topic['Edit'] . '</a></span></li>'; } } if ($cur_topic['post_replies'] == '' && $this->user->g_post_replies == '1' || $cur_topic['post_replies'] == '1') { $cur_post['post_actions'][] = '<li class="postquote"><span><a href="' . get_link('post/reply/' . $topic_id . '/quote/' . $cur_post['id'] . '/') . '">' . $lang_topic['Quote'] . '</a></span></li>'; } } } else { $cur_post['post_actions'][] = '<li class="postreport"><span><a href="' . get_link('report/' . $cur_post['id'] . '/') . '">' . $lang_topic['Report'] . '</a></span></li>'; if ($this->user->g_id == FEATHER_ADMIN || !in_array($cur_post['poster_id'], $admin_ids)) { $cur_post['post_actions'][] = '<li class="postdelete"><span><a href="' . get_link('delete/' . $cur_post['id'] . '/') . '">' . $lang_topic['Delete'] . '</a></span></li>'; $cur_post['post_actions'][] = '<li class="postedit"><span><a href="' . get_link('edit/' . $cur_post['id'] . '/') . '">' . $lang_topic['Edit'] . '</a></span></li>'; } $cur_post['post_actions'][] = '<li class="postquote"><span><a href="' . get_link('post/reply/' . $topic_id . '/quote/' . $cur_post['id'] . '/') . '">' . $lang_topic['Quote'] . '</a></span></li>'; } // Perform the main parsing of the message (BBCode, smilies, censor words etc) $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']); // Do signature parsing/caching if ($this->config['o_signatures'] == '1' && $cur_post['signature'] != '' && $this->user->show_sig != '0') { if (isset($avatar_cache[$cur_post['poster_id']])) { $cur_post['signature_formatted'] = $avatar_cache[$cur_post['poster_id']]; } else { $cur_post['signature_formatted'] = parse_signature($cur_post['signature']); $avatar_cache[$cur_post['poster_id']] = $cur_post['signature_formatted']; } } $post_data[] = $cur_post; } return $post_data; }
} $post_actions[] = '<li><a href="message_delete.php?id=' . $cur_post['mid'] . '&box=' . $box . '&p=' . $p . '">' . $lang_pms['Delete'] . '</a>'; if (!$status) { $post_actions[] = '<li><a href="message_send.php?id=' . $cur_post['id'] . '&quote=' . $cur_post['mid'] . '">' . $lang_pms['Quote'] . '</a>'; } } else { $result = $db->query('SELECT id,sender,message,posted FROM ' . $db->prefix . 'messages WHERE id=' . $id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error()); $cur_post = $db->fetch_assoc($result); $username = pun_htmlspecialchars($cur_post['sender']); $user_title = 'Deleted User'; $post_actions[] = '<li><a href="message_delete.php?id=' . $cur_post['id'] . '&box=' . $box . '&p=' . $p . '">' . $lang_pms['Delete'] . '</a>'; $is_online = $lang_topic['Offline']; } // Perform the main parsing of the message (BBCode, smilies, censor words etc) $cur_post['smileys'] = isset($cur_post['smileys']) ? $cur_post['smileys'] : $pun_user['show_smilies']; $cur_post['message'] = parse_message($cur_post['message'], !$cur_post['smileys']); // Do signature parsing/caching if (isset($cur_post['signature']) && $pun_user['show_sig']) { $signature = parse_signature($cur_post['signature']); } ?> <div id="p<?php echo $cur_post['id']; ?> " class="blockpost row_odd firstpost" style="margin-left: 14em;"> <h2><span><?php echo format_time($cur_post['posted']); ?> </span></h2> <div class="box">
function RenderBody() { global $POSTS_PER_PAGE; global $THREAD_CATEGORIES; global $currentUser; echo "<div class='threadcategory'>"; echo "<b>category:</b> "._html($this->topic->category); if ($currentUser && $currentUser->CanEditBBS()) { printf(" [<a href='admin_topic_edit.php?which=%d' class='adminlink'>edit</a>]\n",$this->id); } printf(" [<a href='gloperator_log.php?which=%d&what=topic'>glöplog</a>]\n",$this->id); echo "</div>\n"; if ($this->postcount > $POSTS_PER_PAGE) { echo $this->paginator->RenderNavbar(); } else { echo "<div class='blank'> </div>\n"; } foreach ($this->posts as $c) { $p = $c->post; $p = parse_message($p); echo "<div class='content cite-".$c->user->id."' id='c".$c->id."'>".$p."</div>\n"; echo "<div class='foot'><span class='tools' data-cid='".$c->id."'></span> added on the <a href='topic.php?post=".$c->id."'>".$c->added."</a> by ". $c->user->PrintLinkedName()." ".$c->user->PrintLinkedAvatar()."</div>\n\n"; } if ($this->postcount > $POSTS_PER_PAGE) { echo $this->paginator->RenderNavbar(); } }
$script .= "\n\nwindow.parent.location='./index.php?act=panic&dump={$query}&source=/sources/frame.php:144';\n\n"; } while ($row = $db->Do_Fetch_Row($query)) { if (!in_array($row[0], $x7c->profile['ignored'])) { $row[2] = eregi_replace("'", "\\'", $row[2]); if ($row[1] == 1) { $row[2] = parse_message($row[2]); // See if they want a timestamp if ($x7c->settings['disble_timestamp'] != 1) { $timestamp = format_timestamp($row[3]); } else { $timestamp = ""; } $script .= "window.parent.frames['middle_left'].document.write('<span class=\"other_persons\"><a class=\"other_persons\" onClick=\"javascript: window.open(\\'index.php?act=pm&send_to={$row['0']}\\',\\'Pm{$row['0']}\\',\\'location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes,width={$x7c->settings['tweak_window_large_width']},height={$x7c->settings['tweak_window_large_height']}\\');\">{$row['0']}</a>{$timestamp}:</span> {$row['2']}<br>');\r\n"; } elseif ($row[1] == 2 || $row[1] == 3 || $row[1] == 4) { $row[2] = parse_message($row[2], 1); //$script .= "alert('$row[1] is what got u and $row[0] is who duunit');\r\n"; $script .= "window.parent.frames['middle_left'].document.write('{$row['2']}<br>');\r\n"; } elseif ($row[1] == 6) { $PM_COUNT++; } elseif ($row[1] == 5) { $script .= "window.open('index.php?act=pm&send_to={$row['0']}','Pm{$row['0']}','location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes,width={$x7c->settings['tweak_window_large_width']},height={$x7c->settings['tweak_window_large_height']}');\r\n"; $txt[511] = eregi_replace("<a>", "<a style=\"cursor: hand;cursor: pointer;\" onClick=\"window.open(\\'index.php?act=pm&send_to={$row['0']}\\',\\'Pm{$row['0']}\\',\\'location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes,width={$x7c->settings['tweak_window_large_width']},height={$x7c->settings['tweak_window_large_height']}\\');\">", $txt[511]); $script .= "window.parent.frames['middle_left'].document.write('<span style=\"color: {$sysmsg_color};font-size: {$default_size}; font-family: {$default_font};\"><b>{$txt['511']}</b></span><Br>')\r\n"; } $messages++; } } } if ($messages != 0) { /*$script .= '
function draw_response_list() { global $result, $db, $luna_config, $id, $comment_ids, $is_admmod, $start_from, $comment_count, $admin_ids, $luna_user, $inbox; while ($cur_comment = $db->fetch_assoc($result)) { $comment_count++; $user_avatar = ''; $user_info = array(); $user_contacts = array(); $comment_actions = array(); $is_online = ''; $signature = ''; // If the commenter is a registered user if ($cur_comment['id']) { if ($luna_user['g_view_users'] == '1') { $username = '******' . $cur_comment['sender_id'] . '">' . luna_htmlspecialchars($cur_comment['sender']) . '</a>'; } else { $username = luna_htmlspecialchars($cur_comment['sender']); } $user_title = get_title($cur_comment); if ($luna_config['o_censoring'] == '1') { $user_title = censor_words($user_title); } // Format the online indicator $is_online = $cur_comment['is_online'] == $cur_comment['sender_id'] ? '<strong>' . __('Online:', 'luna') . '</strong>' : '<span>' . __('Offline', 'luna') . '</span>'; if ($luna_config['o_avatars'] == '1' && $luna_user['show_avatars'] != '0') { if (isset($user_avatar_cache[$cur_comment['sender_id']])) { $user_avatar = $user_avatar_cache[$cur_comment['sender_id']]; } else { $user_avatar = $user_avatar_cache[$cur_comment['sender_id']] = generate_avatar_markup($cur_comment['sender_id']); } } // We only show location, register date, comment count and the contact links if "Show user info" is enabled if ($luna_config['o_show_user_info'] == '1') { if ($cur_comment['location'] != '') { if ($luna_config['o_censoring'] == '1') { $cur_comment['location'] = censor_words($cur_comment['location']); } $user_info[] = '<dd><span>' . __('From:', 'luna') . ' ' . luna_htmlspecialchars($cur_comment['location']) . '</span></dd>'; } $user_info[] = '<dd><span>' . __('Registered since', 'luna') . ' ' . format_time($cur_comment['registered'], true) . '</span></dd>'; if ($luna_config['o_show_comment_count'] == '1' || $luna_user['is_admmod']) { $user_info[] = '<dd><span>' . __('Comments:', 'luna') . ' ' . forum_number_format($cur_comment['num_comments']) . '</span></dd>'; } // Now let's deal with the contact links (Email and URL) if (($cur_comment['email_setting'] == '0' && !$luna_user['is_guest'] || $luna_user['is_admmod']) && $luna_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="mailto:' . $cur_comment['email'] . '">' . __('Email', 'luna') . '</a></span>'; } elseif ($cur_comment['email_setting'] == '1' && !$luna_user['is_guest'] && $luna_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="misc.php?email=' . $cur_comment['sender_id'] . '">' . __('Email', 'luna') . '</a></span>'; } if ($luna_config['o_enable_inbox'] == '1' && !$luna_user['is_guest'] && $luna_user['g_inbox'] == '1' && $luna_user['use_inbox'] == '1' && $cur_comment['use_inbox'] == '1') { $pid = isset($cur_comment['sender_id']) ? $cur_comment['sender_id'] : $cur_comment['sender_id']; $user_contacts[] = '<span class="email"><a href="new_inbox.php?uid=' . $pid . '">' . __('PM', 'luna') . '</a></span>'; } if ($cur_comment['url'] != '') { $user_contacts[] = '<span class="website"><a href="' . luna_htmlspecialchars($cur_comment['url']) . '">' . __('Website', 'luna') . '</a></span>'; } } if ($luna_user['is_admmod']) { $user_info[] = '<dd><span><a href="backstage/moderate.php?get_host=' . $cur_comment['sender_ip'] . '" title="' . $cur_comment['sender_ip'] . '">' . __('IP log', 'luna') . '</a></span></dd>'; if ($cur_comment['admin_note'] != '') { $user_info[] = '<dd><span>' . __('Note:', 'luna') . ' <strong>' . luna_htmlspecialchars($cur_comment['admin_note']) . '</strong></span></dd>'; } } } else { // If the commenter is a guest (or a user that has been deleted) $username = luna_htmlspecialchars($cur_comment['username']); $user_title = get_title($cur_comment); if ($luna_user['is_admmod']) { $user_info[] = '<dd><span><a href="backstage/moderate.php?get_host=' . $cur_comment['sender_id'] . '" title="' . $cur_comment['sender_ip'] . '">' . __('IP log', 'luna') . '</a></span></dd>'; } if ($luna_config['o_show_user_info'] == '1' && $cur_comment['commenter_email'] != '' && !$luna_user['is_guest'] && $luna_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="mailto:' . $cur_comment['commenter_email'] . '">' . __('Email', 'luna') . '</a></span>'; } } $username_quickreply = luna_htmlspecialchars($cur_comment['username']); $comment_actions[] = '<a href="new_inbox.php?reply=' . $cur_comment['shared_id'] . '&quote=' . $cur_comment['mid'] . '">' . __('Quote', 'luna') . '</a>'; // Perform the main parsing of the message (BBCode, smilies, censor words etc) $cur_comment['message'] = parse_message($cur_comment['message']); // Do signature parsing/caching if ($luna_config['o_signatures'] == '1' && $cur_comment['signature'] != '' && $luna_user['show_sig'] != '0') { if (isset($signature_cache[$cur_comment['id']])) { $signature = $signature_cache[$cur_comment['id']]; } else { $signature = parse_signature($cur_comment['signature']); $signature_cache[$cur_comment['id']] = $signature; } } require get_view_path('comment.php'); } }
require LUNA_ROOT . 'include/search_idx.php'; if ($is_thread_comment) { // Delete the thread and all of its comments delete_thread($cur_comment['tid'], "hard"); update_forum($cur_comment['fid']); redirect('viewforum.php?id=' . $cur_comment['fid']); } else { // Delete just this one comment delete_comment($id, $cur_comment['tid'], $cur_comment['commenter_id']); update_forum($cur_comment['fid']); // Redirect towards the previous comment $result = $db->query('SELECT id FROM ' . $db->prefix . 'comments WHERE thread_id=' . $cur_comment['tid'] . ' AND id < ' . $id . ' ORDER BY id DESC LIMIT 1') or error('Unable to fetch comment info', __FILE__, __LINE__, $db->error()); $comment_id = $db->result($result); redirect('thread.php?pid=' . $comment_id . '#p' . $comment_id); } } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Delete comment', 'luna')); define('LUNA_ACTIVE_PAGE', 'delete'); require LUNA_ROOT . 'include/parser.php'; $cur_comment['message'] = parse_message($cur_comment['message']); require load_page('header.php'); if ($action == "reset") { require load_page('reset.php'); } if ($action == "soft") { require load_page('soft.php'); } if ($action == "delete") { require load_page('delete.php'); } require load_page('footer.php');
$query = "SELECT category_title FROM category WHERE page_id = '" . $page_id . "' AND category_id = '{$category_id}'"; $result = fn_query($conn_id, $query); while ($rows = fn_fetch_array($result)) { extract($rows, EXTR_OVERWRITE); } $query = "\r\nSELECT \r\n\tnote_pangkas, note_id, note_images,\r\n\tnote_date,\r\n\tnote_title,\r\n\tnote_description,\r\n\tcase \r\n\t\twhen note_special = 'true' then 'Yes'\r\n\t\telse 'No' \r\n\tend as popup_status,\r\n\tcase \r\n\t\twhen note_user != 0 then 'Member'\r\n\t\telse 'Public' \r\n\tend as note_reader\r\nFROM \r\n\tnote \r\nWHERE\r\n\tcategory_id = '{$category_id}' \r\nORDER BY \r\n\tnote_date desc,\r\n\tnote_id desc\r\n"; //$row_count = 5; require_once "../library/paging_script.php"; $result = fn_query($conn_id, $query); if (!$result) { die("Err :<br>" . mysql_error()); } while ($rows = fn_fetch_array($result)) { $no++; extract($rows, EXTR_OVERWRITE); if ($note_pangkas == 1) { $note_text = proc_pangkastext($note_text, 250); } if ($note_images) { $note_images = "../{$note_path}/t-{$note_images}"; } else { $note_images = "../library/pixel.gif"; } $hide_smilies = 1; $note_text = parse_message($note_text, $hide_smilies); $web->push($template_name, "blok"); } $web->parse($template_name); $web_content = $web->return_template($template_name); disconnect($conn_id); require_once "all_pages.php";
$db->query('UPDATE ' . $db->prefix . 'users SET num_pms=num_pms-1 WHERE id=' . $luna_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error()); } } // Redirect redirect('inbox.php'); } else { $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Delete message', 'luna')); define('FORUM_ACTIVE_PAGE', 'pm'); require load_page('header.php'); // If you're not the owner of the message, you can't delete it. $result = $db->query('SELECT owner, show_message, posted, sender, message, hide_smilies FROM ' . $db->prefix . 'messages WHERE id=' . $mid) or error('Unable to delete the message', __FILE__, __LINE__, $db->error()); $cur_delete = $db->fetch_assoc($result); if ($cur_delete['owner'] != $luna_user['id'] && !$luna_user['is_admmod']) { message(__('You do not have permission to access this page.', 'luna')); } $cur_delete['message'] = parse_message($cur_delete['message']); load_inbox_nav($page); require load_page('inbox-delete-post.php'); require load_page('footer.php'); } } else { // Start building page $result_receivers = $db->query('SELECT DISTINCT receiver, owner, sender_id FROM ' . $db->prefix . 'messages WHERE shared_id=' . $tid) or error('Unable to get the informations of the message', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result_receivers)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna')); } $owner = array(); while ($receiver = $db->fetch_assoc($result_receivers)) { $r_usernames = $receiver['receiver']; $owner[] = $receiver['owner']; $uid = $receiver['sender_id'];
<ul> <?php while (list(, $cur_error) = each($errors)) { echo "\t\t\t\t" . '<li><strong>' . $cur_error . '</strong></li>' . "\n"; } ?> </ul> </div> </div> </div> <?php } else { if (isset($_POST['preview'])) { require_once PUN_ROOT . 'include/parser.php'; $preview_message = parse_message($message, $hide_smilies); ?> <div id="postpreview" class="blockpost"> <h2><span><?php echo $lang_post['Post preview']; ?> </span></h2> <div class="box"> <div class="inbox"> <div class="postright"> <div class="postmsg"> <?php echo $preview_message . "\n"; ?> </div> </div>
</td> <td> <?php if ($cur_rep['read_forum'] == null || $cur_rep['read_forum'] == 1) { echo $cur_rep['subject'] ? '<a href="' . forum_link(App::$forum_url['post'], $cur_rep['post_id']) . '">' . forum_htmlencode($cur_rep['subject']) . '</a>' : App::$lang['Removed or deleted']; } else { echo App::$lang['Topic not readable']; } ?> </td> <td> <?php if ($cur_rep['read_forum'] == null || $cur_rep['read_forum'] == 1) { echo $cur_rep['reason']; if ($cur_rep['comment'] != '') { echo '<div class="ct-box info-box">' . parse_message($cur_rep['comment'], 0) . '</div>'; } else { if ($cur_rep['user_id'] == App::$forum_user['id']) { echo '<div class="ct-box info-box"><cite><a class="rep_info_link" href="' . forum_link(App::$forum_url['reputation_comment'], $cur_rep['id']) . '">' . App::$lang['Comment'] . '</a></cite></div>'; } } } else { echo App::$lang['Message not readable']; } ?> </td> <td style="text-align:center;"><?php echo $cur_rep['rep_plus'] > 0 ? $cur_rep['rep_plus'] . ' <img src="' . forum_link('extensions/reputation') . '/img/warn_add.gif" alt="+" border="0">' : $cur_rep['rep_minus'] . ' <img src="' . forum_link('extensions/reputation') . '/img/warn_minus.gif" alt="-" border="0">'; ?> </td> <td><?php
if ($is_topic_post) { // Delete the topic and all of it's posts delete_topic($cur_post['tid']); update_forum($cur_post['fid']); redirect('viewforum.php?id=' . $cur_post['fid'], $lang_delete['Topic del redirect']); } else { // Delete just this one post delete_post($id, $cur_post['tid']); update_forum($cur_post['fid']); redirect('viewtopic.php?id=' . $cur_post['tid'], $lang_delete['Post del redirect']); } } $page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / ' . $lang_delete['Delete post']; require PUN_ROOT . 'header.php'; require PUN_ROOT . 'include/parser.php'; $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']); ?> <div class="linkst"> <div class="inbox"> <ul><li><a href="index.php"><?php echo $lang_common['Index']; ?> </a></li><li> » <a href="viewforum.php?id=<?php echo $cur_post['fid']; ?> "><?php echo pun_htmlspecialchars($cur_post['forum_name']); ?> </a></li><li> » <?php echo pun_htmlspecialchars($cur_post['subject']); ?>
if (isset($_POST['delete'])) { // Check id if (empty($_GET['id'])) { message($lang_common['Bad request']); } $id = intval($_GET['id']); confirm_referrer('message_delete.php'); // Delete message $db->query('DELETE FROM ' . $db->prefix . 'messages WHERE id=' . $id) or error('Unable to delete messages', __FILE__, __LINE__, $db->error()); // Redirect redirect('message_list.php?box=' . $_POST['box'] . '&p=' . $_POST['p'], $lang_pms['Del redirect']); } else { $page_title = $lang_pms['Delete message'] . ' / ' . pun_htmlspecialchars($pun_config['o_board_title']); require PUN_ROOT . 'header.php'; require PUN_ROOT . 'include/parser.php'; $cur_post['message'] = parse_message($cur_post['message'], (int) (!$cur_post['smileys'])); ?> <div class="blockform"> <h2><span><?php echo $lang_pms['Delete message']; ?> </span></h2> <div class="box"> <form method="post" action="message_delete.php?id=<?php echo $id; ?> "> <input type="hidden" name="box" value="<?php echo (int) $_GET['box']; ?> ">