/**
  * This listener is run when the KernelEvents::EXCEPTION event is triggered
  *
  * @param GetResponseForExceptionEvent $event
  * @return null
  */
 public function on_kernel_exception(GetResponseForExceptionEvent $event)
 {
     $exception = $event->getException();
     $message = $exception->getMessage();
     if ($exception instanceof \phpbb\exception\exception_interface) {
         $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($message), $exception->get_parameters()));
     }
     if (!$event->getRequest()->isXmlHttpRequest()) {
         page_header($this->user->lang('INFORMATION'));
         $this->template->assign_vars(array('MESSAGE_TITLE' => $this->user->lang('INFORMATION'), 'MESSAGE_TEXT' => $message));
         $this->template->set_filenames(array('body' => 'message_body.html'));
         page_footer(true, false, false);
         $response = new Response($this->template->assign_display('body'), 500);
     } else {
         $data = array();
         if (!empty($message)) {
             $data['message'] = $message;
         }
         if (defined('DEBUG')) {
             $data['trace'] = $exception->getTrace();
         }
         $response = new JsonResponse($data, 500);
     }
     if ($exception instanceof HttpExceptionInterface) {
         $response->setStatusCode($exception->getStatusCode());
         $response->headers->add($exception->getHeaders());
     }
     $event->setResponse($response);
 }
 public function main($id, $mode)
 {
     global $phpbb_container;
     // Initialization
     $this->config = $phpbb_container->get('config');
     $this->db = $phpbb_container->get('dbal.conn');
     $this->user = $phpbb_container->get('user');
     $this->template = $phpbb_container->get('template');
     $this->request = $phpbb_container->get('request');
     $action = $this->request->variable('action', '', true);
     $submit = $this->request->is_set_post('submit') ? true : false;
     $this->form_key = 'acp_advancedpolls';
     add_form_key($this->form_key);
     $display_vars = array('title' => 'AP_TITLE_ACP', 'vars' => array('legend1' => 'AP_GLOBAL_SETTINGS', 'wolfsblvt.advancedpolls.activate_incremental_votes' => array('lang' => 'AP_ACT_INCREMENTAL_VOTES', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_closed_voting' => array('lang' => 'AP_ACT_CLOSED_VOTING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_no_vote' => array('lang' => 'AP_ACT_POLL_NO_VOTE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_poll_end' => array('lang' => 'AP_ACT_POLL_END', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_notifications' => array('lang' => 'AP_ACT_POLL_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'legend2' => 'AP_PER_POLL_SETTINGS', 'wolfsblvt.advancedpolls.activate_poll_scoring' => array('lang' => 'AP_ACT_POLL_SCORING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_change' => array('lang' => 'AP_DEFAULT_VOTES_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_votes_hide' => array('lang' => 'AP_ACT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_hide' => array('lang' => 'AP_DEFAULT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_show' => array('lang' => 'AP_ACT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_show' => array('lang' => 'AP_DEFAULT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_limit' => array('lang' => 'AP_ACT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_limit' => array('lang' => 'AP_DEFAULT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_show_ordered' => array('lang' => 'AP_ACT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_show_ordered' => array('lang' => 'AP_DEFAULT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend3' => 'ACP_SUBMIT_CHANGES'));
     #region Submit
     if ($submit) {
         $submit = $this->do_submit_stuff($display_vars);
         // If the submit was valid, so still submitted
         if ($submit) {
             trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE);
         }
     }
     #endregion
     $this->generate_stuff_for_cfg_template($display_vars);
     // Output page template file
     $this->tpl_name = 'acp_advancedpolls';
     $this->page_title = $this->user->lang($display_vars['title']);
 }
    /**
     * Display the user ranks page
     *
     * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
     * @access public
     */
    public function display($name)
    {
        // Get the rank details
        $sql = 'SELECT *
			FROM ' . RANKS_TABLE . '
			ORDER BY rank_special DESC, rank_min ASC, rank_title ASC';
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            if ($this->config['userranks_special'] || $this->config['userranks_special_admin'] && $this->auth->acl_get('a_') || !$this->config['userranks_special'] && !$row['rank_special']) {
                $rank_row = array('S_RANK_IMAGE' => $row['rank_image'] ? true : false, 'S_SPECIAL_RANK' => $row['rank_special'] ? true : false, 'RANK_IMAGE' => $this->path_helper->get_web_root_path() . $this->config['ranks_path'] . '/' . $row['rank_image'], 'RANK_TITLE' => $row['rank_title'], 'MIN_POSTS' => $row['rank_min']);
                $this->template->assign_block_vars('ranks', $rank_row);
                // Are we displaying members?
                if ($this->config['userranks_members'] || $this->config['userranks_members_admin'] && $this->auth->acl_get('a_')) {
                    $rank_users = $this->get_user_rank_data($row['rank_id']);
                    if (sizeof($rank_users) > 0) {
                        foreach ($rank_users as $row_rank) {
                            $this->template->assign_block_vars('ranks.rank_member', array('MEMBERS' => get_username_string('full', $row_rank['user_id'], $row_rank['username'], $row_rank['user_colour'])));
                        }
                    } else {
                        $this->template->assign_block_vars('ranks.rank_member', array('MEMBERS' => $this->user->lang('NO_MEMBERS')));
                    }
                }
            }
        }
        $this->db->sql_freeresult($result);
        // Assign breadcrumb template vars for the user ranks page
        $this->template->assign_block_vars('navlinks', array('U_VIEW_FORUM' => $this->helper->route('david63_userranks_main_controller', array('name' => 'ranks')), 'FORUM_NAME' => $this->user->lang('USER_RANKS')));
        // Send all data to the template file
        return $this->helper->render('user_ranks.html', $name);
    }
 function main($id, $mode)
 {
     global $phpbb_container, $user, $template, $config, $request;
     $this->phpbb_container = $phpbb_container;
     $this->user = $user;
     $this->template = $template;
     $this->config = $config;
     $this->request = $request;
     $this->log = $this->phpbb_container->get('log');
     $this->tpl_name = 'acp_codebox_plus';
     $this->page_title = $this->user->lang('CODEBOX_PLUS_TITLE');
     add_form_key('o0johntam0o/acp_codebox_plus');
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key('o0johntam0o/acp_codebox_plus')) {
             trigger_error('FORM_INVALID');
         }
         $this->config->set('codebox_plus_syntax_highlighting', $request->variable('codebox_plus_syntax_highlighting', 0));
         $this->config->set('codebox_plus_expanded', $request->variable('codebox_plus_expanded', 0));
         $this->config->set('codebox_plus_download', $request->variable('codebox_plus_download', 0));
         $this->config->set('codebox_plus_login_required', $request->variable('codebox_plus_login_required', 0));
         $this->config->set('codebox_plus_prevent_bots', $request->variable('codebox_plus_prevent_bots', 0));
         $this->config->set('codebox_plus_captcha', $request->variable('codebox_plus_captcha', 0));
         $this->config->set('codebox_plus_max_attempt', $request->variable('codebox_plus_max_attempt', 0));
         $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'CODEBOX_PLUS_LOG_MSG');
         trigger_error($this->user->lang('CODEBOX_PLUS_SAVED') . adm_back_link($this->u_action));
     }
     $this->template->assign_vars(array('U_ACTION' => $this->u_action, 'S_CODEBOX_PLUS_VERSION' => isset($this->config['codebox_plus_version']) ? $this->config['codebox_plus_version'] : 0, 'S_CODEBOX_PLUS_SYNTAX_HIGHLIGHTING' => isset($this->config['codebox_plus_syntax_highlighting']) ? $this->config['codebox_plus_syntax_highlighting'] : 0, 'S_CODEBOX_PLUS_EXPANDED' => isset($this->config['codebox_plus_expanded']) ? $this->config['codebox_plus_expanded'] : 0, 'S_CODEBOX_PLUS_DOWNLOAD' => isset($this->config['codebox_plus_download']) ? $this->config['codebox_plus_download'] : 0, 'S_CODEBOX_PLUS_LOGIN_REQUIRED' => isset($this->config['codebox_plus_login_required']) ? $this->config['codebox_plus_login_required'] : 0, 'S_CODEBOX_PLUS_PREVENT_BOTS' => isset($this->config['codebox_plus_prevent_bots']) ? $this->config['codebox_plus_prevent_bots'] : 0, 'S_CODEBOX_PLUS_CAPTCHA' => isset($this->config['codebox_plus_captcha']) ? $this->config['codebox_plus_captcha'] : 0, 'S_CODEBOX_PLUS_MAX_ATTEMPT' => isset($this->config['codebox_plus_max_attempt']) ? $this->config['codebox_plus_max_attempt'] : 0));
 }
