public function check_errors_before_edit($id, $can_edit_subject, $errors) { global $lang_post, $pd; // If it's a topic it must contain a subject if ($can_edit_subject) { $subject = feather_trim($this->request->post('req_subject')); if ($this->config['o_censoring'] == '1') { $censored_subject = feather_trim(censor_words($subject)); } if ($subject == '') { $errors[] = $lang_post['No subject']; } elseif ($this->config['o_censoring'] == '1' && $censored_subject == '') { $errors[] = $lang_post['No subject after censoring']; } elseif (feather_strlen($subject) > 70) { $errors[] = $lang_post['Too long subject']; } elseif ($this->config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$this->user->is_admmod) { $errors[] = $lang_post['All caps subject']; } } // Clean up message from POST $message = feather_linebreaks(feather_trim($this->request->post('req_message'))); // Here we use strlen() not feather_strlen() as we want to limit the post to FEATHER_MAX_POSTSIZE bytes, not characters if (strlen($message) > FEATHER_MAX_POSTSIZE) { $errors[] = sprintf($lang_post['Too long message'], forum_number_format(FEATHER_MAX_POSTSIZE)); } elseif ($this->config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$this->user->is_admmod) { $errors[] = $lang_post['All caps message']; } // Validate BBCode syntax if ($this->config['p_message_bbcode'] == '1') { require FEATHER_ROOT . 'include/parser.php'; $message = preparse_bbcode($message, $errors); } if (empty($errors)) { if ($message == '') { $errors[] = $lang_post['No message']; } elseif ($this->config['o_censoring'] == '1') { // Censor message to see if that causes problems $censored_message = feather_trim(censor_words($message)); if ($censored_message == '') { $errors[] = $lang_post['No message after censoring']; } } } return $errors; }
// Check if it's a banned email address // we should only check guests because members' addresses are already verified if ($panther_user['is_guest'] && $mailer->is_banned_email($email)) { if ($panther_config['p_allow_banned_email'] == '0') { $errors[] = $lang_prof_reg['Banned email']; } $banned_email = true; // Used later when we send an alert email } } } // Clean up message from POST $orig_message = $message = isset($_POST['req_message']) ? panther_linebreaks(panther_trim($_POST['req_message'])) : ''; // Here we use strlen() not panther_strlen() as we want to limit the post to PANTHER_MAX_POSTSIZE bytes, not characters if (strlen($message) > PANTHER_MAX_POSTSIZE) { $errors[] = sprintf($lang_post['Too long message'], forum_number_format(PANTHER_MAX_POSTSIZE)); } else { if ($panther_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$panther_user['is_admmod']) { $errors[] = $lang_post['All caps message']; } } // Validate BBCode syntax if ($panther_config['p_message_bbcode'] == '1') { require PANTHER_ROOT . 'include/parser.php'; $message = $parser->preparse_bbcode($message, $errors); } if (empty($errors)) { if ($message == '') { $errors[] = $lang_post['No message']; } else { if ($panther_config['o_censoring'] == '1') {
?> </a></span></span></h2> <div class="box"> <div class="inbox"> <div class="postbody"> <div class="postleft"> <dl> <dt><?php echo $cur_search['pposter_disp']; ?> </dt> <?php if ($cur_search['pid'] == $cur_search['first_post_id']) { ?> <dd><span><?php echo $lang_topic['Replies'] . ' ' . forum_number_format($cur_search['num_replies']); ?> </span></dd> <?php } ?> <dd><div class="<?php echo $cur_search['icon_type']; ?> "><div class="nosize"><?php echo $cur_search['icon_text']; ?> </div></div></dd> </dl> </div> <div class="postright">
$ps = $db->select('forums', 'forum_name', $select, 'id=:id'); $forum = $ps->fetchColumn(); } else { $forum = $lang_admin_maintenance['All forums']; } $ps = $db->run($sql, $data); $num_topics = $ps->fetchColumn(); if (!$num_topics) { message(sprintf($lang_admin_maintenance['No old topics message'], $prune_days)); } $page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Prune']); define('PANTHER_ACTIVE_PAGE', 'admin'); require PANTHER_ROOT . 'header.php'; generate_admin_menu('maintenance'); $tpl = load_template('confirm_prune.tpl'); echo $tpl->render(array('lang_admin_maintenance' => $lang_admin_maintenance, 'lang_admin_common' => $lang_admin_common, 'link' => panther_link($panther_url['admin_maintenance']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/maintenance.php'), 'prune_days' => $prune_days, 'prune_sticky' => $prune_sticky, 'prune_from' => $prune_from, 'forum' => $forum, 'num_topics' => forum_number_format($num_topics))); require PANTHER_ROOT . 'footer.php'; } if ($action == 'add_user') { $errors = array(); $username = isset($_POST['username']) ? panther_trim($_POST['username']) : ''; $random_pass = isset($_POST['random_pass']) && $_POST['random_pass'] == '1' ? 1 : 0; $email = isset($_POST['email']) ? strtolower(panther_trim($_POST['email'])) : ''; $password_salt = random_pass(16); if ($random_pass == '1') { $password1 = random_pass(12); $password2 = $password1; } else { $password1 = isset($_POST['password1']) ? panther_trim($_POST['password1']) : ''; $password2 = isset($_POST['password2']) ? panther_trim($_POST['password2']) : ''; }
} else { echo sprintf(__('Users online', 'luna'), forum_number_format($num_users)) . '<br />' . "\n"; } exit; } elseif ($action == 'stats') { // Collect some statistics from the database if (file_exists(LUNA_CACHE_DIR . 'cache_users_info.php')) { include LUNA_CACHE_DIR . 'cache_users_info.php'; } if (!defined('LUNA_USERS_INFO_LOADED')) { if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) { require LUNA_ROOT . 'include/cache.php'; } generate_users_info_cache(); require LUNA_CACHE_DIR . 'cache_users_info.php'; } $result = $db->query('SELECT SUM(num_threads), SUM(num_comments) FROM ' . $db->prefix . 'forums') or error('Unable to fetch thread/comment count', __FILE__, __LINE__, $db->error()); list($stats['total_threads'], $stats['total_comments']) = $db->fetch_row($result); // Send the Content-type header in case the web server is setup to send something else header('Content-type: text/html; charset=utf-8'); header('Expires: ' . date('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo sprintf(__('Users', 'luna'), forum_number_format($stats['total_users'])) . '<br />' . "\n"; echo sprintf(__('Newest user', 'luna'), $luna_user['g_view_users'] == '1' ? '<a href="' . luna_htmlspecialchars(get_base_url(true)) . '/profile.php?id=' . $stats['last_user']['id'] . '">' . luna_htmlspecialchars($stats['last_user']['username']) . '</a>' : luna_htmlspecialchars($stats['last_user']['username'])) . '<br />' . "\n"; echo sprintf(__('Threads', 'luna'), forum_number_format($stats['total_threads'])) . '<br />' . "\n"; echo sprintf(__('Comments', 'luna'), forum_number_format($stats['total_comments'])) . '<br />' . "\n"; exit; } // If we end up here, the script was called with some wacky parameters exit(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'));
?> </div></div> <div class="tclcon"> <div> <?php echo $subject . "\n"; ?> </div> </div> </td> <td class="tc2"><?php echo $forum; ?> </td> <td class="tc3"><?php echo forum_number_format($cur_search['num_replies']); ?> </td> <td class="tcr"><?php echo '<a href="viewtopic.php?pid=' . $cur_search['last_post_id'] . '#p' . $cur_search['last_post_id'] . '">' . format_time($cur_search['last_post']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . pun_htmlspecialchars($cur_search['last_poster']); ?> </span></td> </tr> <?php } } if ($show_as == 'topics') { echo "\t\t\t" . '</tbody>' . "\n\t\t\t" . '</table>' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n\n"; } ?> <div class="<?php
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'); } }
<div> <?php echo $topic['subject_disp'] . "\n"; ?> </div> </div> </td> <td class="tc2"><?php echo !$topic['ghost_topic'] ? forum_number_format($topic['num_replies']) : '-'; ?> </td> <?php if ($feather_config['o_topic_views'] == '1') { ?> <td class="tc3"><?php echo !$topic['ghost_topic'] ? forum_number_format($topic['num_views']) : '-'; ?> </td> <?php } ?> <td class="tcr"><?php echo $topic['last_post_disp']; ?> </td> <td class="tcmod"><input type="checkbox" name="topics[<?php echo $topic['id']; ?> ]" value="1" /></td> </tr> <?php
} else { // Setup the title and link to the forum $forum_page['item_title']['title'] = '<a href="' . forum_link($forum_url['forum'], array($cur_set['fid'], sef_friendly($cur_set['forum_name']))) . '"><span>' . forum_htmlencode($cur_set['forum_name']) . '</span></a>'; ($hook = get_hook('se_results_forums_row_redirect_pre_item_title_merge')) ? eval($hook) : null; $forum_page['item_body']['subject']['title'] = '<h3 class="hn">' . implode(' ', $forum_page['item_title']) . '</h3>'; // Setup the forum description and mod list if ($cur_set['forum_desc'] != '') { $forum_page['item_subject']['desc'] = $cur_set['forum_desc']; } ($hook = get_hook('se_results_forums_row_normal_pre_item_subject_merge')) ? eval($hook) : null; if (!empty($forum_page['item_subject'])) { $forum_page['item_body']['subject']['desc'] = '<p>' . implode(' ', $forum_page['item_subject']) . '</p>'; } // Setup forum topics, post count and last post $forum_page['item_body']['info']['topics'] = '<li class="info-topics"><strong>' . forum_number_format($cur_set['num_topics']) . '</strong> <span class="label">' . ($cur_set['num_topics'] == 1 ? $lang_index['topic'] : $lang_index['topics']) . '</span></li>'; $forum_page['item_body']['info']['posts'] = '<li class="info-posts"><strong>' . forum_number_format($cur_set['num_posts']) . '</strong> <span class="label">' . ($cur_set['num_posts'] == 1 ? $lang_index['post'] : $lang_index['posts']) . '</span></li>'; if ($cur_set['last_post'] != '') { $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">' . $lang_index['Last post'] . '</span> <strong><a href="' . forum_link($forum_url['post'], $cur_set['last_post_id']) . '">' . format_time($cur_set['last_post']) . '</a></strong> <cite>' . sprintf($lang_index['Last poster'], forum_htmlencode($cur_set['last_poster'])) . '</cite></li>'; } else { $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><strong>' . $lang_common['Never'] . '</strong></li>'; } ($hook = get_hook('se_results_forums_row_normal_pre_display')) ? eval($hook) : null; } // Generate classes for this forum depending on its status $forum_page['item_style'] = ($forum_page['item_count'] % 2 != 0 ? ' odd' : ' even') . ($forum_page['item_count'] == 1 ? ' main-first-item' : '') . (!empty($forum_page['item_status']) ? ' ' . implode(' ', $forum_page['item_status']) : ''); ($hook = get_hook('se_results_forums_row_pre_display')) ? eval($hook) : null; ?> <div id="forum<?php echo $cur_set['fid']; ?> " class="main-item<?php
?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php echo __('Delete group', 'luna'); ?> </h3> </div> <div class="panel-body"> <form id="groups" method="post" action="groups.php?del_group=<?php echo $group_id; ?> "> <fieldset> <p><?php printf(__('The group <strong>%s</strong> currently has <strong>%s</strong> members. Please select a group to which these members will be assigned upon deletion.', 'luna'), luna_htmlspecialchars($group_title), forum_number_format($group_members)); ?> </p> <label><?php echo __('Move users to', 'luna'); ?> <select class="form-control" name="move_to_group"> <?php $result = $db->query('SELECT g_id, g_title FROM ' . $db->prefix . 'groups WHERE g_id!=' . FORUM_GUEST . ' AND g_id!=' . $group_id . ' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); while ($cur_group = $db->fetch_assoc($result)) { if ($cur_group['g_id'] == FORUM_MEMBER) { // Pre-select the pre-defined Members group echo "\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '" selected>' . luna_htmlspecialchars($cur_group['g_title']) . '</option>' . "\n"; } else { echo "\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '">' . luna_htmlspecialchars($cur_group['g_title']) . '</option>' . "\n"; }
function get_saved_queries() { global $forum_db, $lang_common; // Get the queries so that we can print them out $saved_queries = $forum_db->get_saved_queries(); ob_start(); ?> <div id="brd-debug" class="main"> <div class="debug"> <table> <caption><?php echo $lang_common['Debug summary']; ?> </caption> <thead> <tr> <th class="tcl" scope="col"><?php echo $lang_common['Query times']; ?> </th> <th class="tcr" scope="col"><?php echo $lang_common['Query']; ?> </th> </tr> </thead> <tbody> <?php $query_time_total = 0.0; foreach ($saved_queries as $cur_query) { $query_time_total += $cur_query[1]; ?> <tr> <td class="tcl"><?php echo $cur_query[1] != 0 ? forum_number_format($cur_query[1], 5) : ' '; ?> </td> <td class="tcr"><?php echo forum_htmlencode($cur_query[0]); ?> </td> </tr> <?php } ?> <tr> <td class="tcl border-less"><?php echo forum_number_format($query_time_total, 5); ?> </td> <td class="tcr border-less"><?php echo $lang_common['Total query time']; ?> </td> </tr> </tbody> </table> </div> </div> <?php return ob_get_clean(); }
// Check if it's a banned email address // we should only check guests because members' addresses are already verified if ($luna_user['is_guest'] && is_banned_email($email)) { if ($luna_config['p_allow_banned_email'] == '0') { $errors[] = __('The email address you entered is banned in this forum. Please choose another email address.', 'luna'); } $banned_email = true; // Used later when we send an alert email } } } // Clean up message from POST $orig_message = $message = luna_linebreaks(luna_trim($_POST['req_message'])); // Here we use strlen() not luna_strlen() as we want to limit the comment to FORUM_MAX_POSTSIZE bytes, not characters if (strlen($message) > FORUM_MAX_POSTSIZE) { $errors[] = sprintf(__('Comments cannot be longer than %s bytes.', 'luna'), forum_number_format(FORUM_MAX_POSTSIZE)); } elseif ($luna_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$luna_user['is_admmod']) { $errors[] = __('Comments cannot contain only capital letters.', 'luna'); } // Validate BBCode syntax require FORUM_ROOT . 'include/parser.php'; $message = preparse_bbcode($message, $errors); if (empty($errors)) { if ($message == '') { $errors[] = __('You must enter a message.', 'luna'); } elseif ($luna_config['o_censoring'] == '1') { // Censor message to see if that causes problems $censored_message = luna_trim(censor_words($message)); if ($censored_message == '') { $errors[] = __('You must enter a message. After applying censoring filters, your message was empty.', 'luna'); }
// Check subject $p_subject = luna_trim($_POST['req_subject']); if ($p_subject == '' && $edit == '0') { $errors[] = __('Threads must contain a subject.', 'luna'); } elseif (luna_strlen($p_subject) > '70') { $errors[] = __('Subjects cannot be longer than 70 characters.', 'luna'); } elseif ($luna_config['p_subject_all_caps'] == '0' && strtoupper($p_subject) == $p_subject && $luna_user['is_admmod']) { $p_subject = ucwords(strtolower($p_subject)); } // Clean up message from POST $p_message = luna_linebreaks(luna_trim($_POST['req_message'])); // Check message if ($p_message == '') { $errors[] = __('You must enter a message.', 'luna'); } elseif (strlen($p_message) > LUNA_MAX_COMMENT_SIZE) { $errors[] = sprintf(__('Comments cannot be longer than %s bytes.', 'luna'), forum_number_format(LUNA_MAX_COMMENT_SIZE)); } elseif ($luna_config['p_message_all_caps'] == '0' && strtoupper($p_message) == $p_message && $luna_user['is_admmod']) { $p_message = ucwords(strtolower($p_message)); } // Validate BBCode syntax require LUNA_ROOT . 'include/parser.php'; $p_message = preparse_bbcode($p_message, $errors); if (empty($errors) && !isset($_POST['preview'])) { // Send message(s) $_SESSION['last_session_request'] = $now = time(); // Send message(s) if (empty($errors) && !isset($_POST['preview'])) { $_SESSION['last_session_request'] = $now = time(); if ($luna_config['o_inbox_notification'] == '1') { require_once LUNA_ROOT . 'include/email.php'; // Load the new_inbox templates
$num_guests = 0; $users = array(); $result = $db->query('SELECT user_id, ident FROM ' . $db->prefix . 'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error()); while ($pun_user_online = $db->fetch_assoc($result)) { if ($pun_user_online['user_id'] > 1) { if ($pun_user['g_view_users'] == '1') { $users[] = "\n\t\t\t\t" . '<dd><a href="profile.php?id=' . $pun_user_online['user_id'] . '">' . pun_htmlspecialchars($pun_user_online['ident']) . '</a>'; } else { $users[] = "\n\t\t\t\t" . '<dd>' . pun_htmlspecialchars($pun_user_online['ident']); } } else { ++$num_guests; } } $num_users = count($users); echo "\t\t\t\t" . '<dd><span>' . sprintf($lang_index['Users online'], '<strong>' . forum_number_format($num_users) . '</strong>') . '</span></dd>' . "\n\t\t\t\t" . '<dd><span>' . sprintf($lang_index['Guests online'], '<strong>' . forum_number_format($num_guests) . '</strong>') . '</span></dd>' . "\n\t\t\t" . '</dl>' . "\n"; if ($num_users > 0) { echo "\t\t\t" . '<dl id="onlinelist" class="clearb">' . "\n\t\t\t\t" . '<dt><strong>' . $lang_index['Online'] . ' </strong></dt>' . "\t\t\t\t" . implode(',</dd> ', $users) . '</dd>' . "\n\t\t\t" . '</dl>' . "\n"; } else { echo "\t\t\t" . '<div class="clearer"></div>' . "\n"; } } else { echo "\t\t\t" . '</dl>' . "\n\t\t\t" . '<div class="clearer"></div>' . "\n"; } ?> </div> </div> </div> --> <?php $footer_style = 'index'; require PUN_ROOT . 'footer.php';
$forum_page['post_actions']['quote'] = '<span class="quote-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; } } } else { if ($forum_page['start_from'] + $forum_page['item_count'] == 1) { $forum_page['post_actions']['delete'] = '<span class="delete-topic' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['delete'], $cur_topic['first_post_id']) . '">' . $lang_topic['Delete topic'] . '</a></span>'; } else { $forum_page['post_actions']['delete'] = '<span class="delete-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['delete'], $cur_post['id']) . '">' . $lang_topic['Delete'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; } $forum_page['post_actions']['edit'] = '<span class="edit-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['edit'], $cur_post['id']) . '">' . $lang_topic['Edit'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; $forum_page['post_actions']['quote'] = '<span class="quote-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; } } else { if ($cur_topic['closed'] == '0') { if ($cur_topic['post_replies'] == '' && $forum_user['g_post_replies'] == '1' || $cur_topic['post_replies'] == '1') { $forum_page['post_actions']['quote'] = '<span class="report-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>'; } } } ($hook = get_hook('vt_row_pre_post_actions_merge')) ? eval($hook) : null; if (!empty($forum_page['post_actions'])) { $forum_page['post_options']['actions'] = '<p class="post-actions">' . implode(' ', $forum_page['post_actions']) . '</p>'; } // 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'; }
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; }
$user_avatar = $user_avatar_cache[$cur_post['poster_id']]; } else { $user_avatar = $user_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 ($pun_config['o_show_user_info'] == '1') { if ($cur_post['location'] != '') { if ($pun_config['o_censoring'] == '1') { $cur_post['location'] = censor_words($cur_post['location']); } $user_info[] = '<dd><span>' . $lang->t('From') . ' ' . pun_htmlspecialchars($cur_post['location']) . '</span></dd>'; } $user_info[] = '<dd><span>' . $lang->t('Registered date') . ' ' . format_time($cur_post['registered'], true) . '</span></dd>'; if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod']) { $user_info[] = '<dd><span>' . $lang->t('Num 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' && !$pun_user['is_guest'] || $pun_user['is_admmod']) && $pun_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="mailto:' . $cur_post['email'] . '">' . $lang->t('Email') . '</a></span>'; } else { if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="misc.php?email=' . $cur_post['poster_id'] . '">' . $lang->t('Email') . '</a></span>'; } } if ($cur_post['url'] != '') { if ($pun_config['o_censoring'] == '1') { $cur_post['url'] = censor_words($cur_post['url']); } $user_contacts[] = '<span class="website"><a href="' . pun_htmlspecialchars($cur_post['url']) . '">' . $lang->t('Website') . '</a></span>'; }
$num_guests = 0; $users = array(); foreach ($result as $pun_user_online) { if ($pun_user_online['user_id'] > 1) { if ($pun_user['g_view_users'] == '1') { $users[] = "\n\t\t\t\t" . '<dd><a href="profile.php?id=' . $pun_user_online['user_id'] . '">' . pun_htmlspecialchars($pun_user_online['ident']) . '</a>'; } else { $users[] = "\n\t\t\t\t" . '<dd>' . pun_htmlspecialchars($pun_user_online['ident']); } } else { ++$num_guests; } } unset($query, $params, $result); $num_users = count($users); echo "\t\t\t\t" . '<dd><span>' . $lang->t('Users online', '<strong>' . forum_number_format($num_users) . '</strong>') . '</span></dd>' . "\n\t\t\t\t" . '<dd><span>' . $lang->t('Guests online', '<strong>' . forum_number_format($num_guests) . '</strong>') . '</span></dd>' . "\n\t\t\t" . '</dl>' . "\n"; if ($num_users > 0) { echo "\t\t\t" . '<dl id="onlinelist" class="clearb">' . "\n\t\t\t\t" . '<dt><strong>' . $lang->t('Online') . ' </strong></dt>' . "\t\t\t\t" . implode(',</dd> ', $users) . '</dd>' . "\n\t\t\t" . '</dl>' . "\n"; } else { echo "\t\t\t" . '<div class="clearer"></div>' . "\n"; } } else { echo "\t\t\t" . '</dl>' . "\n\t\t\t" . '<div class="clearer"></div>' . "\n"; } ?> </div> </div> </div> <?php $footer_style = 'index'; require PUN_ROOT . 'footer.php';
$cur_post['message'] = $parser->parse_message($cur_post['message'], $cur_post['hide_smilies']); // Do signature parsing/caching if ($panther_config['o_signatures'] == '1' && $cur_post['signature'] != '' && $panther_user['show_sig'] != '0') { if (isset($signature_cache[$cur_post['poster_id']])) { $signature = $signature_cache[$cur_post['poster_id']]; } else { $signature = $parser->parse_signature($cur_post['signature']); $signature_cache[$cur_post['poster_id']] = $signature; } } else { $signature = ''; } $attachments = array(); if ($download && isset($results[$cur_post['id']]) && count($results[$cur_post['id']]) > 0) { foreach ($results[$cur_post['id']] as $cur_attach) { $attachments[] = array('icon' => attach_icon(attach_get_extension($cur_attach['filename'])), 'link' => panther_link($panther_url['attachment'], array($cur_attach['id'])), 'name' => $cur_attach['filename'], 'size' => sprintf($lang_topic['Attachment size'], file_size($cur_attach['size'])), 'downloads' => sprintf($lang_topic['Attachment downloads'], forum_number_format($cur_attach['downloads']))); } } $posts[] = array('id' => $cur_post['id'], 'count' => $post_count++, 'number' => $start_from + $post_count, 'link' => panther_link($panther_url['post'], array($cur_post['id'])), 'posted' => format_time($cur_post['posted']), 'username' => $username, 'user_title' => $user_title, 'poster_id' => $cur_post['poster_id'], 'poster_reputation' => $cur_post['poster_reputation'], 'user_avatar' => $user_avatar, 'group_image' => $group_image, 'edited' => $cur_post['edited'] ? format_time($cur_post['edited']) : '', 'edited_by' => $cur_post['edited_by'], 'edit_reason' => $cur_post['edit_reason'], 'attachments' => $attachments, 'message' => $cur_post['message'], 'signature' => $signature, 'is_online' => $cur_post['is_online'], 'user_info' => $user_info, 'user_contacts' => $user_contacts, 'group_image' => $group_image, 'post_actions' => $post_actions, 'actions' => $actions); } $render['posts'] = $posts; if ($cur_topic['parent']) { $render['parent_link'] = panther_link($panther_url['forum'], array($cur_topic['parent_forum'], url_friendly($cur_topic['parent']))); } ($hook = get_extensions('topic_before_users_online')) ? eval($hook) : null; if ($panther_config['o_users_online'] == '1') { require PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/online.php'; $guests_in_topic = $users = array(); $online = $db->run('SELECT o.user_id, o.ident, o.currently, o.logged, u.group_id FROM ' . $db->prefix . 'online AS o INNER JOIN ' . $db->prefix . 'users AS u ON u.id=o.user_id WHERE o.currently LIKE \'%viewtopic.php%\' AND o.idle = 0'); foreach ($online as $user_online) { if (strpos($user_online['currently'], '&p=') !== false) {
?> </span></h2> <div class="box"> <form id="groups" method="post" action="admin_groups.php?del_group=<?php echo $group_id; ?> "> <div class="inform"> <fieldset> <legend><?php echo $lang->t('Move users subhead'); ?> </legend> <div class="infldset"> <p><?php echo $lang->t('Move users info', pun_htmlspecialchars($group_title), forum_number_format($group_members)); ?> </p> <label><?php echo $lang->t('Move users label'); ?> <select name="move_to_group"> <?php $query = $db->select(array('g_id' => 'g.g_id', 'g_title' => 'g.g_title'), 'groups AS g'); $query->where = 'g.g_id != :group_guest AND g.g_id != :group_id'; $query->order = array('g_title' => 'g.g_title ASC'); $params = array(':group_guest' => PUN_GUEST, ':group_id' => $group_id); $result = $query->run($params); foreach ($result as $cur_group) { if ($cur_group['g_id'] == PUN_MEMBER) { // Pre-select the pre-defined Members group
($hook = get_hook('ft_debug_output_start')) ? eval($hook) : null; // Display debug info (if enabled/defined) if (defined('FORUM_DEBUG')) { // Calculate script generation time $time_diff = forum_microtime() - $forum_start; $query_time_total = $time_percent_db = 0.0; $saved_queries = $forum_db->get_saved_queries(); if (count($saved_queries) > 0) { foreach ($saved_queries as $cur_query) { $query_time_total += $cur_query[1]; } if ($query_time_total > 0 && $time_diff > 0) { $time_percent_db = $query_time_total / $time_diff * 100; } } echo '<p id="querytime" class="quiet">' . sprintf($lang_common['Querytime'], forum_number_format($time_diff, 3), forum_number_format(100 - $time_percent_db, 0), forum_number_format($time_percent_db, 0), forum_number_format($forum_db->get_num_queries())) . '</p>' . "\n"; } if (defined('FORUM_SHOW_QUERIES')) { echo get_saved_queries(); } ($hook = get_hook('ft_debug_end')) ? eval($hook) : null; $tpl_temp = forum_trim(ob_get_contents()); $tpl_main = str_replace('<!-- forum_debug -->', $tpl_temp, $tpl_main); ob_end_clean(); } // END SUBST - <!-- forum_debug --> // START SUBST - <!-- forum_javascript --> $forum_javascript_commonjs_urls = ' if (typeof PUNBB === \'undefined\' || !PUNBB) { var PUNBB = {}; }
<div> <?php echo $subject . "\n"; ?> </div> </div> </td> <td class="tc2"><?php echo !$ghost_topic ? forum_number_format($cur_topic['num_replies']) : '-'; ?> </td> <?php if ($pun_config['o_topic_views'] == '1') { ?> <td class="tc3"><?php echo !$ghost_topic ? forum_number_format($cur_topic['num_views']) : '-'; ?> </td> <?php } ?> <td class="tcr"><?php echo $last_post; ?> </td> <td class="tcmod"><input type="checkbox" name="topics[<?php echo $cur_topic['id']; ?> ]" value="1" /></td> </tr> <?php
if ($pun_config['o_signatures'] == '1') { ?> <div class="inform"> <fieldset> <legend><?php echo $lang_profile['Signature legend']; ?> </legend> <div class="infldset"> <p><?php echo $lang_profile['Signature info']; ?> </p> <div class="txtarea"> <label><?php printf($lang_profile['Sig max size'], forum_number_format($pun_config['p_sig_length']), $pun_config['p_sig_lines']); ?> <br /> <textarea name="signature" rows="4" cols="65"><?php echo pun_htmlspecialchars($user['signature']); ?> </textarea><br /></label> </div> <ul class="bblinks"> <li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode']; ?> </a> <?php echo $pun_config['p_sig_bbcode'] == '1' ? $lang_common['on'] : $lang_common['off']; ?> </span></li>
$user_avatar = $user_avatar_cache[$cur_post['poster_id']]; } else { $user_avatar = $user_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 ($pun_config['o_show_user_info'] == '1') { if ($cur_post['location'] != '') { if ($pun_config['o_censoring'] == '1') { $cur_post['location'] = censor_words($cur_post['location']); } $user_info[] = '<dd><span>' . $lang_topic['From'] . ' ' . pun_htmlspecialchars($cur_post['location']) . '</span></dd>'; } $user_info[] = '<dd><span>' . $lang_topic['Registered'] . ' ' . format_time($cur_post['registered'], true) . '</span></dd>'; if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod']) { $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' && !$pun_user['is_guest'] || $pun_user['is_admmod']) && $pun_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="mailto:' . pun_htmlspecialchars($cur_post['email']) . '">' . $lang_common['Email'] . '</a></span>'; } else { if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1') { $user_contacts[] = '<span class="email"><a href="misc.php?email=' . $cur_post['poster_id'] . '">' . $lang_common['Email'] . '</a></span>'; } } if ($cur_post['url'] != '') { if ($pun_config['o_censoring'] == '1') { $cur_post['url'] = censor_words($cur_post['url']); } $user_contacts[] = '<span class="website"><a href="' . pun_htmlspecialchars($cur_post['url']) . '" rel="nofollow">' . $lang_topic['Website'] . '</a></span>'; }
} else { $cur_user_name = luna_htmlspecialchars($user_data['username']); } ?> <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12"> <div class="user-entry"> <div class="media"> <a class="pull-left" href="<?php echo 'profile.php?id=' . $user_data['id']; ?> "> <?php echo $user_avatar; ?> </a> <div class="media-body"> <h2 class="media-heading"><?php echo '<a title="' . luna_htmlspecialchars($user_data['username']) . '" href="profile.php?id=' . $user_data['id'] . '">' . $cur_user_name . '</a>'; ?> </h2> <h4><?php echo $user_title_field; ?> </h4> <?php echo forum_number_format($user_data['num_comments']) . ' ' . __('comments since', 'luna') . ' ' . format_time($user_data['registered'], true); ?> </div> </div> </div> </div>
$topic_count = 0; foreach ($ps as $cur_topic) { $url_subject = url_friendly($cur_topic['subject']); // Preg match is slow! if ($panther_config['o_censoring'] == '1') { $cur_topic['subject'] = censor_words($cur_topic['subject']); } $ghost_topic = !is_null($cur_topic['moved_to']) ? true : false; $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $panther_user['disp_posts']); $topics[$cur_topic['id']] = array('count' => ++$topic_count, 'topic_count' => forum_number_format($topic_count + $start_from), 'cur_topic' => $cur_topic, 'topic_poster' => $cur_topic['up_id'] > 1 ? colourize_group($cur_topic['poster'], $cur_topic['up_group_id'], $cur_topic['up_id']) : colourize_group($cur_topic['poster'], PANTHER_GUEST), 'moved_to' => $cur_topic['moved_to'], 'subject' => $cur_topic['subject'], 'sticky' => $cur_topic['sticky'], 'closed' => $cur_topic['closed'], 'topic_link' => panther_link($panther_url['topic'], array($cur_topic['id'], $url_subject)), 'num_pages' => $num_pages_topic, 'pagination' => paginate($num_pages_topic, -1, $panther_url['topic_paginate'], array($cur_topic['id'], $url_subject)), 'new' => !$ghost_topic && $cur_topic['last_post'] > $panther_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$fid]) || $tracked_topics['forums'][$fid] < $cur_topic['last_post']) ? '1' : '0'); if (is_null($cur_topic['moved_to'])) { $topics[$cur_topic['id']]['last_post_avatar'] = generate_avatar_markup($cur_topic['uid'], $cur_topic['email'], $cur_topic['use_gravatar'], array(32, 32)); $topics[$cur_topic['id']]['last_post_link'] = panther_link($panther_url['post'], array($cur_topic['last_post_id'])); $topics[$cur_topic['id']]['last_post'] = format_time($cur_topic['last_post']); $topics[$cur_topic['id']]['last_poster'] = $cur_topic['uid'] > 1 ? colourize_group($cur_topic['last_poster'], $cur_topic['group_id'], $cur_topic['uid']) : colourize_group($cur_topic['last_poster'], PANTHER_GUEST); $topics[$cur_topic['id']]['num_replies'] = forum_number_format($cur_topic['num_replies']); if ($panther_config['o_topic_views'] == '1') { $topics[$cur_topic['id']]['num_views'] = forum_number_format($cur_topic['num_views']); } } else { $topics[$cur_topic['id']]['topic_link'] = panther_link($panther_url['topic'], array($cur_topic['moved_to'], $url_subject)); } if ($topics[$cur_topic['id']]['new'] == '1') { $topics[$cur_topic['id']]['new_link'] = panther_link($panther_url['topic_new_posts'], array($cur_topic['id'], $url_subject)); } } } $tpl = load_template('moderate_forum.tpl'); echo $tpl->render(array('lang_common' => $lang_common, 'lang_misc' => $lang_misc, 'lang_forum' => $lang_forum, 'index_link' => panther_link($panther_url['index']), 'forum_link' => panther_link($panther_url['moderate_forum'], array($fid, url_friendly($cur_forum['forum_name']))), 'pagination' => paginate($num_pages, $p, $panther_url['moderate_forum'], array($fid)), 'forum' => $cur_forum, 'form_action' => panther_link($panther_url['moderate_forum'], array($fid)), 'panther_config' => $panther_config, 'csrf_token' => generate_csrf_token(), 'panther_user' => $panther_user, 'topics' => $topics)); ($hook = get_extensions('moderate_forum_after_output')) ? eval($hook) : null; require PANTHER_ROOT . 'footer.php';
$results = array(); foreach ($search_set as $cur_search) { if ($panther_config['o_censoring'] == '1') { $cur_search['subject'] = censor_words($cur_search['subject']); } if ($show_as == 'posts') { ++$post_count; if ($panther_config['o_censoring'] == '1') { $cur_search['message'] = censor_words($cur_search['message']); } $results[] = array('pid' => $cur_search, 'message' => $parser->parse_message($cur_search['message'], $cur_search['hide_smilies']), 'posted' => format_time($cur_search['pposted']), 'topic_url' => panther_link($panther_url['topic'], array($cur_search['tid'], url_friendly($cur_search['subject']))), 'post_url' => panther_link($panther_url['post'], array($cur_search['pid'])), 'post_no' => $start_from + $post_count, 'post_count' => $post_count, 'forum' => array('url' => panther_link($panther_url['forum'], array($cur_search['forum_id'], url_friendly($cur_search['forum_name']))), 'name' => $cur_search['forum_name']), 'subject' => $cur_search['subject'], 'poster' => $cur_search['poster_id'] > 1 ? colourize_group($cur_search['pposter'], $cur_search['group_id'], $cur_search['poster_id']) : '', 'post_id' => $cur_search['pid'], 'first_post_id' => $cur_search['first_post_id'], 'num_replies' => forum_number_format($cur_search['num_replies']), 'viewed' => !$panther_user['is_guest'] && $cur_search['last_post'] > $panther_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']) ? false : true); } else { ++$topic_count; $url_subject = url_friendly($cur_search['subject']); $num_pages_topic = ceil(($cur_search['num_replies'] + 1) / $panther_user['disp_posts']); $results[$cur_search['tid']] = array('count' => ++$topic_count, 'topic_count' => forum_number_format($topic_count + $start_from), 'cur_search' => $cur_search, 'topic_poster' => $cur_search['up_id'] > 1 ? colourize_group($cur_search['poster'], $cur_search['up_group_id'], $cur_search['up_id']) : colourize_group($cur_search['poster'], PANTHER_GUEST), 'subject' => $cur_search['subject'], 'sticky' => $cur_search['sticky'], 'closed' => $cur_search['closed'], 'question' => $cur_search['question'], 'topic_link' => panther_link($panther_url['topic'], array($cur_search['tid'], $url_subject)), 'num_pages' => $num_pages_topic, 'pagination' => paginate($num_pages_topic, -1, $panther_url['topic_paginate'], array($cur_search['tid'], $url_subject)), 'new' => !$panther_user['is_guest'] && $cur_search['last_post'] > $panther_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']) ? '1' : '0', 'last_post_avatar' => generate_avatar_markup($cur_search['uid'], $cur_search['email'], $cur_search['use_gravatar'], array(32, 32)), 'last_post_link' => panther_link($panther_url['post'], array($cur_search['last_post_id'])), 'last_post' => format_time($cur_search['last_post']), 'last_poster' => $cur_search['uid'] > 1 ? colourize_group($cur_search['last_poster'], $cur_search['group_id'], $cur_search['uid']) : colourize_group($cur_search['last_poster'], PANTHER_GUEST), 'num_replies' => forum_number_format($cur_search['num_replies']), 'forum' => array('url' => panther_link($panther_url['forum'], array($cur_search['forum_id'], url_friendly($cur_search['forum_name']))), 'name' => $cur_search['forum_name'])); if ($results[$cur_search['tid']]['new'] == '1') { $results[$cur_search['tid']]['new_link'] = panther_link($panther_url['topic_new_posts'], array($cur_search['tid'], $url_subject)); } } } $tpl = load_template('search_results.tpl'); echo $tpl->render(array('forum_actions' => $forum_actions, 'index_link' => panther_link($panther_url['index']), 'lang_common' => $lang_common, 'search_link' => panther_link($panther_url['search']), 'show_as' => $show_as, 'lang_search' => $lang_search, 'lang_topic' => $lang_topic, 'lang_forum' => $lang_forum, 'pagination' => paginate($num_pages, $p, $panther_url['search_pagination'], array($search_id)), 'crumbs_text' => $crumbs_text, 'results' => $results, 'panther_config' => $panther_config)); require PANTHER_ROOT . 'footer.php'; } else { message($lang_search['No hits']); } } ($hook = get_extensions('search_form_before_header')) ? eval($hook) : null; $page_title = array($panther_config['o_board_title'], $lang_search['Search']); $focus_element = array('search', 'keywords');
require FORUM_ROOT . 'lang/' . $forum_config['o_default_lang'] . '/index.php'; // Collect some statistics from the database $query = array('SELECT' => 'COUNT(u.id) - 1', 'FROM' => 'users AS u', 'WHERE' => 'u.group_id != ' . FORUM_UNVERIFIED); ($hook = get_hook('ex_qr_get_user_count')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $stats['total_users'] = $forum_db->result($result); $query = array('SELECT' => 'u.id, u.username', 'FROM' => 'users AS u', 'WHERE' => 'u.group_id != ' . FORUM_UNVERIFIED, 'ORDER BY' => 'u.registered DESC', 'LIMIT' => '1'); ($hook = get_hook('ex_qr_get_newest_user')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $stats['last_user'] = $forum_db->fetch_assoc($result); $query = array('SELECT' => 'SUM(f.num_topics), SUM(f.num_posts)', 'FROM' => 'forums AS f'); ($hook = get_hook('ex_qr_get_post_stats')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); list($stats['total_topics'], $stats['total_posts']) = $forum_db->fetch_row($result); // Send the Content-type header in case the web server is setup to send something else header('Content-type: text/html; charset=utf-8'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); ($hook = get_hook('ex_pre_stats_output')) ? eval($hook) : null; echo sprintf($lang_index['No of users'], forum_number_format($stats['total_users'])) . '<br />' . "\n"; echo sprintf($lang_index['Newest user'], '<a href="' . forum_link($forum_url['user'], $stats['last_user']['id']) . '">' . forum_htmlencode($stats['last_user']['username']) . '</a>') . '<br />' . "\n"; echo sprintf($lang_index['No of topics'], forum_number_format($stats['total_topics'])) . '<br />' . "\n"; echo sprintf($lang_index['No of posts'], forum_number_format($stats['total_posts'])) . '<br />' . "\n"; exit; } } } ($hook = get_hook('ex_new_action')) ? eval($hook) : null; // If we end up here, the script was called with some wacky parameters exit($lang_common['Bad request']);
($hook = get_hook('in_users_online_qr_get_online_info')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $forum_page['num_guests'] = $forum_page['num_users'] = 0; $users = array(); while ($forum_user_online = $forum_db->fetch_assoc($result)) { ($hook = get_hook('in_users_online_add_online_user_loop')) ? eval($hook) : null; if ($forum_user_online['user_id'] > 1) { $users[] = $forum_user['g_view_users'] == '1' ? '<a href="' . forum_link($forum_url['user'], $forum_user_online['user_id']) . '">' . forum_htmlencode($forum_user_online['ident']) . '</a>' : forum_htmlencode($forum_user_online['ident']); ++$forum_page['num_users']; } else { ++$forum_page['num_guests']; } } $forum_page['online_info'] = array(); $forum_page['online_info']['guests'] = $forum_page['num_guests'] == 0 ? $lang_index['Guests none'] : sprintf($forum_page['num_guests'] == 1 ? $lang_index['Guests single'] : $lang_index['Guests plural'], forum_number_format($forum_page['num_guests'])); $forum_page['online_info']['users'] = $forum_page['num_users'] == 0 ? $lang_index['Users none'] : sprintf($forum_page['num_users'] == 1 ? $lang_index['Users single'] : $lang_index['Users plural'], forum_number_format($forum_page['num_users'])); ($hook = get_hook('in_users_online_pre_online_info_output')) ? eval($hook) : null; ?> <div id="brd-online" class="gen-content"> <h3 class="hn"><span><?php printf($lang_index['Currently online'], implode($lang_index['Online stats separator'], $forum_page['online_info'])); ?> </span></h3> <?php if (!empty($users)) { ?> <p><?php echo implode($lang_index['Online list separator'], $users); ?> </p> <?php
<input type="hidden" name="<?php echo $csrf_key; ?> " value="<?php echo $csrf_token; ?> "> <div class="inform"> <fieldset> <legend><?php echo $lang_admin_groups['Move users subhead']; ?> </legend> <div class="infldset"> <p><?php printf($lang_admin_groups['Move users info'], feather_escape($group_info['title']), forum_number_format($group_info['members'])); ?> </p> <label><?php echo $lang_admin_groups['Move users label']; ?> <select name="move_to_group"> <?php get_group_list_delete($id); ?> </select> <br /></label> </div> </fieldset> </div> <p class="buttons"><input type="submit" name="del_group" value="<?php