Exemple #1
0
 public function deletepost($id)
 {
     global $lang_common, $lang_post, $pd;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Fetch some informations about the post, the topic and the forum
     $cur_post = $this->model->get_info_delete($id);
     if ($this->config['o_censoring'] == '1') {
         $cur_post['subject'] = censor_words($cur_post['subject']);
     }
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array();
     $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false;
     $is_topic_post = $id == $cur_post['first_post_id'] ? true : false;
     // Do we have permission to edit this post?
     if (($this->user->g_delete_posts == '0' || $this->user->g_delete_topics == '0' && $is_topic_post || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) {
         message($lang_common['No permission'], '403');
     }
     if ($is_admmod && $this->user->g_id != FEATHER_ADMIN && in_array($cur_post['poster_id'], get_admin_ids())) {
         message($lang_common['No permission'], '403');
     }
     // Load the delete.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/delete.php';
     if ($this->feather->request()->isPost()) {
         $this->model->handle_deletion($is_topic_post, $id, $cur_post['tid'], $cur_post['fid']);
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_delete['Delete post']);
     define('FEATHER_ACTIVE_PAGE', 'delete');
     $this->header->setTitle($page_title)->display();
     require FEATHER_ROOT . 'include/parser.php';
     $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
     $this->feather->render('delete.php', array('lang_common' => $lang_common, 'lang_delete' => $lang_delete, 'cur_post' => $cur_post, 'id' => $id, 'is_topic_post' => $is_topic_post));
     $this->footer->display();
 }
Exemple #2
0
 public function display()
 {
     global $lang_common;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     } elseif ($this->user->g_view_users == '0') {
         message($lang_common['No permission'], '403');
     }
     // Load the userlist.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/userlist.php';
     // Load the search.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/search.php';
     // Determine if we are allowed to view post counts
     $show_post_count = $this->config['o_show_post_count'] == '1' || $this->user->is_admmod ? true : false;
     $username = $this->request->get('username') && $this->user->g_search_users == '1' ? feather_trim($this->request->get('username')) : '';
     $show_group = $this->request->get('show_group') ? intval($this->request->get('show_group')) : -1;
     $sort_by = $this->request->get('sort_by') && (in_array($this->request->get('sort_by'), array('username', 'registered')) || $this->request->get('sort_by') == 'num_posts' && $show_post_count) ? $this->request->get('sort_by') : 'username';
     $sort_dir = $this->request->get('sort_dir') && $this->request->get('sort_dir') == 'DESC' ? 'DESC' : 'ASC';
     $num_users = $this->model->fetch_user_count($username, $show_group);
     // Determine the user offset (based on $page)
     $num_pages = ceil($num_users / 50);
     $p = !$this->request->get('p') || $page <= 1 || $page > $num_pages ? 1 : intval($page);
     $start_from = 50 * ($p - 1);
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_common['User list']);
     if ($this->user->g_search_users == '1') {
         $focus_element = array('userlist', 'username');
     }
     // Generate paging links
     $paging_links = '<span class="pages-label">' . $lang_common['Pages'] . ' </span>' . paginate_old($num_pages, $p, '?username='******'&amp;show_group=' . $show_group . '&amp;sort_by=' . $sort_by . '&amp;sort_dir=' . $sort_dir);
     define('FEATHER_ALLOW_INDEX', 1);
     define('FEATHER_ACTIVE_PAGE', 'userlist');
     $this->header->setTitle($page_title)->setPage($p)->setFocusElement($focus_element)->setPagingLinks($paging_links)->display();
     $this->feather->render('userlist.php', array('lang_common' => $lang_common, 'lang_search' => $lang_search, 'lang_ul' => $lang_ul, 'feather' => $this->feather, 'username' => $username, 'show_group' => $show_group, 'sort_by' => $sort_by, 'sort_dir' => $sort_dir, 'show_post_count' => $show_post_count, 'paging_links' => $paging_links, 'feather_config' => $this->config, 'dropdown_menu' => $this->model->generate_dropdown_menu($show_group), 'userlist_data' => $this->model->print_users($username, $start_from, $sort_by, $sort_dir, $show_group)));
     $this->footer->display();
 }