Beispiel #5
0
 /**
  *
  */
 public function add_page_viewonline($event)
 {
     if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/mchat') === 0) {
         $event['location'] = $this->user->lang('MCHAT_TITLE');
         $event['location_url'] = $this->helper->route('dmzx_mchat_controller');
     }
 }
Beispiel #6
0
 public function main($id, $mode)
 {
     global $phpbb_container, $table_prefix;
     if (!defined('CHAT_TABLE')) {
         $chat_table = $table_prefix . 'ajax_chat';
         define('CHAT_TABLE', $chat_table);
     }
     $this->id = $id;
     $this->mode = $mode;
     // Initialization
     $this->auth = $phpbb_container->get('auth');
     $this->config = $phpbb_container->get('config');
     $this->db = $phpbb_container->get('dbal.conn');
     $this->user = $phpbb_container->get('user');
     $this->template = $phpbb_container->get('template');
     $this->request = $phpbb_container->get('request');
     $this->u_action = $this->request->variable('action', '', true);
     $submit = $this->request->is_set_post('submit') ? true : false;
     $this->form_key = 'acp_ajax_chat';
     add_form_key($this->form_key);
     $display_vars = ['title' => 'ACP_AJAX_CHAT_TITLE', 'vars' => ['legend1' => 'AJAX_CHAT_SETTINGS', 'display_ajax_chat' => ['lang' => 'DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'index_display_ajax_chat' => ['lang' => 'INDEX_DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'whois_chatting' => ['lang' => 'WHOIS_CHATTING', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'rule_ajax_chat' => ['lang' => 'RULE_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true], 'ajax_chat_archive_amount' => ['lang' => 'ARCHIVE_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:500', 'explain' => true], 'ajax_chat_popup_amount' => ['lang' => 'POPUP_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_index_amount' => ['lang' => 'INDEX_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_chat_amount' => ['lang' => 'CHAT_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_time_setting' => ['lang' => 'TIME_SETTING_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:10:20', 'explain' => true], 'refresh_online_chat' => ['lang' => 'REFRESH_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_idle_chat' => ['lang' => 'REFRESH_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_offline_chat' => ['lang' => 'REFRESH_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_online_chat' => ['lang' => 'STATUS_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_idle_chat' => ['lang' => 'STATUS_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_offline_chat' => ['lang' => 'STATUS_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'legend2' => 'AJAX_CHAT_LOCATION', 'location_ajax_chat_override' => ['lang' => 'LOCATION_AJAX_CHAT_OVERRIDE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'location_ajax_chat' => ['lang' => 'LOCATION_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true], 'legend3' => 'AJAX_CHAT_POSTS', 'ajax_chat_forum_posts' => ['lang' => 'FORUM_POSTS_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_topic' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_reply' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_REPLY', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_edit' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_EDIT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_quote' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_QUOTE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'legend4' => 'AJAX_CHAT_PRUNE', 'prune_ajax_chat' => ['lang' => 'PRUNE_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'prune_keep_ajax_chat' => ['lang' => 'PRUNE_KEEP_AJAX_CHAT', 'validate' => 'int', 'type' => 'number', 'explain' => false], 'prune_now' => ['lang' => 'PRUNE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'prune_chat'], 'truncate_now' => ['lang' => 'TRUNCATE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'truncate_chat'], 'ajax_chat_counter' => ['lang' => 'CHAT_COUNTER', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'chat_counter'], 'legend5' => 'ACP_SUBMIT_CHANGES']];
     #region Submit
     if ($submit) {
         $submit = $this->do_submit_stuff($display_vars);
         // If the submit was valid, so still submitted
         if ($submit) {
             trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE);
         }
     }
     #endregion
     $this->generate_stuff_for_cfg_template($display_vars);
     // Output page template file
     $this->tpl_name = 'ajax_chat';
     $this->page_title = $this->user->lang($display_vars['title']);
 }
 public function main($id, $mode)
 {
     global $config, $request, $template, $user;
     $this->config = $config;
     $this->request = $request;
     $this->template = $template;
     $this->user = $user;
     // Add the common lang file
     $this->user->add_lang(array('acp/common'));
     // Add the board snowstormlights ACP lang file
     $this->user->add_lang_ext('prosk8er/snowstormlights', 'info_acp_snowstorm_lights');
     // Load a template from adm/style for our ACP page
     $this->tpl_name = 'snowstorm_lights';
     // Set the page title for our ACP page
     $this->page_title = $user->lang['ACP_SNOWSTORM_LIGHTS'];
     // Define the name of the form for use as a form key
     $form_key = 'acp_snowstorm_lights';
     add_form_key($form_key);
     // If form is submitted or previewed
     if ($this->request->is_set_post('submit')) {
         // Test if form key is valid
         if (!check_form_key($form_key)) {
             trigger_error('FORM_INVALID');
         }
         // Store the config enable/disable state
         $scl_enabled = $this->request->variable('scl_enabled', 0);
         $this->config->set('scl_enabled', $scl_enabled);
         $snow_enabled = $request->variable('snow_enabled', 0);
         $this->config->set('snow_enabled', $snow_enabled);
         // Output message to user for the update
         trigger_error($this->user->lang('SNOWSTORM_LIGHTS_SAVED') . adm_back_link($this->u_action));
     }
     // Output data to the template
     $this->template->assign_vars(array('SCL_ENABLED' => isset($this->config['scl_enabled']) ? $this->config['scl_enabled'] : '', 'SNOW_ENABLED' => isset($this->config['snow_enabled']) ? $this->config['snow_enabled'] : '', 'U_ACTION' => $this->u_action));
 }
Beispiel #8
0
 /**
  * Show users as viewing the portals on Who Is Online page
  *
  * @param object $event The event object
  * @return null
  */
 public function viewonline_page($event)
 {
     if ($event['on_page'][1] == 'app' && strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/portal') === 0) {
         $event['location'] = $this->user->lang('VIEWING_PORTAL');
         $event['location_url'] = $this->controller_helper->route('board3_portal_controller');
     }
 }
 /**
  * @param string $list_name whitelist or blacklist
  * @param string $u_action phpbb acp-u_action
  */
 private function manage_list($u_action, $list_name)
 {
     $list_name_upper = strtoupper($list_name);
     // Define the name of the form for use as a form key
     $form_name = 'topictags';
     add_form_key($form_name);
     $errors = array();
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key($form_name)) {
             trigger_error('FORM_INVALID');
         }
         $this->config->set(prefixes::CONFIG . '_' . $list_name . '_enabled', $this->request->variable(prefixes::CONFIG . '_' . $list_name . '_enabled', 0));
         $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG . '_' . $list_name, '')));
         if (!empty($list)) {
             $list = json_decode($list, true);
             $tags = array();
             for ($i = 0, $size = sizeof($list); $i < $size; $i++) {
                 $tags[] = $list[$i]['text'];
             }
             $list = json_encode($tags);
         }
         // store the list
         $this->config_text->set(prefixes::CONFIG . '_' . $list_name, $list);
         trigger_error($this->user->lang('TOPICTAGS_' . $list_name_upper . '_SAVED') . adm_back_link($u_action));
     }
     // display
     $list = $this->config_text->get(prefixes::CONFIG . '_' . $list_name);
     $list = base64_encode(rawurlencode($list));
     $this->template->assign_vars(array('TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG . '_version']), 'TOPICTAGS_' . $list_name_upper . '_ENABLED' => $this->config[prefixes::CONFIG . '_' . $list_name . '_enabled'], 'TOPICTAGS_' . $list_name_upper => $list, 'S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT' => true, 'S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false', 'S_ERROR' => sizeof($errors) ? true : false, 'ERROR_MSG' => implode('<br />', $errors), 'U_ACTION' => $u_action));
 }
 public function main($id, $mode)
 {
     global $config, $request, $template, $user;
     $this->config = $config;
     $this->request = $request;
     $this->template = $template;
     $this->user = $user;
     $this->user->add_lang('acp/common');
     $this->user->add_lang_ext('phpbbmodders/holidayflare', 'holidayflare_acp');
     $this->tpl_name = 'acp_holidayflare';
     $this->page_title = $this->user->lang('ACP_HOLIDAYFLARE');
     $form_key = 'acp_holidayflare';
     add_form_key($form_key);
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key($form_key)) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         /* XMAS Start */
         $enable_xmas = $this->request->variable('enable_xmas', 0);
         $this->config->set('enable_xmas', $enable_xmas);
         /* XMAS Stop */
         /* Valentine Start */
         $enable_valentine = $this->request->variable('enable_valentine', 0);
         $this->config->set('enable_valentine', $enable_valentine);
         /* Valentine Stop */
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     $this->template->assign_vars(array('S_ENABLE_XMAS' => isset($this->config['enable_xmas']) ? $this->config['enable_xmas'] : '', 'S_ENABLE_VALENTINE' => isset($this->config['enable_valentine']) ? $this->config['enable_valentine'] : '', 'U_ACTION' => $this->u_action));
 }
 /**
  * {@inheritdoc}
  */
 public function get_config(array $settings)
 {
     $forum_options = $this->forum_options->get_all();
     $topic_type_options = $this->_get_topic_type_options();
     $range_options = $this->_get_range_options();
     $attach_type_options = array('' => 'ALL', 'IMAGES' => 'IMAGES', 'ARCHIVES' => 'ARCHIVES');
     return array('legend1' => $this->user->lang('SETTINGS'), 'forum_ids' => array('lang' => 'SELECT_FORUMS', 'validate' => 'string', 'type' => 'multi_select', 'options' => $forum_options, 'default' => array(), 'explain' => false), 'topic_type' => array('lang' => 'TOPIC_TYPE', 'validate' => 'string', 'type' => 'checkbox', 'options' => $topic_type_options, 'default' => array(), 'explain' => false), 'first_only' => array('lang' => 'FIRST_POST_ONLY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false, 'default' => false), 'post_ids' => array('lang' => 'ATTACHMENTS_FROM_POSTS', 'validate' => 'string', 'type' => 'textarea:3:40', 'maxlength' => 2, 'explain' => true, 'default' => ''), 'date_range' => array('lang' => 'LIMIT_POST_TIME', 'validate' => 'string', 'type' => 'select', 'options' => $range_options, 'default' => '', 'explain' => false), 'limit' => array('lang' => 'LIMIT', 'validate' => 'int:0:20', 'type' => 'number:0:20', 'maxlength' => 2, 'explain' => false, 'default' => 5), 'ext_type' => array('lang' => 'EXTENSION_GROUP', 'validate' => 'string', 'type' => 'radio', 'options' => $attach_type_options, 'default' => '', 'explain' => false));
 }
Beispiel #12
0
 /**
  * @param int $menu_id
  * @param bool $editing
  * @return string
  */
 protected function _get_message($menu_id, $editing)
 {
     $msg_key = '';
     if ($editing) {
         $msg_key = $menu_id ? 'MENU_NO_ITEMS' : 'SELECT_MENU';
     }
     return $this->user->lang($msg_key);
 }
 public function handle()
 {
     if (!function_exists('display_forums')) {
         include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
     }
     display_forums('', $this->config['load_moderators']);
     $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang('FORUM'), 'U_VIEW_FORUM' => $this->helper->route('blitze_sitemaker_forum')));
     return $this->helper->render('index_body.html', $this->user->lang('FORUM_INDEX'));
 }
 /**
  * {@inheritdoc}
  */
 public function display(array $settings, $edit_mode = false)
 {
     $content = '';
     $content .= $this->user->lang('TOTAL_POSTS_COUNT', (int) $this->config['num_posts']) . '<br />';
     $content .= $this->user->lang('TOTAL_TOPICS', (int) $this->config['num_topics']) . '<br />';
     $content .= $this->user->lang('TOTAL_USERS', (int) $this->config['num_users']) . '<br />';
     $content .= $this->user->lang('NEWEST_USER', get_username_string('full', $this->config['newest_user_id'], $this->config['newest_username'], $this->config['newest_user_colour']));
     return array('title' => 'STATISTICS', 'content' => $content);
 }
 public function viewonline_page($event)
 {
     if ($event['on_page'][1] == 'app') {
         if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/contact') === 0) {
             $event['location'] = $this->user->lang('CONTACTFORM_VIEWONLINE');
             $event['location_url'] = $this->helper->route('phpbbde_contactform_main_controller');
         }
     }
 }
 /**
  * Convert Hidden BBCode into its final appearance
  *
  * @param array $matches
  * @return string HTML render of hidden bbcode
  * @access protected
  */
 protected function hidden_pass($matches)
 {
     if ($this->user->data['user_id'] == ANONYMOUS || $this->user->data['is_bot']) {
         $replacements = array($this->user->lang('ABBC3_HIDDEN_ON'), $this->user->lang('ABBC3_HIDDEN_EXPLAIN'), 'hidebox_hidden');
     } else {
         $replacements = array($this->user->lang('ABBC3_HIDDEN_OFF'), $matches[1], 'hidebox_visible');
     }
     return str_replace(array('{HIDDEN_TITLE}', '{HIDDEN_CONTENT}', '{HIDDEN_CLASS}'), $replacements, '<div class="hidebox {HIDDEN_CLASS}"><div class="hidebox_title {HIDDEN_CLASS}">{HIDDEN_TITLE}</div><div class="{HIDDEN_CLASS}">{HIDDEN_CONTENT}</div></div>');
 }
Beispiel #17
0
 /**
  * Get the tag name
  *
  * @param mixed $tag_id
  * @return string
  */
 public function get_tag_name($tag_id)
 {
     $lang = $this->user->lang('UNKNOWN');
     $row = $this->get_tag($tag_id);
     if ($row) {
         $lang = $this->user->lang($row['tag_field_name']);
     }
     return $lang;
 }
 /**
  * Select image filter type
  */
 public function extimgaslink_config_select($selected_type)
 {
     $types = array(constants::SERVER_ONLY => 'SERVER_ONLY', constants::SECURE_SITES => 'SECURE_SITES');
     $options = '';
     foreach ($types as $key => $value) {
         $selected = $selected_type === $key ? ' selected="selected"' : '';
         $options .= '<option value="' . $key . '"' . $selected . '>' . $this->user->lang('EXTIMGASLINK_' . $value) . '</option>';
     }
     return $options;
 }
 /**
  * Get available sitemaker blocks
  */
 public function get_all_blocks()
 {
     $blocks = array();
     foreach ($this->blocks as $service => $driver) {
         $lname = strtoupper(str_replace('.', '_', $driver->get_name()));
         $blocks[$service] = $this->user->lang($lname);
     }
     asort($blocks);
     return $blocks;
 }
Beispiel #20
0
 /**
  * Add Lightbox settings to the ACP
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function add_lightbox_acp_config($event)
 {
     if ($event['mode'] == 'post' && isset($event['display_vars']['vars']['legend3'])) {
         $this->user->add_lang_ext('vse/lightbox', 'lightbox');
         $display_vars = $event['display_vars'];
         $my_config_vars = array('legend_lightbox' => 'LIGHTBOX_SETTINGS', 'lightbox_max_width' => array('lang' => 'LIGHTBOX_MAX_WIDTH', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $this->user->lang('PIXEL')), 'lightbox_gallery' => array('lang' => 'LIGHTBOX_GALLERY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lightbox_signatures' => array('lang' => 'LIGHTBOX_SIGNATURES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('before' => 'legend3'));
         $event['display_vars'] = $display_vars;
     }
 }
 /**
  * Modify the template data block
  *
  * @return null
  */
 public function assign_templates_vars($event)
 {
     $row = $event['row'];
     if ($row['forum_type'] != FORUM_LINK) {
         $online_users = obtain_users_online($row['forum_id']);
         $forum_row = $event['forum_row'];
         $forum_row = array_merge($forum_row, array('L_FORUM_VISIT' => $this->user->lang('FORUM_VISITS', $online_users['total_online'])));
         $event['forum_row'] = $forum_row;
     }
 }
Beispiel #22
0
 /**
  * {@inheritdoc}
  */
 public function display(array $db_data, $editing = false)
 {
     $title = $this->user->lang('LINKS');
     $menu_id = $db_data['settings']['menu_id'];
     $data = $this->_get_menu($menu_id);
     if (!sizeof($data)) {
         return array('title' => $title, 'content' => $this->_get_message($menu_id, $editing));
     }
     $this->tree->display_list($data, $this->ptemplate, 'tree');
     return array('title' => $title, 'content' => $this->ptemplate->render_view('blitze/sitemaker', 'blocks/links.html', 'links_block'));
 }
 /**
  * @param array $topic_data
  */
 private function _show_bookmarks(array $topic_data)
 {
     for ($i = 0, $size = sizeof($topic_data); $i < $size; $i++) {
         $row = $topic_data[$i];
         $forum_id = $row['forum_id'];
         $topic_id = $row['topic_id'];
         $this->ptemplate->assign_block_vars('topicrow', array('TOPIC_TITLE' => censor_text($row['topic_title']), 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f={$forum_id}&amp;t={$topic_id}")));
         unset($topic_data[$i]);
     }
     $this->ptemplate->assign_var('NO_RECORDS', $this->user->lang('NO_BOOKMARKS'));
 }
Beispiel #24
0
 public function show()
 {
     $this->phpbb_container->get('blitze.sitemaker.util')->add_assets(array('css' => array('@blitze_sitemaker/vendor/fontawesome/css/font-awesome.min.css')));
     $this->template->assign_var('L_INDEX', $this->user->lang('HOME'));
     if ($this->page_can_have_blocks()) {
         $edit_mode = $this->toggle_edit_mode();
         $display_mode = $this->get_display_modes();
         $u_edit_mode = $this->get_edit_mode_url($edit_mode, $display_mode);
         $this->show_blocks($edit_mode, $display_mode);
         $this->template->assign_vars(array('S_SITEMAKER' => true, 'U_EDIT_MODE' => $u_edit_mode));
     }
 }
 /**
  * the simple function
  *
  * @param int $int  number of posts/topic/clicks
  *
  * @return string
  * @access public
  */
 public function make_simple($int)
 {
     if ($int >= 1000 * 1000) {
         return $this->user->lang('MILLION', (int) floor($int / (1000 * 1000)));
     } else {
         if ($int >= 1000) {
             return $this->user->lang('KILO', (int) floor($int / 1000));
         } else {
             return $int;
         }
     }
 }
 protected function render_block(\blitze\sitemaker\model\blocks\entity\block $entity)
 {
     $block_name = $entity->get_name();
     if ($block_instance = $this->block_factory->get_block($block_name)) {
         $default_settings = $block_instance->get_config(array());
         $settings = $this->blocks->sync_settings($default_settings, $entity->get_settings());
         $entity->set_settings($settings);
         $block_data = $entity->to_array();
         $disp_data = $block_instance->display($block_data, true);
         return array_merge($block_data, array('id' => $block_data['bid'], 'title' => !empty($block_data['title']) ? $block_data['title'] : $this->user->lang($disp_data['title']), 'content' => !empty($disp_data['content']) ? $disp_data['content'] : $this->user->lang('BLOCK_NO_DATA')));
     }
 }
Beispiel #27
0
 /**
  * @param array $settings
  */
 private function _fetch_new(array $settings)
 {
     $topic_data = $this->_get_topics($settings);
     for ($i = 0, $size = sizeof($topic_data); $i < $size; $i++) {
         $row = $topic_data[$i];
         $forum_id = $row['forum_id'];
         $topic_id = $row['topic_id'];
         $this->ptemplate->assign_block_vars('topicrow', array('TOPIC_TITLE' => censor_text($row['topic_title']), 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f={$forum_id}&amp;t={$topic_id}")));
         unset($topic_data[$i]);
     }
     $this->ptemplate->assign_var('NO_RECORDS', $settings['topics_only'] ? $this->user->lang('NO_NEW_TOPICS') : $this->user->lang('NO_NEW_POSTS'));
 }
Beispiel #28
0
    /**
     * This method is called to show the UCP page.
     * You can assign template variables to the template, or do anything else here.
     *
     * @param string $table
     * @param string $where Extra where clause. Please make sure to use AND as first.
     */
    protected function show_ucp_complete($table, $where = '')
    {
        $sql = 'SELECT *
			FROM ' . $this->db->sql_escape($table) . '
			WHERE user_id = ' . (int) $this->user->data['user_id'] . ' ' . $where . '
			ORDER BY registration_id ASC';
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $this->template->assign_block_vars('keys', array('CLASS' => $this->get_name(), 'ID' => $row['registration_id'], 'REGISTERED' => $this->user->format_date($row['registered']), 'LAST_USED' => $row['last_used'] ? $this->user->format_date($row['last_used']) : false, 'TYPE' => $this->user->lang($this->get_translatable_name())));
        }
        $this->db->sql_freeresult($result);
    }
 /**
  * GeoModerate settings
  *
  */
 public function display_settings()
 {
     add_form_key(self::FORM_KEY);
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key(self::FORM_KEY)) {
             trigger_error('FORM_INVALID');
         }
         $this->save_settings();
         $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'AKISMET_LOG_SETTING_CHANGED');
         trigger_error($this->user->lang('ACP_AKISMET_SETTING_SAVED') . adm_back_link($this->u_action));
     }
     $this->template->assign_vars(array('U_ACTION' => $this->u_action, 'GOTHICK_AKISMET_API_KEY' => $this->config['gothick_akismet_api_key']));
 }
Beispiel #30
0
 /**
  * {@inheritdoc}
  */
 public function display(array $db_data, $editing = false)
 {
     $title = $this->user->lang('MENU');
     $menu_id = $db_data['settings']['menu_id'];
     $data = $this->_get_menu($menu_id);
     if (!sizeof($data)) {
         return array('title' => $title, 'content' => $this->_get_message($menu_id, $editing));
     }
     $this->tree->set_params($db_data['settings']);
     $this->tree->display_navlist($data, $this->ptemplate, 'tree');
     $this->tree->generate_breadcrumb($data);
     return array('title' => $title, 'content' => $this->ptemplate->render_view('blitze/sitemaker', 'blocks/menu.html', 'menu_block'));
 }