function online_list() { global $luna_config, $db, $luna_user; if ($luna_config['o_users_online'] == '1') { // Fetch users online info and generate strings for output $result = $db->query('SELECT user_id, ident FROM ' . $db->prefix . 'online WHERE idle=0 AND user_id>1 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result) > 0) { $ctr = 1; while ($luna_user_online = $db->fetch_assoc($result)) { if ($luna_user['g_view_users'] == '1') { echo "\n\t\t\t\t" . '<li><a href="profile.php?id=' . $luna_user_online['user_id'] . '">' . luna_htmlspecialchars($luna_user_online['ident']) . '</a></li>'; } else { echo "\n\t\t\t\t" . '<li>' . luna_htmlspecialchars($luna_user_online['ident']) . '</li>'; } } } else { echo '<li><a>' . __('No users online', 'luna') . '</a></li>'; } } }
function parse_signature($text) { global $luna_config, $luna_user; if ($luna_config['o_censoring'] == '1') { $text = censor_words($text); } // Convert applicable characters to HTML entities $text = luna_htmlspecialchars($text); if (strpos($text, '[') !== false && strpos($text, ']') !== false) { $text = do_bbcode($text, true); } if ($luna_config['o_smilies_sig'] == '1' && $luna_user['show_smilies'] == '1') { $text = do_smilies($text); } // Deal with newlines, tabs and multiple spaces $pattern = array("\n", "\t", ' ', ' '); $replace = array('<br />', '    ', '  ', '  '); $text = str_replace($pattern, $replace, $text); return clean_paragraphs($text); }
?> </label> </div> <div class="radio"> <label> <input type="radio" name="form[copyright_type]" id="o_copyright_type_1" value="1"<?php if ($luna_config['o_copyright_type'] == '1') { echo ' checked'; } ?> /> <?php _e('Show personalized copyright notices:', 'luna'); ?> </label><br /><br /> <input type="text" class="form-control" name="form[custom_copyright]" placeholder="<?php _e('Your copyright', 'luna'); ?> " value="<?php echo luna_htmlspecialchars($luna_config['o_custom_copyright']); ?> " /> </div> </div> </div> </fieldset> </div> </div> </form> <?php require 'footer.php';
function output_html($feed) { // 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'); foreach ($feed['items'] as $item) { if (utf8_strlen($item['title']) > LUNA_EXTERN_MAX_SUBJECT_LENGTH) { $subject_truncated = luna_htmlspecialchars(luna_trim(utf8_substr($item['title'], 0, LUNA_EXTERN_MAX_SUBJECT_LENGTH - 5))) . ' …'; } else { $subject_truncated = luna_htmlspecialchars($item['title']); } echo '<li><a href="' . luna_htmlspecialchars($item['link']) . '" title="' . luna_htmlspecialchars($item['title']) . '">' . $subject_truncated . '</a></li>' . "\n"; } }
list($num_messages) = $db->fetch_row($result); // What page are we on ? $num_pages = ceil($num_messages / $luna_config['o_message_per_page']); if ($page > $num_pages) { $page = 1; } $start_from = intval($luna_config['o_message_per_page']) * ($page - 1); $limit = $start_from . ',' . $luna_config['o_message_per_page']; // Start building page $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Private Messages', 'luna'), __('Inbox', 'luna')); $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.facebook, u.msn, u.twitter, u.google, u.location, u.signature, u.disp_threads, u.disp_comments, u.email_setting, u.notify_with_comment, u.auto_notify, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.php_timezone, u.language, u.style, u.num_comments, u.last_comment, u.registered, u.registration_ip, u.admin_note, u.date_format, u.time_format, u.last_visit, u.color_scheme, u.accent, g.g_id, g.g_user_title, g.g_moderator FROM ' . $db->prefix . 'users AS u LEFT JOIN ' . $db->prefix . 'groups AS g ON g.g_id=u.group_id WHERE u.id=' . $id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'), false, '404 Not Found'); } $user = $db->fetch_assoc($result); $user_username = luna_htmlspecialchars($user['username']); $user_usertitle = get_title($user); define('LUNA_ACTIVE_PAGE', 'inbox'); require load_page('header.php'); ?> <script type="text/javascript"> /* <![CDATA[ */ function checkAll(checkWhat,command){ var inputs = document.getElementsByTagName('input'); for(index = 0; index < inputs.length; index++){ if(inputs[index].name == checkWhat){ inputs[index].checked=document.getElementById(command).checked; } } }
if ($luna_user['is_admmod']) { header("Location: index.php"); } define('FORUM_ACTIVE_PAGE', 'admin'); require 'header.php'; $redirect_url = check_url(); ?> <div class="well form-box"> <h3 class="form-title"><?php _e('Login', 'luna'); ?> </h3> <form id="login-form" method="post" action="../login.php?action=in" onsubmit="return"> <input type="hidden" name="form_sent" value="1" /> <input type="hidden" name="redirect_url" value="<?php echo luna_htmlspecialchars($redirect_url); ?> " /> <div class="form-group"> <input class="form-control top-form" type="text" name="req_username" maxlength="25" tabindex="1" placeholder="<?php _e('Username', 'luna'); ?> " /> </div> <div class="form-group"> <input class="form-control bottom-form" type="password" name="req_password" tabindex="2" placeholder="<?php _e('Password', 'luna'); ?> " /> </div> <div class="form-group">
function load_admin_nav($section, $page) { global $luna_user, $luna_config, $is_admin; // What page are we on? if ($page == 'index') { $page_title = '<span class="fa fa-fw fa-tachometer"></span> ' . __('Backstage', 'luna'); } elseif ($page == 'stats') { $page_title = '<span class="fa fa-fw fa-info-circle"></span> ' . __('System info', 'luna'); } elseif ($page == 'update') { $page_title = '<span class="fa fa-fw fa-cloud-upload"></span> ' . __('Luna software update', 'luna'); } elseif ($page == 'about') { $page_title = '<span class="fa fa-fw fa-moon-o"></span> ' . __('About Luna', 'luna'); } elseif ($page == 'board') { $page_title = '<span class="fa fa-fw fa-sort-amount-desc"></span> ' . __('Board', 'luna'); } elseif ($page == 'moderate') { $page_title = '<span class="fa fa-fw fa-tasks"></span> ' . __('Moderate', 'luna'); } elseif ($page == 'censoring') { $page_title = '<span class="fa fa-fw fa-eye-slash"></span> ' . __('Censoring', 'luna'); } elseif ($page == 'reports') { $page_title = '<span class="fa fa-fw fa-exclamation-triangle"></span> ' . __('Reports', 'luna'); } elseif ($page == 'users') { $page_title = '<span class="fa fa-fw fa-search"></span> ' . __('Search', 'luna'); } elseif ($page == 'tools') { $page_title = '<span class="fa fa-fw fa-wrench"></span> ' . __('Tools', 'luna'); } elseif ($page == 'ranks') { $page_title = '<span class="fa fa-fw fa-chevron-up"></span> ' . __('Ranks', 'luna'); } elseif ($page == 'groups') { $page_title = '<span class="fa fa-fw fa-group"></span> ' . __('Groups', 'luna'); } elseif ($page == 'permissions') { $page_title = '<span class="fa fa-fw fa-check-circle"></span> ' . __('Permissions', 'luna'); } elseif ($page == 'bans') { $page_title = '<span class="fa fa-fw fa-ban"></span> ' . __('Bans', 'luna'); } elseif ($page == 'settings') { $page_title = '<span class="fa fa-fw fa-cogs"></span> ' . __('Settings', 'luna'); } elseif ($page == 'features') { $page_title = '<span class="fa fa-fw fa-sliders"></span> ' . __('Features', 'luna'); } elseif ($page == 'appearance') { $page_title = '<span class="fa fa-fw fa-eye"></span> ' . __('Appearance', 'luna'); } elseif ($page == 'registration') { $page_title = '<span class="fa fa-fw fa-plus-circle"></span> ' . __('Registration', 'luna'); } elseif ($page == 'email') { $page_title = '<span class="fa fa-fw fa-envelope"></span> ' . __('Email', 'luna'); } elseif ($page == 'menu') { $page_title = '<span class="fa fa-fw fa-bars"></span> ' . __('Menu', 'luna'); } elseif ($page == 'theme') { $page_title = '<span class="fa fa-fw fa-paint-brush"></span> ' . __('Theme', 'luna'); } elseif ($page == 'maintenance') { $page_title = '<span class="fa fa-fw fa-coffee"></span> ' . __('Maintenance', 'luna'); } elseif ($page == 'prune') { $page_title = '<span class="fa fa-fw fa-recycle"></span> ' . __('Prune', 'luna'); } elseif ($page == 'database') { $page_title = '<span class="fa fa-fw fa-database"></span> ' . __('Database management', 'luna'); } elseif ($page == 'info') { $page_title = '<span class="fa fa-fw fa-info-circle"></span> ' . __('Info', 'luna'); } else { $page_title = $page; } ?> <nav class="navbar navbar-fixed-top navbar-default" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.php"><span class="fa fa-fw fa-arrow-left hidden-xs"></span><span class="visible-xs-inline"><?php echo $page_title; ?> </span></a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="<?php if ($section == 'backstage') { echo 'active'; } ?> "><a href="index.php"><span class="fa fa-fw fa-dashboard"></span> <?php _e('Backstage', 'luna'); ?> </a></li> <?php if ($is_admin) { ?> <li class="<?php if ($section == 'content') { echo 'active'; } ?> "><a href="board.php"><span class="fa fa-fw fa-file"></span> <?php _e('Content', 'luna'); ?> </a></li> <?php } else { ?> <li class="<?php if ($section == 'content') { echo 'active'; } ?> "><a href="reports.php"><span class="fa fa-fw fa-file"></span> <?php _e('Content', 'luna'); ?> </a></li> <?php } ?> <li class="<?php if ($section == 'users') { echo 'active'; } ?> "><a href="users.php"><span class="fa fa-fw fa-users"></span> <?php _e('Users', 'luna'); ?> </a></li> <?php if ($is_admin) { ?> <li class="<?php if ($section == 'settings') { echo 'active'; } ?> "><a href="settings.php"><span class="fa fa-fw fa-cog"></span> <?php _e('Settings', 'luna'); ?> </a></li><?php } ?> <?php if ($is_admin) { ?> <li class="<?php if ($section == 'maintenance') { echo 'active'; } ?> "><a href="maintenance.php"><span class="fa fa-fw fa-coffee"></span> <?php _e('Maintenance', 'luna'); ?> </a></li> <?php } // See if there are any plugins $plugins = forum_list_plugins($is_admin); // Did we find any plugins? if (!empty($plugins)) { ?> <li class="dropdown<?php if ($section == ' extensions') { echo 'active'; } ?> "> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-fw fa-cogs"></span> <?php _e('Extensions', 'luna'); ?> <span class="fa fa-fw fa-angle-down"> </a> <ul class="dropdown-menu"> <?php foreach ($plugins as $plugin_name => $plugin) { echo "\t\t\t\t\t" . '<li><a href="loader.php?plugin=' . $plugin_name . '">' . str_replace('_', ' ', $plugin) . '</a></li>' . "\n"; } ?> </ul> </li> <?php } ?> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown usermenu"> <a href="#" class="dropdown-toggle dropdown-user" data-toggle="dropdown"> <span class="hidden-sm"><?php print luna_htmlspecialchars($luna_user['username']); ?> </span><?php echo draw_user_avatar($luna_user['id'], true, 'avatar'); ?> <span class="fa fa-fw fa-angle-down"></span> </a> <ul class="dropdown-menu"> <li><a href="../profile.php?id=<?php echo $luna_user['id']; ?> "><?php _e('Profile', 'luna'); ?> </a></li> <li><a href="../settings.php?id=<?php echo '' . $luna_user['id']; ?> "><?php _e('Settings', 'luna'); ?> </a></li> <li class="divider"></li> <li><a href="../help.php"><?php _e('Help', 'luna'); ?> </a></li> <li><a href="http://getluna.org"><?php _e('Support', 'luna'); ?> </a></li> <li class="divider"></li> <li><a href="../login.php?action=out&id=<?php echo '' . $luna_user['id'] . '&csrf_token=' . luna_hash($luna_user['id'] . luna_hash(get_remote_address())); ?> "><?php _e('Logout', 'luna'); ?> </a></li> </ul> </li> </ul> </div> </div> </nav> <div class="jumbotron jumboheader"> <div class="container"> <div class="row"> <h2 class="hidden-xs"> <?php echo $page_title; if ($luna_config['o_update_ring'] > 1) { echo '<span class="pull-right" style="font-size: 70%;">Core ' . Version::FORUM_CORE_VERSION . '</span>'; } ?> </h2> <?php if ($section == 'backstage') { ?> <ul class="nav nav-tabs" role="tablist"> <li<?php if ($page == 'index') { echo ' class="active"'; } ?> ><a href="index.php"><span class="fa fa-fw fa-tachometer"></span><span class="hidden-xs"> <?php _e('Backstage', 'luna'); ?> </span></a></li> <li<?php if ($page == 'stats') { echo ' class="active"'; } ?> ><a href="system.php"><span class="fa fa-fw fa-info-circle"></span><span class="hidden-xs"> <?php _e('System info', 'luna'); ?> </span></a></li> <li<?php if ($page == 'update') { echo ' class="active"'; } ?> ><a href="update.php"><span class="fa fa-fw fa-cloud-upload"></span><span class="hidden-xs"> <?php _e('Update', 'luna'); ?> </span></a></li> <li class="pull-right<?php if ($page == 'about') { echo ' active'; } ?> "><a href="about.php"><span class="fa fa-fw fa-moon-o"></span><span class="hidden-xs"> <?php _e('About', 'luna'); ?> </span></a></li> </ul> <?php } if ($section == 'content') { ?> <ul class="nav nav-tabs" role="tablist"> <li<?php if ($page == 'board') { echo ' class="active"'; } ?> ><a href="board.php"><span class="fa fa-fw fa-sort-amount-desc"></span><span class="hidden-xs"> <?php _e('Board', 'luna'); ?> </span></a></li> <li<?php if ($page == 'moderate') { echo ' class="active"'; } ?> ><a href="moderate.php"><span class="fa fa-fw fa-tasks"></span><span class="hidden-xs"> <?php _e('Moderate', 'luna'); ?> </span></a></li> <li<?php if ($page == 'censoring') { echo ' class="active"'; } ?> ><a href="censoring.php"><span class="fa fa-fw fa-eye-slash"></span><span class="hidden-xs"> <?php _e('Censoring', 'luna'); ?> </span></a></li> <li<?php if ($page == 'reports') { echo ' class="active"'; } ?> ><a href="reports.php"><span class="fa fa-fw fa-exclamation-triangle"></span><span class="hidden-xs"> <?php _e('Reports', 'luna'); ?> </span></a></li> </ul> <?php } if ($section == 'users') { ?> <ul class="nav nav-tabs" role="tablist"> <li<?php if ($page == 'users') { echo ' class="active"'; } ?> ><a href="users.php"><span class="fa fa-fw fa-search"></span><span class="hidden-xs"> <?php _e('Search', 'luna'); ?> </span></a></li> <li<?php if ($page == 'tools') { echo ' class="active"'; } ?> ><a href="tools.php"><span class="fa fa-fw fa-wrench"></span><span class="hidden-xs"> <?php _e('Tools', 'luna'); ?> </span></a></li> <li<?php if ($page == 'ranks') { echo ' class="active"'; } ?> ><a href="ranks.php"><span class="fa fa-fw fa-chevron-up"></span><span class="hidden-xs"> <?php _e('Ranks', 'luna'); ?> </span></a></li> <li<?php if ($page == 'groups') { echo ' class="active"'; } ?> ><a href="groups.php"><span class="fa fa-fw fa-group"></span><span class="hidden-xs"> <?php _e('Groups', 'luna'); ?> </span></a></li> <li<?php if ($page == 'permissions') { echo ' class="active"'; } ?> ><a href="permissions.php"><span class="fa fa-fw fa-check-circle"></span><span class="hidden-xs"> <?php _e('Permissions', 'luna'); ?> </span></a></li> <li<?php if ($page == 'bans') { echo ' class="active"'; } ?> ><a href="bans.php"><span class="fa fa-fw fa-ban"></span><span class="hidden-xs"> <?php _e('Bans', 'luna'); ?> </span></a></li> </ul> <?php } if ($section == 'settings') { ?> <ul class="nav nav-tabs" role="tablist"> <li<?php if ($page == 'settings') { echo ' class="active"'; } ?> ><a href="settings.php"><span class="fa fa-fw fa-cogs"></span><span class="hidden-xs"> <?php _e('Settings', 'luna'); ?> </span></a></li> <li<?php if ($page == 'features') { echo ' class="active"'; } ?> ><a href="features.php"><span class="fa fa-fw fa-sliders"></span><span class="hidden-xs"> <?php _e('Features', 'luna'); ?> </span></a></li> <li<?php if ($page == 'appearance') { echo ' class="active"'; } ?> ><a href="appearance.php"><span class="fa fa-fw fa-eye"></span><span class="hidden-xs"> <?php _e('Appearance', 'luna'); ?> </span></a></li> <li<?php if ($page == 'registration') { echo ' class="active"'; } ?> ><a href="registration.php"><span class="fa fa-fw fa-plus-circle"></span><span class="hidden-xs"> <?php _e('Registration', 'luna'); ?> </span></a></li> <li<?php if ($page == 'email') { echo ' class="active"'; } ?> ><a href="email.php"><span class="fa fa-fw fa-envelope"></span><span class="hidden-xs"> <?php _e('Email', 'luna'); ?> </span></a></li> <li<?php if ($page == 'menu') { echo ' class="active"'; } ?> ><a href="menu.php"><span class="fa fa-fw fa-bars"></span><span class="hidden-xs"> <?php _e('Menu', 'luna'); ?> </span></a></li> <li<?php if ($page == 'theme') { echo ' class="active"'; } ?> ><a href="theme.php"><span class="fa fa-fw fa-paint-brush"></span><span class="hidden-xs"> <?php _e('Theme', 'luna'); ?> </span></a></li> </ul> <?php } if ($section == 'maintenance') { ?> <ul class="nav nav-tabs" role="tablist"> <li<?php if ($page == 'maintenance') { echo ' class="active"'; } ?> ><a href="maintenance.php"><span class="fa fa-fw fa-coffee"></span><span class="hidden-xs"> <?php _e('Maintenance', 'luna'); ?> </span></a></li> <li<?php if ($page == 'prune') { echo ' class="active"'; } ?> ><a href="prune.php"><span class="fa fa-fw fa-recycle"></span><span class="hidden-xs"> <?php _e('Prune', 'luna'); ?> </span></a></li> <li<?php if ($page == 'database') { echo ' class="active"'; } ?> ><a href="database.php"><span class="fa fa-fw fa-database"></span><span class="hidden-xs"> <?php _e('Database', 'luna'); ?> </span></a></li> </ul> <?php } ?> </div> </div> </div> <div class="content"> <div class="container"> <div class="row"> <?php }
if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'), false, '404 Not Found'); } $user = $db->fetch_assoc($result); $user_username = luna_htmlspecialchars($user['username']); $avatar_field = generate_avatar_markup($id); $avatar_user_card = draw_user_avatar($id); if ($action == 'readnoti') { set_user_notifications_viewed($id); confirm_referrer('notifications.php'); redirect('notifications.php?id=' . $id); } elseif ($action == 'delnoti') { delete_user_notifications($id, $viewed = 1); confirm_referrer('notifications.php'); redirect('notifications.php?id=' . $id); } $viewed_notifications = array(); $unviewed_notifications = array(); $num_viewed = has_viewed_notifications(); $num_unviewed = has_unviewed_notifications(); if ($num_viewed) { $viewed_notifications = get_user_viewed_notifications(); } if ($num_unviewed) { $unviewed_notifications = get_user_unviewed_notifications(); } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']) . ' / ' . __('Profile', 'luna')); define('FORUM_ACTIVE_PAGE', 'me'); require load_page('header.php'); require load_page('notifications.php'); require load_page('footer.php');
<div class="row forum-entry <?php echo $item_status; ?> "> <div class="col-sm-6 col-xs-6"> <strong><a href="viewforum.php?id=<?php echo $cur_forum['fid']; ?> "><?php echo $faicon . luna_htmlspecialchars($cur_forum['forum_name']); ?> </a></strong><br /> <?php echo $forum_desc; ?> </div> <div class="col-sm-1 hidden-xs text-center"> <?php echo '<b>' . $cur_forum['num_topics'] . '</b> ' . $topics_label; ?> <br /> <?php echo '<b>' . $cur_forum['num_posts'] . '</b> ' . $posts_label; ?> </div> <div class="col-sm-5 col-xs-6"> <?php echo $last_post; ?> <?php echo $forum_field_new;
} // Regenerate the update cache generate_update_cache(); header("Location: update.php"); } if (file_exists(LUNA_CACHE_DIR . 'cache_update.php')) { include LUNA_CACHE_DIR . 'cache_update.php'; } if (!defined('LUNA_UPDATE_LOADED') || $last_check_time > time() + 60 * 60 * 24) { if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) { require LUNA_ROOT . 'include/cache.php'; } generate_update_cache(); require LUNA_CACHE_DIR . 'cache_update.php'; } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Admin', 'luna'), __('Update', 'luna')); define('LUNA_ACTIVE_PAGE', 'admin'); require 'header.php'; load_admin_nav('backstage', 'update'); if (isset($_GET['saved'])) { echo '<div class="alert alert-success">' . __('Your settings have been saved.', 'luna') . '</div>'; } ?> <div class="row"> <div class="col-sm-4 col-md-3"> <form method="post" action="update.php"> <input type="hidden" name="form_sent" value="1" /> <fieldset> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php
<tr> <td> <input type="text" class="form-control" name="search_for[<?php echo $cur_word['id']; ?> ]" value="<?php echo luna_htmlspecialchars($cur_word['search_for']); ?> " maxlength="60" /> </td> <td> <input type="text" class="form-control" name="replace_with[<?php echo $cur_word['id']; ?> ]" value="<?php echo luna_htmlspecialchars($cur_word['replace_with']); ?> " maxlength="60" /> </td> <td> <div class="btn-group"> <button class="btn btn-primary" type="submit" name="update[<?php echo $cur_word['id']; ?> ]"><span class="fa fa-fw fa-check"></span> <?php _e('Update', 'luna'); ?> </button> <button class="btn btn-danger" type="submit" name="remove[<?php echo $cur_word['id']; ?>
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');
?> </th> <td> <select class="form-control" name="user_group" tabindex="23"> <option value="-1" selected><?php _e('All groups', 'luna'); ?> </option> <option value="0"><?php _e('Unverified users', 'luna'); ?> </option> <?php $result = $db->query('SELECT g_id, g_title FROM ' . $db->prefix . 'groups WHERE g_id!=' . FORUM_GUEST . ' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); while ($cur_group = $db->fetch_assoc($result)) { echo "\t\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '">' . luna_htmlspecialchars($cur_group['g_title']) . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <th><?php _e('Admin note', 'luna'); ?> </th> <td colspan="3"><input type="text" class="form-control" name="form[admin_note]" maxlength="30" tabindex="13" /></td> </tr> <tr> <th><?php _e('Number of posts less than', 'luna');
echo luna_htmlspecialchars($p_destinataire); ?> " tabindex="<?php echo $cur_index++; ?> " autofocus /> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><?php _e('Subject', 'luna'); ?> </label> <div class="col-sm-9"> <input class="form-control" type="text" name="req_subject" value="<?php echo $p_subject != '' ? luna_htmlspecialchars($p_subject) : ''; ?> " tabindex="<?php echo $cur_index++; ?> " /> </div> </div> <?php } ?> <div class="form-group"> <label class="col-sm-3 control-label"><?php _e('Message', 'luna'); ?> </label>
?> </td> <td> <?php if ($luna_user['g_view_users'] == '1') { $ids_list = explode(', ', $cur_mess['receiver_id']); $sender_list = explode(', ', $cur_mess['receiver']); $sender_list = str_replace('Deleted', __('Deleted', 'luna'), $sender_list); for ($i = '0'; $i < count($ids_list); $i++) { echo '<a href="profile.php?id=' . $ids_list[$i] . '">' . luna_htmlspecialchars($sender_list[$i]) . '</a>'; if ($ids_list[$i][count($ids_list[$i]) - '1']) { echo '<br />'; } } } else { echo luna_htmlspecialchars($cur_mess['receiver']); } ?> </td> <td><?php echo $last_comment; ?> </td> </tr> <?php } } else { echo "\t" . '<tr><td colspan="4">' . __('No messages', 'luna') . '</td></tr>' . "\n"; } ?> </tbody>
<label class="radio-inline"> <input type="radio" name="form[announcement_type]" value="danger"<?php if ($luna_config['o_announcement_type'] == 'danger') { echo ' checked'; } ?> > <?php _e('Danger', 'luna'); ?> </label> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><?php _e('Announcement message', 'luna'); ?> </label> <div class="col-sm-9"> <textarea class="form-control" name="form[announcement_message]" rows="5"><?php echo luna_htmlspecialchars($luna_config['o_announcement_message']); ?> </textarea> </div> </div> </fieldset> </div> </div> </form> <?php require 'footer.php';
exit; } ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php draw_delete_title(); ?> </h3> </div> <div class="panel-body"> <?php draw_soft_reset_form($id); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php echo luna_htmlspecialchars($cur_post['poster']); ?> </h3> </div> <div class="panel-body"> <?php echo $cur_post['message']; ?> </div> </div>
} $owner = array(); while ($receiver = $db->fetch_assoc($result_receivers)) { $r_usernames = $receiver['receiver']; $owner[] = $receiver['owner']; $uid = $receiver['sender_id']; } $r_usernames = str_replace('Deleted', __('Deleted', 'luna'), $r_usernames); $result = $db->query('SELECT subject FROM ' . $db->prefix . 'messages WHERE shared_id=' . $tid . ' AND show_message=1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna')); } $p_subject = $db->result($result); $messageh2 = luna_htmlspecialchars($p_subject) . ' ' . __('with', 'luna') . ' ' . luna_htmlspecialchars($r_usernames); $required_fields = array('req_message' => __('Message', 'luna')); $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Private Messages', 'luna'), __('View a private discussion', 'luna')); define('FORUM_ACTIVE_PAGE', 'pm'); require load_page('header.php'); if (!in_array($luna_user['id'], $owner) && !$luna_user['is_admmod']) { message(__('You do not have permission to access this page.', 'luna')); } $post_count = '0'; // Keep track of post numbers $db->query('UPDATE ' . $db->prefix . 'messages SET showed=1 WHERE shared_id=' . $tid . ' AND show_message=1 AND owner=' . $luna_user['id']) or error('Unable to update the status of the message', __FILE__, __LINE__, $db->error()); $result = $db->query('SELECT m.id AS mid, m.shared_id, m.subject, m.sender_ip, m.message, m.hide_smilies, m.posted, m.showed, m.sender, m.sender_id, u.id, u.group_id AS g_id, g.g_user_title, u.username, u.registered, u.email, u.title, u.url, u.location, u.email_setting, u.num_posts, u.admin_note, u.signature, u.use_pm, o.user_id AS is_online FROM ' . $db->prefix . 'messages AS m, ' . $db->prefix . 'users AS u LEFT JOIN ' . $db->prefix . 'online AS o ON (o.user_id=u.id AND o.idle=0) LEFT JOIN ' . $db->prefix . 'groups AS g ON (u.group_id=g.g_id) WHERE u.id=m.sender_id AND m.shared_id=' . $tid . ' AND m.owner=' . $luna_user['id'] . ' ORDER BY m.posted LIMIT ' . $start_from . ',' . $luna_user['disp_posts']) or error('Unable to get the message and the informations of the user', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna')); } $reply_link = '<a href="new_inbox.php?reply=' . $tid . '">' . __('Reply', 'luna') . '</a>'; $paging_links = paginate($num_pages, $page, 'viewinbox.php?tid=' . $tid . '&mid=' . $mid); require load_page('inbox-view.php');
private static function load_database_driver($db_type) { // Load the appropriate DB layer class switch ($db_type) { case 'mysql': require FORUM_ROOT . 'include/dblayer/mysql.php'; break; case 'mysql_innodb': require FORUM_ROOT . 'include/dblayer/mysql_innodb.php'; break; case 'mysqli': require FORUM_ROOT . 'include/dblayer/mysqli.php'; break; case 'mysqli_innodb': require FORUM_ROOT . 'include/dblayer/mysqli_innodb.php'; break; case 'pgsql': require FORUM_ROOT . 'include/dblayer/pgsql.php'; break; case 'sqlite': require FORUM_ROOT . 'include/dblayer/sqlite.php'; break; case 'sqlite3': require FORUM_ROOT . 'include/dblayer/sqlite3.php'; break; default: error(sprintf(__('"%s" is not a valid database type', 'luna'), luna_htmlspecialchars($db_type))); } }
message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna')); } $arry_dests[] = $db->result($result); } $p_destinataire = implode(', ', $arry_dests); } if (isset($_GET['lid'])) { // From list $id = intval($_GET['lid']); $arry_dests = array(); $result = $db->query('SELECT receivers FROM ' . $db->prefix . 'sending_lists WHERE user_id=' . $luna_user['id'] . ' AND id=' . $id) or error('Unable to find the informations of the message', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna')); } $arry_dests = unserialize($db->result($result)); $p_destinataire = implode(', ', $arry_dests); } } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Private Messages', 'luna'), __('Send a message', 'luna')); $required_fields = array('req_message' => __('Message', 'luna')); $focus_element = array('comment'); if ($r == '0' && $q == '0' && $edit == '0') { $required_fields['req_subject'] = __('Subject', 'luna'); $focus_element[] = 'p_username'; } else { $focus_element[] = 'req_message'; } define('LUNA_ACTIVE_PAGE', 'new-inbox'); require load_page('header.php'); require load_page('inbox-new.php'); require load_page('footer.php');
function draw_search_forum_list() { global $db, $luna_config, $luna_user; $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM ' . $db->prefix . 'categories AS c INNER JOIN ' . $db->prefix . 'forums AS f ON c.id=f.cat_id LEFT JOIN ' . $db->prefix . 'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=' . $luna_user['g_id'] . ') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); // We either show a list of forums of which multiple can be selected if ($luna_config['o_search_all_forums'] == '1' || $luna_user['is_admmod']) { echo "\t\t\t\t\t\t" . '<div class="col-xs-4"><div class="conl multiselect"><b>' . __('Forum', 'luna') . '</b>' . "\n"; echo "\t\t\t\t\t\t" . '<br />' . "\n"; echo "\t\t\t\t\t\t" . '<div>' . "\n"; $cur_category = 0; while ($cur_forum = $db->fetch_assoc($result)) { if ($cur_forum['cid'] != $cur_category) { // A new category since last iteration? if ($cur_category) { echo "\t\t\t\t\t\t\t\t" . '</div>' . "\n"; echo "\t\t\t\t\t\t\t" . '</fieldset>' . "\n"; } echo "\t\t\t\t\t\t\t" . '<fieldset><h3><span>' . luna_htmlspecialchars($cur_forum['cat_name']) . '</span></h3>' . "\n"; echo "\t\t\t\t\t\t\t\t" . '<div>'; $cur_category = $cur_forum['cid']; } echo "\t\t\t\t\t\t\t\t" . '<input type="checkbox" name="forums[]" id="forum-' . $cur_forum['fid'] . '" value="' . $cur_forum['fid'] . '" /> ' . luna_htmlspecialchars($cur_forum['forum_name']) . '<br />' . "\n"; } if ($cur_category) { echo "\t\t\t\t\t\t\t\t" . '</div>' . "\n"; echo "\t\t\t\t\t\t\t" . '</fieldset>' . "\n"; } echo "\t\t\t\t\t\t" . '</div>' . "\n"; echo "\t\t\t\t\t\t" . '</div></div>' . "\n"; } else { echo "\t\t\t\t\t\t" . '<div class="col-xs-4"><label class="conl">' . __('Forum', 'luna') . "\n"; echo "\t\t\t\t\t\t" . '<br />' . "\n"; echo "\t\t\t\t\t\t" . '<select id="forum" name="forum">' . "\n"; $cur_category = 0; while ($cur_forum = $db->fetch_assoc($result)) { if ($cur_forum['cid'] != $cur_category) { // A new category since last iteration? if ($cur_category) { echo "\t\t\t\t\t\t\t" . '</optgroup>' . "\n"; } echo "\t\t\t\t\t\t\t" . '<optgroup label="' . luna_htmlspecialchars($cur_forum['cat_name']) . '">' . "\n"; $cur_category = $cur_forum['cid']; } echo "\t\t\t\t\t\t\t\t" . '<option value="' . $cur_forum['fid'] . '">' . ($cur_forum['parent_forum_id'] == 0 ? '' : ' ') . luna_htmlspecialchars($cur_forum['forum_name']) . '</option>' . "\n"; } echo "\t\t\t\t\t\t\t" . '</optgroup>' . "\n"; echo "\t\t\t\t\t\t" . '</select>' . "\n"; echo "\t\t\t\t\t\t" . '<br /></label></div>' . "\n"; } }
?> <tr> <td> <a class="btn btn-primary" href="groups.php?edit_group=<?php echo $cur_group['g_id']; ?> " tabindex="<?php echo $cur_index++; ?> "><span class="fa fa-fw fa-pencil-square-o"></span> <?php echo __('Edit', 'luna'); ?> </a> </td> <td class="col-lg-10"><?php echo luna_htmlspecialchars($cur_group['g_title']); ?> </td> <td> <?php if ($cur_group['g_id'] > FORUM_MEMBER) { ?> <a class="btn btn-danger" href="groups.php?del_group=<?php echo $cur_group['g_id']; ?> " tabindex="<?php echo $cur_index++; ?> "><span class="fa fa-fw fa-trash"></span> <?php echo __('Delete', 'luna'); ?>
} } } } } } if ($luna_config['o_feed_type'] == '1') { $page_head = array('feed' => '<link rel="alternate" type="application/rss+xml" href="extern.php?action=feed&type=rss" title="' . __('RSS active topics feed', 'luna') . '" />'); } elseif ($luna_config['o_feed_type'] == '2') { $page_head = array('feed' => '<link rel="alternate" type="application/atom+xml" href="extern.php?action=feed&type=atom" title="' . __('Atom active topics feed', 'luna') . '" />'); } $forum_actions = array(); // Someone clicked "Do not show again" $action = isset($_GET['action']) ? $_GET['action'] : null; if ($action == 'do_not_show') { confirm_referrer(array('index.php', '')); $db->query('UPDATE ' . $db->prefix . 'users SET first_run = 1 WHERE id=' . $luna_user['id']) or error('Unable to disable first run', __FILE__, __LINE__, $db->error()); redirect('index.php'); } // Or want to disable the cookiebar if ($action == 'disable_cookiebar') { luna_cookiebarcookie(); redirect('index.php'); } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title'])); define('FORUM_ALLOW_INDEX', 1); define('FORUM_ACTIVE_PAGE', 'index'); $footer_style = 'index'; require load_page('header.php'); require load_page('index.php'); require load_page('footer.php');
<?php // Make sure no one attempts to run this view directly. if (!defined('FORUM')) { exit; } ?> <div class="col-sm-3 profile-nav"> <div class="user-card-profile"> <h3 class="user-card-title"><?php echo luna_htmlspecialchars($luna_user['username']); ?> </h3> <span class="user-card-avatar thumbnail"> <?php echo $avatar_user_card; ?> </span> </div> <?php load_me_nav('inbox'); ?> </div> <div class="col-sm-9 profile"> <p><span class="pages-label"><?php echo paginate($num_pages, $page, 'inbox.php?'); ?> </span></p> <div class="btn-toolbar btn-toolbar-inbox"> <div class="btn-group pull-right"> <a type="button" class="btn btn-success" href="new_inbox.php?reply=<?php
</div> </div> <div class="container"> <?php if (isset($errors)) { draw_error_panel($errors); } if (isset($message)) { draw_preview_panel($message); } ?> <form id="edit" method="post" action="edit.php?id=<?php echo $id; ?> &action=edit" onsubmit="return process_form(this)"> <?php if ($can_edit_subject) { ?> <input class="info-textfield form-control" type="text" name="req_subject" maxlength="70" value="<?php echo luna_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']); ?> " tabindex="<?php echo $cur_index++; ?> " /> <?php } draw_editor('20'); ?> </form>
} ?> "><?php echo format_time($cur_comment['commented']); ?> </a></small></h4> </div> </div> <div class="well-content"> <?php echo $cur_comment['message'] . "\n"; ?> <?php if (!isset($inbox)) { if ($cur_comment['edited'] != '') { echo '<p class="comment-edited"><em>' . __('Last edited by', 'luna') . ' ' . luna_htmlspecialchars($cur_comment['edited_by']) . ' (' . format_time($cur_comment['edited']) . ')</em></p>'; } } ?> <?php if ($signature != '' || !$luna_user['is_guest']) { echo '<hr />'; } ?> <?php if ($signature != '') { echo "\t\t\t\t\t" . '<div class="comment-signature">' . $signature . '</div>' . "\n"; } ?> <?php if (!$luna_user['is_guest']) {
} 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>
exit; } ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php draw_delete_title(); ?> </h3> </div> <div class="panel-body"> <?php draw_soft_reset_form($id); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php echo luna_htmlspecialchars($cur_comment['commenter']); ?> </h3> </div> <div class="panel-body"> <?php echo $cur_comment['message']; ?> </div> </div>
// Define standard date/time formats $forum_time_formats = array($luna_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a'); $forum_date_formats = array($luna_config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y'); // Check/update/set cookie and fetch user info $luna_user = array(); check_cookie($luna_user); // Load l10n require_once FORUM_ROOT . 'include/pomo/MO.php'; require_once FORUM_ROOT . 'include/l10n.php'; // Attempt to load the language file if (file_exists(FORUM_ROOT . 'lang/' . $luna_user['language'] . '/luna.mo')) { load_textdomain('luna', FORUM_ROOT . 'lang/' . $luna_user['language'] . '/luna.mo'); } elseif (file_exists(FORUM_ROOT . 'lang/English/luna.mo')) { load_textdomain('luna', FORUM_ROOT . 'lang/English/luna.mo'); } else { error('There is no valid language pack \'' . luna_htmlspecialchars($luna_user['language']) . '\' installed. Please reinstall a language of that name'); } // Check if we are to display a maintenance message if ($luna_config['o_maintenance'] && $luna_user['g_id'] > FORUM_ADMIN && !defined('FORUM_TURN_OFF_MAINT')) { maintenance_message(); } // Load cached bans if (file_exists(FORUM_CACHE_DIR . 'cache_bans.php')) { include FORUM_CACHE_DIR . 'cache_bans.php'; } if (!defined('FORUM_BANS_LOADED')) { if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) { require FORUM_ROOT . 'include/cache.php'; } generate_bans_cache(); require FORUM_CACHE_DIR . 'cache_bans.php';
// Loop through users we found while ($cur_hit = $db->fetch_assoc($result)) { if ($cur_hit['last_email_sent'] != '' && time() - $cur_hit['last_email_sent'] < 3600 && time() - $cur_hit['last_email_sent'] >= 0) { message(sprintf(__('This account has already requested a password reset in the past hour. Please wait %s minutes before requesting a new password again.', 'luna'), intval((3600 - (time() - $cur_hit['last_email_sent'])) / 60)), true); } // Generate a new password and a new password activation code $new_password = random_pass(12); $new_password_key = random_pass(8); $db->query('UPDATE ' . $db->prefix . 'users SET activate_string=\'' . luna_hash($new_password) . '\', activate_key=\'' . $new_password_key . '\', last_email_sent = ' . time() . ' WHERE id=' . $cur_hit['id']) or error('Unable to update activation data', __FILE__, __LINE__, $db->error()); // Do the user specific replacements to the template $cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message); $cur_mail_message = str_replace('<activation_url>', get_base_url() . '/settings.php?id=' . $cur_hit['id'] . '&action=change_pass&key=' . $new_password_key, $cur_mail_message); $cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message); luna_mail($email, $mail_subject, $cur_mail_message); } message(__('An email has been sent to the specified address with instructions on how to change your password. If it does not arrive you can contact the forum administrator at', 'luna') . ' <a href="mailto:' . luna_htmlspecialchars($luna_config['o_admin_email']) . '">' . luna_htmlspecialchars($luna_config['o_admin_email']) . '</a>.', true); } else { message(__('There is no user registered with the email address', 'luna') . ' ' . htmlspecialchars($email) . '.'); } } } } // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login) if (!empty($_SERVER['HTTP_REFERER'])) { $redirect_url = validate_redirect($_SERVER['HTTP_REFERER'], null); } if (!isset($redirect_url)) { $redirect_url = get_base_url(true) . '/index.php'; } elseif (preg_match('%viewtopic\\.php\\?pid=(\\d+)$%', $redirect_url, $matches)) { $redirect_url .= '#p' . $matches[1]; }