Exemple #3
0
 public function display()
 {
     global $lang_common, $lang_admin_common, $lang_admin_censoring;
     require FEATHER_ROOT . 'include/common_admin.php';
     if ($this->user->g_id != FEATHER_ADMIN) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Load the admin_options.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/censoring.php';
     // Add a censor word
     if ($this->request->post('add_word')) {
         $this->model->add_word();
     } elseif ($this->request->post('update')) {
         $this->model->update_word();
     } elseif ($this->request->post('remove')) {
         $this->model->remove_word();
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Censoring']);
     $focus_element = array('censoring', 'new_search_for');
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->setFocusElement($focus_element)->display();
     generate_admin_menu('censoring');
     $this->feather->render('admin/censoring.php', array('lang_admin_censoring' => $lang_admin_censoring, 'lang_admin_common' => $lang_admin_common, 'feather_config' => $this->config, 'word_data' => $this->model->get_words()));
     $this->footer->display();
 }
Exemple #4
0
 public function display($id = null, $name = null, $page = null, $pid = null)
 {
     global $lang_common, $lang_post, $lang_topic, $lang_bbeditor, $pd;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Load the viewtopic.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/topic.php';
     // Load the post.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/post.php';
     // Antispam feature
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/antispam.php';
     $index_questions = rand(0, count($lang_antispam_questions) - 1);
     // BBcode toolbar feature
     require FEATHER_ROOT . 'lang/' . $this->user['language'] . '/bbeditor.php';
     // Load the viewtopic.php model file
     require_once FEATHER_ROOT . 'model/viewtopic.php';
     // Fetch some informations about the topic TODO
     $cur_topic = $this->model->get_info_topic($id);
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_topic['moderators'] != '' ? unserialize($cur_topic['moderators']) : array();
     $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false;
     if ($is_admmod) {
         $admin_ids = get_admin_ids();
     }
     // Can we or can we not post replies?
     $post_link = $this->model->get_post_link($id, $cur_topic['closed'], $cur_topic['post_replies'], $is_admmod);
     // Add/update this topic in our list of tracked topics
     if (!$this->user->is_guest) {
         $tracked_topics = get_tracked_topics();
         $tracked_topics['topics'][$id] = time();
         set_tracked_topics($tracked_topics);
     }
     // Determine the post offset (based on $_GET['p'])
     $num_pages = ceil(($cur_topic['num_replies'] + 1) / $this->user->disp_posts);
     $p = !isset($page) || $page <= 1 || $page > $num_pages ? 1 : intval($page);
     $start_from = $this->user->disp_posts * ($p - 1);
     $url_topic = url_friendly($cur_topic['subject']);
     $url_forum = url_friendly($cur_topic['forum_name']);
     // Generate paging links
     $paging_links = '<span class="pages-label">' . $lang_common['Pages'] . ' </span>' . paginate($num_pages, $p, 'topic/' . $id . '/' . $url_topic . '/#');
     if ($this->config['o_censoring'] == '1') {
         $cur_topic['subject'] = censor_words($cur_topic['subject']);
     }
     $quickpost = $this->model->is_quickpost($cur_topic['post_replies'], $cur_topic['closed'], $is_admmod);
     $subscraction = $this->model->get_subscraction($cur_topic['is_subscribed'], $id);
     // Add relationship meta tags
     $page_head = $this->model->get_page_head($id, $num_pages, $p, $url_topic);
     $page_title = array(feather_escape($this->config['o_board_title']), feather_escape($cur_topic['forum_name']), feather_escape($cur_topic['subject']));
     define('FEATHER_ALLOW_INDEX', 1);
     define('FEATHER_ACTIVE_PAGE', 'viewtopic');
     $this->header->setTitle($page_title)->setPage($p)->setPagingLinks($paging_links)->setPageHead($page_head)->display();
     $forum_id = $cur_topic['forum_id'];
     require FEATHER_ROOT . 'include/parser.php';
     $this->feather->render('viewtopic.php', array('id' => $id, 'p' => $p, 'post_data' => $this->model->print_posts($id, $start_from, $cur_topic, $is_admmod), 'lang_common' => $lang_common, 'lang_topic' => $lang_topic, 'lang_post' => $lang_post, 'lang_bbeditor' => $lang_bbeditor, 'cur_topic' => $cur_topic, 'subscraction' => $subscraction, 'is_admmod' => $is_admmod, 'feather_config' => $this->config, 'paging_links' => $paging_links, 'post_link' => $post_link, 'start_from' => $start_from, 'lang_antispam' => $lang_antispam, 'pid' => $pid, 'quickpost' => $quickpost, 'index_questions' => $index_questions, 'lang_antispam_questions' => $lang_antispam_questions, 'url_forum' => $url_forum, 'url_topic' => $url_topic, 'feather' => $this->feather));
     // Increment "num_views" for topic
     $this->model->increment_views($id);
     $this->footer->display('viewtopic', $id, $p, $pid, $cur_topic['forum_id'], $num_pages);
 }
Exemple #5
0
 public function editpost($id)
 {
     global $lang_common, $lang_prof_reg, $lang_post, $lang_register;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Fetch some informations about the post, the topic and the forum
     $cur_post = $this->model->get_info_edit($id);
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array();
     $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false;
     $can_edit_subject = $id == $cur_post['first_post_id'];
     if ($this->config['o_censoring'] == '1') {
         $cur_post['subject'] = censor_words($cur_post['subject']);
         $cur_post['message'] = censor_words($cur_post['message']);
     }
     // Do we have permission to edit this post?
     if (($this->user->g_edit_posts == '0' || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) {
         message($lang_common['No permission'], '403');
     }
     if ($is_admmod && $this->user->g_id != FEATHER_ADMIN && in_array($cur_post['poster_id'], get_admin_ids())) {
         message($lang_common['No permission'], '403');
     }
     // Load the post.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/post.php';
     // Load the bbeditor.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/bbeditor.php';
     // Start with a clean slate
     $errors = array();
     if ($this->feather->request()->isPost()) {
         // Let's see if everything went right
         $errors = $this->model->check_errors_before_edit($id, $can_edit_subject, $errors);
         // Setup some variables before post
         $post = $this->model->setup_variables($cur_post, $is_admmod, $can_edit_subject, $errors);
         // Did everything go according to plan?
         if (empty($errors) && !$this->request->post('preview')) {
             // Edit the post
             $this->model->edit_post($id, $can_edit_subject, $post, $cur_post, $is_admmod);
             redirect(get_link('post/' . $id . '/#p' . $id), $lang_post['Post redirect']);
         }
     } else {
         $post = '';
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_post['Edit post']);
     $required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
     $focus_element = array('edit', 'req_message');
     define('FEATHER_ACTIVE_PAGE', 'edit');
     $this->header->setTitle($page_title)->setFocusElement($focus_element)->setRequiredFields($required_fields)->display();
     if ($this->request->post('preview')) {
         require_once FEATHER_ROOT . 'include/parser.php';
         $preview_message = parse_message($post['message'], $post['hide_smilies']);
     } else {
         $preview_message = '';
     }
     $this->feather->render('edit.php', array('lang_common' => $lang_common, 'cur_post' => $cur_post, 'lang_post' => $lang_post, 'errors' => $errors, 'preview_message' => $preview_message, 'id' => $id, 'feather_config' => $this->config, 'feather_user' => $this->user, 'checkboxes' => $this->model->get_checkboxes($can_edit_subject, $is_admmod, $cur_post, 1), 'feather' => $this->feather, 'can_edit_subject' => $can_edit_subject, 'post' => $post, 'lang_bbeditor' => $lang_bbeditor));
     $this->footer->display();
 }
Exemple #6
0
 public function generate_dropdown_menu($show_group)
 {
     $dropdown_menu = '';
     $select_dropdown_menu = array('g_id', 'g_title');
     $result = DB::for_table('groups')->select_many($select_dropdown_menu)->where_not_equal('g_id', FEATHER_GUEST)->order_by('g_id')->find_many();
     foreach ($result as $cur_group) {
         if ($cur_group['g_id'] == $show_group) {
             $dropdown_menu .= "\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '" selected="selected">' . feather_escape($cur_group['g_title']) . '</option>' . "\n";
         } else {
             $dropdown_menu .= "\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '">' . feather_escape($cur_group['g_title']) . '</option>' . "\n";
         }
     }
     return $dropdown_menu;
 }
Exemple #7
0
 public function display()
 {
     global $lang_common;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Load the help.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/help.php';
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_help['Help']);
     define('FEATHER_ACTIVE_PAGE', 'help');
     $this->header->setTitle($page_title)->display();
     $this->feather->render('help.php', array('lang_help' => $lang_help, 'lang_common' => $lang_common));
     $this->footer->display();
 }
Exemple #8
0
 public function display()
 {
     global $lang_common;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Load the index.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/index.php';
     $page_title = array(feather_escape($this->config['o_board_title']));
     define('FEATHER_ALLOW_INDEX', 1);
     define('FEATHER_ACTIVE_PAGE', 'index');
     $this->header->setTitle($page_title)->display();
     $this->feather->render('index.php', array('index_data' => $this->model->print_categories_forums(), 'lang_common' => $lang_common, 'lang_index' => $lang_index, 'stats' => $this->model->collect_stats(), 'feather_config' => $this->config, 'online' => $this->model->fetch_users_online(), 'forum_actions' => $this->model->get_forum_actions(), 'cur_cat' => 0));
     $this->footer->display();
 }
Exemple #9
0
 public function display()
 {
     global $lang_common, $lang_admin_common, $lang_admin_index;
     require FEATHER_ROOT . 'include/common_admin.php';
     if (!$this->user->is_admmod) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Load the admin_index.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/index.php';
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Server statistics']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     generate_admin_menu('index');
     $total = $this->model->get_total_size();
     $this->feather->render('admin/statistics.php', array('lang_admin_common' => $lang_admin_common, 'lang_admin_index' => $lang_admin_index, 'feather_config' => $this->config, 'server_load' => $this->model->get_server_load(), 'num_online' => $this->model->get_num_online(), 'total_size' => $total['size'], 'total_records' => $total['records'], 'php_accelerator' => $this->model->get_php_accelerator(), 'feather' => $this->feather));
     $this->footer->display();
 }
Exemple #10
0
 public function display($id, $name = null, $page = null)
 {
     global $lang_common, $lang_forum;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     if ($id < 1) {
         message($lang_common['Bad request'], '404');
     }
     // Load the viewforum.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/forum.php';
     // Fetch some informations about the forum
     $cur_forum = $this->model->get_info_forum($id);
     // Is this a redirect forum? In that case, redirect!
     if ($cur_forum['redirect_url'] != '') {
         header('Location: ' . $cur_forum['redirect_url']);
         exit;
     }
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_forum['moderators'] != '' ? unserialize($cur_forum['moderators']) : array();
     $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false;
     $sort_by = $this->model->sort_forum_by($cur_forum['sort_by']);
     // Can we or can we not post new topics?
     if ($cur_forum['post_topics'] == '' && $this->user->g_post_topics == '1' || $cur_forum['post_topics'] == '1' || $is_admmod) {
         $post_link = "\t\t\t" . '<p class="postlink conr"><a href="' . get_link('post/new-topic/' . $id . '/') . '">' . $lang_forum['Post topic'] . '</a></p>' . "\n";
     } else {
         $post_link = '';
     }
     // Determine the topic offset (based on $page)
     $num_pages = ceil($cur_forum['num_topics'] / $this->user->disp_topics);
     $p = !isset($page) || $page <= 1 || $page > $num_pages ? 1 : intval($page);
     $start_from = $this->user->disp_topics * ($p - 1);
     $url_forum = url_friendly($cur_forum['forum_name']);
     // Generate paging links
     $paging_links = '<span class="pages-label">' . $lang_common['Pages'] . ' </span>' . paginate($num_pages, $p, 'forum/' . $id . '/' . $url_forum . '/#');
     $forum_actions = $this->model->get_forum_actions($id, $this->config['o_forum_subscriptions'], $cur_forum['is_subscribed']);
     $page_title = array(feather_escape($this->config['o_board_title']), feather_escape($cur_forum['forum_name']));
     define('FEATHER_ALLOW_INDEX', 1);
     define('FEATHER_ACTIVE_PAGE', 'viewforum');
     $page_head = $this->model->get_page_head($id, $num_pages, $p, $url_forum);
     $this->header->setTitle($page_title)->setPage($p)->setPagingLinks($paging_links)->setPageHead($page_head)->display();
     $this->feather->render('viewforum.php', array('id' => $id, 'forum_data' => $this->model->print_topics($id, $sort_by, $start_from), 'lang_common' => $lang_common, 'lang_forum' => $lang_forum, 'cur_forum' => $cur_forum, 'paging_links' => $paging_links, 'post_link' => $post_link, 'is_admmod' => $is_admmod, 'start_from' => $start_from, 'url_forum' => $url_forum, 'forum_actions' => $forum_actions));
     $this->footer->display('viewforum', $id, $p, '', $id, $num_pages);
 }
Exemple #11
0
 public function display()
 {
     global $lang_common, $lang_admin_maintenance, $lang_admin_common;
     require FEATHER_ROOT . 'include/common_admin.php';
     if ($this->user->g_id != FEATHER_ADMIN) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Load the admin_options.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/maintenance.php';
     $action = '';
     if ($this->request->post('action')) {
         $action = $this->request->post('action');
     } elseif ($this->request->get('action')) {
         $action = $this->request->get('action');
     }
     if ($action == 'rebuild') {
         $this->model->rebuild();
         $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_maintenance['Rebuilding search index']);
         $this->feather->render('admin/maintenance/rebuild.php', array('lang_admin_maintenance' => $lang_admin_maintenance, 'page_title' => $page_title));
         $query_str = $this->model->get_query_str();
         exit('<script type="text/javascript">window.location="' . get_link('admin/maintenance/') . $query_str . '"</script><hr /><p>' . sprintf($lang_admin_maintenance['Javascript redirect failed'], '<a href="' . get_link('admin/maintenance/') . $query_str . '">' . $lang_admin_maintenance['Click here'] . '</a>') . '</p>');
     }
     if ($action == 'prune') {
         $prune_from = feather_trim($this->request->post('prune_from'));
         $prune_sticky = intval($this->request->post('prune_sticky'));
         $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Prune']);
         define('FEATHER_ACTIVE_PAGE', 'admin');
         $this->header->setTitle($page_title)->display();
         generate_admin_menu('maintenance');
         if ($this->request->post('prune_comply')) {
             $this->model->prune_comply($prune_from, $prune_sticky);
         }
         $this->feather->render('admin/maintenance/prune.php', array('lang_admin_maintenance' => $lang_admin_maintenance, 'lang_admin_common' => $lang_admin_common, 'prune_sticky' => $prune_sticky, 'prune_from' => $prune_from, 'prune' => $this->model->get_info_prune($prune_sticky, $prune_from)));
         $this->footer->display();
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Maintenance']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     generate_admin_menu('maintenance');
     $this->feather->render('admin/maintenance/admin_maintenance.php', array('lang_admin_maintenance' => $lang_admin_maintenance, 'lang_admin_common' => $lang_admin_common, 'first_id' => $this->model->get_first_id(), 'categories' => $this->model->get_categories()));
     $this->footer->display();
 }
Exemple #12
0
 public function forget()
 {
     global $lang_common, $lang_login;
     define('FEATHER_QUIET_VISIT', 1);
     if (!$this->user->is_guest) {
         header('Location: ' . get_base_url());
         exit;
     }
     // Load the login.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/login.php';
     $errors = $this->model->password_forgotten();
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_login['Request pass']);
     $required_fields = array('req_email' => $lang_common['Email']);
     $focus_element = array('request_pass', 'req_email');
     define('FEATHER_ACTIVE_PAGE', 'login');
     $this->header->setTitle($page_title)->setFocusElement($focus_element)->setRequiredFields($required_fields)->display();
     $this->feather->render('login/password_forgotten.php', array('errors' => $errors, 'lang_login' => $lang_login, 'lang_common' => $lang_common));
     $this->footer->display();
 }
Exemple #13
0
 public function display()
 {
     global $lang_common, $lang_admin_common;
     require FEATHER_ROOT . 'include/common_admin.php';
     if ($this->user->g_id != FEATHER_ADMIN) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Load the admin_options.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/options.php';
     if ($this->feather->request->isPost()) {
         $this->model->update_options();
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Options']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     generate_admin_menu('options');
     $this->feather->render('admin/options.php', array('lang_admin_options' => $lang_admin_options, 'feather_config' => $this->config, 'feather_user' => $this->user, 'languages' => forum_list_langs(), 'styles' => $this->model->get_styles(), 'times' => $this->model->get_times(), 'feather' => $this->feather));
     $this->footer->display();
 }
Exemple #14
0
 public function display()
 {
     global $lang_common, $lang_admin_common, $lang_admin_permissions;
     require FEATHER_ROOT . 'include/common_admin.php';
     if (!$this->user->is_admmod) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Load the admin_options.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/permissions.php';
     // Update permissions
     if ($this->feather->request->isPost()) {
         $this->model->update_permissions();
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Permissions']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     generate_admin_menu('permissions');
     $this->feather->render('admin/permissions.php', array('lang_admin_permissions' => $lang_admin_permissions, 'lang_admin_common' => $lang_admin_common, 'feather_config' => $this->config));
     $this->footer->display();
 }
Exemple #15
0
 public function display($action = null)
 {
     global $lang_common, $lang_admin_common, $lang_admin_index;
     require FEATHER_ROOT . 'include/common_admin.php';
     if (!$this->user->is_admmod) {
         message($lang_common['No permission'], '403');
     }
     // Load the admin_index.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/index.php';
     define('FEATHER_ADMIN_CONSOLE', 1);
     // Check for upgrade
     if ($action == 'check_upgrade') {
         if (!ini_get('allow_url_fopen')) {
             message($lang_admin_index['fopen disabled message']);
         }
         $latest_version = trim(@file_get_contents('http://featherbb.org/latest_version'));
         if (empty($latest_version)) {
             message($lang_admin_index['Upgrade check failed message']);
         }
         if (version_compare($this->config['o_cur_version'], $latest_version, '>=')) {
             message($lang_admin_index['Running latest version message']);
         } else {
             message(sprintf($lang_admin_index['New version available message'], '<a href="http://featherbb.org/">FeatherBB.org</a>'));
         }
     } elseif ($action == 'remove_install_file') {
         $deleted = $this->remove_install_folder(FEATHER_ROOT . 'install');
         if ($deleted) {
             redirect(get_link('admin/'), $lang_admin_index['Deleted install.php redirect']);
         } else {
             message($lang_admin_index['Delete install.php failed']);
         }
     }
     $install_folder_exists = is_dir(FEATHER_ROOT . 'install');
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Index']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     generate_admin_menu('index');
     $this->feather->render('admin/index.php', array('lang_admin_index' => $lang_admin_index, 'install_file_exists' => $install_folder_exists, 'feather_config' => $this->config));
     $this->footer->display();
 }
Exemple #16
0
 public function display()
 {
     global $lang_common, $lang_admin_common;
     require FEATHER_ROOT . 'include/common_admin.php';
     if (!$this->user->is_admmod) {
         message($lang_common['No permission'], '403');
     }
     define('FEATHER_ADMIN_CONSOLE', 1);
     // The plugin to load should be supplied via GET
     $plugin = $this->request->get('plugin') ? $this->request->get('plugin') : '';
     if (!preg_match('%^AM?P_(\\w*?)\\.php$%i', $plugin)) {
         message($lang_common['Bad request'], '404');
     }
     // AP_ == Admins only, AMP_ == admins and moderators
     $prefix = substr($plugin, 0, strpos($plugin, '_'));
     if ($this->user->g_moderator == '1' && $prefix == 'AP') {
         message($lang_common['No permission'], '403');
     }
     // Make sure the file actually exists
     if (!file_exists(FEATHER_ROOT . 'plugins/' . $plugin)) {
         message(sprintf($lang_admin_common['No plugin message'], $plugin));
     }
     // Construct REQUEST_URI if it isn't set TODO?
     if (!isset($_SERVER['REQUEST_URI'])) {
         $_SERVER['REQUEST_URI'] = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '') . '?' . (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], str_replace('_', ' ', substr($plugin, strpos($plugin, '_') + 1, -4)));
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->display();
     // Attempt to load the plugin. We don't use @ here to suppress error messages,
     // because if we did and a parse error occurred in the plugin, we would only
     // get the "blank page of death"
     include FEATHER_ROOT . 'plugins/' . $plugin;
     if (!defined('FEATHER_PLUGIN_LOADED')) {
         message(sprintf($lang_admin_common['Plugin failed message'], $plugin));
     }
     $this->feather->render('admin/loader.php');
     $this->footer->display();
 }
Exemple #17
0
 public function display()
 {
     global $lang_common, $lang_search, $lang_forum, $lang_topic, $pd;
     // Load the search.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/search.php';
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/forum.php';
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     } elseif ($this->user->g_search == '0') {
         message($lang_search['No search permission'], false, '403 Forbidden');
     }
     require FEATHER_ROOT . 'include/search_idx.php';
     // Figure out what to do :-)
     if ($this->request->get('action') || $this->request->get('search_id')) {
         $search = $this->model->get_search_results();
         // We have results to display
         if (isset($search['is_result'])) {
             $page_title = array(feather_escape($this->config['o_board_title']), $lang_search['Search results']);
             define('FEATHER_ACTIVE_PAGE', 'search');
             $this->header->setTitle($page_title)->display();
             $this->feather->render('search/header.php', array('lang_common' => $lang_common, 'lang_search' => $lang_search, 'search' => $search));
             if ($search['show_as'] == 'posts') {
                 require FEATHER_ROOT . 'lang/' . $this->user->language . '/topic.php';
                 require FEATHER_ROOT . 'include/parser.php';
             }
             $this->model->display_search_results($search, $this->feather);
             $this->feather->render('search/footer.php', array('search' => $search));
             $this->footer->display();
         } else {
             message($lang_search['No hits']);
         }
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_search['Search']);
     $focus_element = array('search', 'keywords');
     define('FEATHER_ACTIVE_PAGE', 'search');
     $this->header->setTitle($page_title)->setFocusElement($focus_element)->display();
     $this->feather->render('search/form.php', array('lang_common' => $lang_common, 'lang_search' => $lang_search, 'feather_config' => $this->config, 'feather' => $this->feather, 'forums' => $this->model->get_list_forums()));
     $this->footer->display();
 }
Exemple #18
0
}
?>
" size="50" maxlength="80" /><br /></label>
<?php 
if ($feather_config['o_regs_verify'] == '1') {
    ?>
						<label class="required"><strong><?php 
    echo $lang_register['Confirm email'];
    ?>
 <span><?php 
    echo $lang_common['Required'];
    ?>
</span></strong><br />
						<input type="text" name="req_email2" value="<?php 
    if ($feather->request->post('req_email2')) {
        echo feather_escape($feather->request->post('req_email2'));
    }
    ?>
" size="50" maxlength="80" /><br /></label>
<?php 
}
?>
					</div>
				</fieldset>
			</div>
<?php 
// Only display the language selection box if there's more than one language available
if (count($languages) > 1) {
    ?>
			<div class="inform">
				<fieldset>
?>
"<?php 
echo $button_status;
?>
 /></p>
			<div class="clearer"></div>
		</div>
		<ul class="crumbs">
			<li><a href="<?php 
echo get_base_url();
?>
"><?php 
echo $lang_common['Index'];
?>
</a></li>
			<li><span>»&#160;</span><a href="<?php 
echo get_link('forum/' . $id . '/' . $url_forum . '/');
?>
"><?php 
echo feather_escape($cur_forum['forum_name']);
?>
</a></li>
			<li><span>»&#160;</span><strong><?php 
echo $lang_misc['Moderate'];
?>
</strong></li>
		</ul>
		<div class="clearer"></div>
	</div>
</div>
</form>
Exemple #20
0
 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;
 }
Exemple #21
0
				<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 
									<th scope="row"><?php 
        echo $lang_admin_groups['Promote users label'];
        ?>
</th>
									<td>
										<select name="promote_next_group" tabindex="3">
											<option value="0"><?php 
        echo $lang_admin_groups['Disable promotion'];
        ?>
</option>
											<?php 
        echo $group_list;
        ?>
										</select>
										<input type="text" name="promote_min_posts" size="5" maxlength="10" value="<?php 
        echo feather_escape($group['info']['g_promote_min_posts']);
        ?>
" tabindex="4" />
										<span><?php 
        printf($lang_admin_groups['Promote users help'], $lang_admin_groups['Disable promotion']);
        ?>
</span>
									</td>
								</tr>
<?php 
        if ($group['mode'] != 'edit' || $feather_config['o_default_user_group'] != $group['info']['g_id']) {
            ?>
								<tr>
									<th scope="row"> <?php 
            echo $lang_admin_groups['Mod privileges label'];
            ?>
Exemple #23
0
?>
">
<h2><span><span class="conr">#<?php 
echo $search['start_from'] + $post_count;
?>
</span> <span><?php 
if ($cur_search['pid'] != $cur_search['first_post_id']) {
    echo $lang_topic['Re'] . ' ';
}
echo $forum;
?>
</span> <span>»&#160;<a href="<?php 
echo get_link('topic/' . $cur_search['tid'] . '/' . $url_topic . '/');
?>
"><?php 
echo feather_escape($cur_search['subject']);
?>
</a></span> <span>»&#160;<a href="<?php 
echo get_link('post/' . $cur_search['pid'] . '/#p' . $cur_search['pid']);
?>
"><?php 
echo format_time($cur_search['pposted']);
?>
</a></span></span></h2>
<div class="box">
	<div class="inbox">
		<div class="postbody">
			<div class="postleft">
				<dl>
					<dt><?php 
echo $cur_search['pposter_disp'];
Exemple #24
0
 public function showusers($ip)
 {
     global $lang_common, $lang_admin_common, $lang_admin_users;
     define('FEATHER_ADMIN_CONSOLE', 1);
     require FEATHER_ROOT . 'include/common_admin.php';
     if (!$this->user->is_admmod) {
         message($lang_common['No permission'], '403');
     }
     // Load the admin_bans.php language file
     require FEATHER_ROOT . 'lang/' . $admin_language . '/users.php';
     if (!@preg_match('%^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$%', $ip) && !@preg_match('%^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$%', $ip)) {
         message($lang_admin_users['Bad IP message']);
     }
     // Fetch user count
     $num_users = $this->model->get_num_users_ip($ip);
     // Determine the user offset (based on $_GET['p'])
     $num_pages = ceil($num_users / 50);
     $p = !$this->request->get('p') || $this->request->get('p') <= 1 || $this->request->get('p') > $num_pages ? 1 : intval($this->request->get('p'));
     $start_from = 50 * ($p - 1);
     // Generate paging links
     $paging_links = '<span class="pages-label">' . $lang_common['Pages'] . ' </span>' . paginate_old($num_pages, $p, '?ip_stats=' . $ip);
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Results head']);
     define('FEATHER_ACTIVE_PAGE', 'admin');
     $this->header->setTitle($page_title)->setPage($p)->setPagingLinks($paging_links)->display();
     $this->feather->render('admin/users/show_users.php', array('lang_admin_users' => $lang_admin_users, 'lang_admin_common' => $lang_admin_common, 'start_from' => $start_from, 'info' => $this->model->get_info_poster($ip, $start_from)));
     $this->footer->display();
 }
Exemple #25
0
 public function print_topics($forum_id, $sort_by, $start_from)
 {
     global $lang_common, $lang_forum;
     // Get topic/forum tracking data
     if (!$this->user->is_guest) {
         $tracked_topics = get_tracked_topics();
     }
     // Retrieve a list of topic IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
     $result = DB::for_table('topics')->select('id')->where('forum_id', $forum_id)->order_by_desc('sticky')->order_by_expr($sort_by)->order_by_desc('id')->limit($this->user->disp_topics)->offset($start_from)->find_many();
     $forum_data = array();
     // If there are topics in this forum
     if ($result) {
         $topic_ids = array();
         foreach ($result as $cur_topic_id) {
             $topic_ids[] = $cur_topic_id['id'];
         }
         // Fetch list of topics to display on this page
         if ($this->user->is_guest || $this->config['o_show_dot'] == '0') {
             // Without "the dot"
             $select_print_topics = array('id', 'poster', 'subject', 'posted', 'last_post', 'last_post_id', 'last_poster', 'num_views', 'num_replies', 'closed', 'sticky', 'moved_to');
             $result = DB::for_table('topics')->select_many($select_print_topics)->where_in('id', $topic_ids)->order_by_desc('sticky')->order_by_expr($sort_by)->order_by_desc('id')->find_many();
         } else {
             // With "the dot"
             $select_print_topics = array('has_posted' => 'p.poster_id', 't.id', 't.subject', 't.poster', 't.posted', 't.last_post', 't.last_post_id', 't.last_poster', 't.num_views', 't.num_replies', 't.closed', 't.sticky', 't.moved_to');
             $result = DB::for_table('topics')->table_alias('t')->select_many($select_print_topics)->left_outer_join('posts', array('t.id', '=', 'p.topic_id'), 'p')->left_outer_join('posts', array('p.poster_id', '=', $this->user->id), null, true)->where_in('t.id', $topic_ids)->group_by('t.id')->order_by_desc('sticky')->order_by_expr($sort_by)->order_by_desc('id')->find_many();
         }
         $topic_count = 0;
         foreach ($result as $cur_topic) {
             ++$topic_count;
             $status_text = array();
             $cur_topic['item_status'] = $topic_count % 2 == 0 ? 'roweven' : 'rowodd';
             $cur_topic['icon_type'] = 'icon';
             $url_subject = url_friendly($cur_topic['subject']);
             if (is_null($cur_topic['moved_to'])) {
                 $cur_topic['last_post_formatted'] = '<a href="' . get_link('post/' . $cur_topic['last_post_id'] . '/#p' . $cur_topic['last_post_id']) . '">' . format_time($cur_topic['last_post']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['last_poster']) . '</span>';
             } else {
                 $cur_topic['last_post_formatted'] = '- - -';
             }
             if ($this->config['o_censoring'] == '1') {
                 $cur_topic['subject'] = censor_words($cur_topic['subject']);
             }
             if ($cur_topic['sticky'] == '1') {
                 $cur_topic['item_status'] .= ' isticky';
                 $status_text[] = '<span class="stickytext">' . $lang_forum['Sticky'] . '</span>';
             }
             if ($cur_topic['moved_to'] != 0) {
                 $cur_topic['subject_formatted'] = '<a href="' . get_link('topic/' . $cur_topic['moved_to'] . '/' . $url_subject . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
                 $status_text[] = '<span class="movedtext">' . $lang_forum['Moved'] . '</span>';
                 $cur_topic['item_status'] .= ' imoved';
             } elseif ($cur_topic['closed'] == '0') {
                 $cur_topic['subject_formatted'] = '<a href="' . get_link('topic/' . $cur_topic['id'] . '/' . $url_subject . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
             } else {
                 $cur_topic['subject_formatted'] = '<a href="' . get_link('topic/' . $cur_topic['id'] . '/' . $url_subject . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
                 $status_text[] = '<span class="closedtext">' . $lang_forum['Closed'] . '</span>';
                 $cur_topic['item_status'] .= ' iclosed';
             }
             if (!$this->user->is_guest && $cur_topic['last_post'] > $this->user->last_visit && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$forum_id]) || $tracked_topics['forums'][$forum_id] < $cur_topic['last_post']) && is_null($cur_topic['moved_to'])) {
                 $cur_topic['item_status'] .= ' inew';
                 $cur_topic['icon_type'] = 'icon icon-new';
                 $cur_topic['subject_formatted'] = '<strong>' . $cur_topic['subject_formatted'] . '</strong>';
                 $subject_new_posts = '<span class="newtext">[ <a href="' . get_link('topic/' . $cur_topic['id'] . '/action/new/') . '" title="' . $lang_common['New posts info'] . '">' . $lang_common['New posts'] . '</a> ]</span>';
             } else {
                 $subject_new_posts = null;
             }
             // Insert the status text before the subject
             $cur_topic['subject_formatted'] = implode(' ', $status_text) . ' ' . $cur_topic['subject_formatted'];
             // Should we display the dot or not? :)
             if (!$this->user->is_guest && $this->config['o_show_dot'] == '1') {
                 if ($cur_topic['has_posted'] == $this->user->id) {
                     $cur_topic['subject_formatted'] = '<strong class="ipost">·&#160;</strong>' . $cur_topic['subject_formatted'];
                     $cur_topic['item_status'] .= ' iposted';
                 }
             }
             $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $this->user->disp_posts);
             if ($num_pages_topic > 1) {
                 $subject_multipage = '<span class="pagestext">[ ' . paginate($num_pages_topic, -1, 'topic/' . $cur_topic['id'] . '/' . $url_subject . '/#') . ' ]</span>';
             } else {
                 $subject_multipage = null;
             }
             // Should we show the "New posts" and/or the multipage links?
             if (!empty($subject_new_posts) || !empty($subject_multipage)) {
                 $cur_topic['subject_formatted'] .= !empty($subject_new_posts) ? ' ' . $subject_new_posts : '';
                 $cur_topic['subject_formatted'] .= !empty($subject_multipage) ? ' ' . $subject_multipage : '';
             }
             $forum_data[] = $cur_topic;
         }
     }
     return $forum_data;
 }
Exemple #26
0
}
?>

<?php 
if (isset($flash['message'])) {
    ?>
<script type="text/javascript" src="<?php 
    echo get_base_url();
    ?>
/js/common.js"></script>
<div id="msgflash" class="block">
    <h2><span><?php 
    echo $lang_common['Info'];
    ?>
</span><span style="float:right;cursor:pointer" onclick="fadeOut('msgflash', 9);">&times;</span></h2>
    <div class="box">
        <div class="inbox">
            <p><?php 
    echo feather_escape($flash['message']);
    ?>
</p>
        </div>
    </div>
</div>
<script type="text/javascript">fadeIn('msgflash', 0);</script>
<?php 
}
?>

<div id="brdmain">
Exemple #27
0
			<input type="hidden" name="<?php 
echo $csrf_key;
?>
" value="<?php 
echo $csrf_token;
?>
">
			<div class="inform">
				<fieldset>
					<legend><?php 
echo $lang_profile['Confirm delete legend'];
?>
</legend>
					<div class="infldset">
						<p><?php 
echo $lang_profile['Confirmation info'] . ' <strong>' . feather_escape($username) . '</strong>.';
?>
</p>
						<div class="rbox">
							<label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php 
echo $lang_profile['Delete posts'];
?>
<br /></label>
						</div>
						<p class="warntext"><strong><?php 
echo $lang_profile['Delete warning'];
?>
</strong></p>
					</div>
				</fieldset>
			</div>
?>
							<label><?php 
echo $lang_profile['Location'];
?>
<br /><input type="text" name="form_location" value="<?php 
echo feather_escape($user['location']);
?>
" size="30" maxlength="30" /><br /></label>
<?php 
if ($feather->user->g_post_links == '1' || $feather->user->g_id == FEATHER_ADMIN) {
    ?>
							<label><?php 
    echo $lang_profile['Website'];
    ?>
<br /><input type="text" name="form_url" value="<?php 
    echo feather_escape($user['url']);
    ?>
" size="50" maxlength="80" /><br /></label>
<?php 
}
?>
					</div>
				</fieldset>
			</div>
			<p class="buttons"><input type="submit" name="update" value="<?php 
echo $lang_common['Submit'];
?>
" /> <?php 
echo $lang_profile['Instructions'];
?>
</p>
Exemple #29
0
										<th scope="row"><?php 
        printf($lang_admin_reports['Reported by'], $report['reporter'] != '' ? '<a href="' . get_link('users/' . $report['reported_by'] . '/') . '">' . feather_escape($report['reporter']) . '</a>' : $lang_admin_reports['Deleted user']);
        ?>
</th>
										<td class="location"><?php 
        echo breadcrumbs(array($report['forum_name'] => get_link('forum/' . $report['forum_id'] . '/' . url_friendly($report['forum_name']) . '/'), $report['subject'] => get_link('forum/' . $report['topic_id'] . '/' . url_friendly($report['subject'])), sprintf($lang_admin_reports['Post ID'], $report['pid']) => get_link('post/' . $report['pid'] . '/#p' . $report['pid'])));
        ?>
</td>
									</tr>
									<tr>
										<th scope="row"><?php 
        echo $lang_admin_reports['Reason'];
        ?>
</th>
										<td><?php 
        echo str_replace("\n", '<br />', feather_escape($report['message']));
        ?>
</td>
									</tr>
								</table>
							</div>
						</fieldset>
					</div>
					<?php 
    }
} else {
    ?>
				<div class="inform">
					<fieldset>
						<legend><?php 
    echo $lang_admin_common['None'];
Exemple #30
0
 public function display_topics($fid, $sort_by, $start_from)
 {
     global $lang_forum, $lang_common;
     $topic_data = array();
     // Get topic/forum tracking data
     if (!$this->user->is_guest) {
         $tracked_topics = get_tracked_topics();
     }
     // Retrieve a list of topic IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
     $result = DB::for_table('topics')->select('id')->where('forum_id', $fid)->order_by_expr('sticky DESC, ' . $sort_by)->limit($this->user->disp_topics)->offset($start_from)->find_many();
     // If there are topics in this forum
     if ($result) {
         foreach ($result as $id) {
             $topic_ids[] = $id['id'];
         }
         // Select topics
         $select_display_topics = array('id', 'poster', 'subject', 'posted', 'last_post', 'last_post_id', 'last_poster', 'num_views', 'num_replies', 'closed', 'sticky', 'moved_to');
         // TODO: order_by_expr && result_set
         $result = DB::for_table('topics')->select_many($select_display_topics)->where_in('id', $topic_ids)->order_by_expr('sticky DESC, ' . $sort_by . ', id DESC')->find_many();
         $topic_count = 0;
         foreach ($result as $cur_topic) {
             ++$topic_count;
             $status_text = array();
             $cur_topic['item_status'] = $topic_count % 2 == 0 ? 'roweven' : 'rowodd';
             $cur_topic['icon_type'] = 'icon';
             $url_topic = url_friendly($cur_topic['subject']);
             if (is_null($cur_topic['moved_to'])) {
                 $cur_topic['last_post_disp'] = '<a href="' . get_link('post/' . $cur_topic['last_post_id'] . '/#p' . $cur_topic['last_post_id']) . '">' . format_time($cur_topic['last_post']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['last_poster']) . '</span>';
                 $cur_topic['ghost_topic'] = false;
             } else {
                 $cur_topic['last_post_disp'] = '- - -';
                 $cur_topic['ghost_topic'] = true;
             }
             if ($this->config['o_censoring'] == '1') {
                 $cur_topic['subject'] = censor_words($cur_topic['subject']);
             }
             if ($cur_topic['sticky'] == '1') {
                 $cur_topic['item_status'] .= ' isticky';
                 $status_text[] = '<span class="stickytext">' . $lang_forum['Sticky'] . '</span>';
             }
             if ($cur_topic['moved_to'] != 0) {
                 $cur_topic['subject_disp'] = '<a href="' . get_link('topic/' . $cur_topic['moved_to'] . '/' . $url_topic . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
                 $status_text[] = '<span class="movedtext">' . $lang_forum['Moved'] . '</span>';
                 $cur_topic['item_status'] .= ' imoved';
             } elseif ($cur_topic['closed'] == '0') {
                 $cur_topic['subject_disp'] = '<a href="' . get_link('topic/' . $cur_topic['id'] . '/' . $url_topic . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
             } else {
                 $cur_topic['subject_disp'] = '<a href="' . get_link('topic/' . $cur_topic['id'] . '/' . $url_topic . '/') . '">' . feather_escape($cur_topic['subject']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . feather_escape($cur_topic['poster']) . '</span>';
                 $status_text[] = '<span class="closedtext">' . $lang_forum['Closed'] . '</span>';
                 $cur_topic['item_status'] .= ' iclosed';
             }
             if (!$cur_topic['ghost_topic'] && $cur_topic['last_post'] > $this->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'])) {
                 $cur_topic['item_status'] .= ' inew';
                 $cur_topic['icon_type'] = 'icon icon-new';
                 $cur_topic['subject_disp'] = '<strong>' . $cur_topic['subject_disp'] . '</strong>';
                 $subject_new_posts = '<span class="newtext">[ <a href="' . get_link('topic/' . $cur_topic['id'] . '/action/new/') . '" title="' . $lang_common['New posts info'] . '">' . $lang_common['New posts'] . '</a> ]</span>';
             } else {
                 $subject_new_posts = null;
             }
             // Insert the status text before the subject
             $cur_topic['subject_disp'] = implode(' ', $status_text) . ' ' . $cur_topic['subject_disp'];
             $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $this->user->disp_posts);
             if ($num_pages_topic > 1) {
                 $subject_multipage = '<span class="pagestext">[ ' . paginate($num_pages_topic, -1, 'topic/' . $cur_topic['id'] . '/' . $url_topic . '/#') . ' ]</span>';
             } else {
                 $subject_multipage = null;
             }
             // Should we show the "New posts" and/or the multipage links?
             if (!empty($subject_new_posts) || !empty($subject_multipage)) {
                 $cur_topic['subject_disp'] .= !empty($subject_new_posts) ? ' ' . $subject_new_posts : '';
                 $cur_topic['subject_disp'] .= !empty($subject_multipage) ? ' ' . $subject_multipage : '';
             }
             $topic_data[] = $cur_topic;
         }
     }
     return $topic_data;
 }