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)); }
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)); }
/** * Likes controller for route /like_post/{like} * * @param int @post_id The post to be edited. */ public function like_post($post_id) { // If unknown user or bot, cannot like. if ($this->user->data['user_id'] == ANONYMOUS || $this->user->data['is_bot']) { return; } // Add language variables for response. $this->user->add_lang_ext('nuleaf/likes', 'likes'); // Grab forum id for permission. $sql = 'SELECT forum_id FROM ' . POSTS_TABLE . ' WHERE post_id = ' . $post_id; $result = $this->db->sql_query_limit($sql, 1); $forum_id = $this->db->sql_fetchrow($result)['forum_id']; $this->db->sql_freeresult($result); // Does the user have permission to like posts in this forum? if ($this->auth->acl_get('!f_like', $forum_id)) { $json_response = new json_response(); $json_response->send(array('error' => $this->user->lang('LIKE_NOT_AUTHORIZED'))); return; } if ($this->request->is_ajax()) { $liked = $this->likes_manager->is_liked($post_id); if ($liked) { // If post is already liked, unlike it. $likes_count = $this->likes_manager->unlike($post_id); } else { // Else like the post. $likes_count = $this->likes_manager->like($post_id); } // Since the post has now been liked/unliked, $liked is reversed. $json_response = new json_response(); $json_response->send(array('likes_count' => $likes_count, 'liked' => !$liked, 'LIKE_POST' => $this->user->lang('LIKE_POST'), 'UNLIKE_POST' => $this->user->lang('UNLIKE_POST'), 'LIKE_BUTTON' => $this->user->lang('LIKE_BUTTON'), 'UNLIKE_BUTTON' => $this->user->lang('UNLIKE_BUTTON'))); } }
/** * Constructor * * @param \phpbb\config\config $config * @param \phpbb\request\request_interface $request * @param \phpbb\user $user */ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user) { $this->config = $config; $this->request = $request; $this->user = $user; $this->user->add_lang_ext('AJHenderson/BattleNetOAuthUS', 'common'); }
/** * Controller for route /paypal * * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object */ public function page() { $this->user->add_lang_ext('tas2580/paypal', 'common'); $amount_list = ''; $sql = 'SELECT * FROM ' . $this->table_amount . ' ORDER BY amount_value'; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { $amount_list .= '<option value="' . number_format($row['amount_value'] / 100, 2) . '">' . number_format($row['amount_value'] / 100, 2) . '</option>'; } $sql = 'SELECT * FROM ' . $this->table_items . ' ORDER BY item_name'; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { $this->template->assign_block_vars('items', array('ITEM_NAME' => $row['item_name'], 'ITEM' => generate_text_for_display($row['item_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'ITEM_ID' => $row['item_id'])); } $sql = 'SELECT * FROM ' . $this->table_config; $result = $this->db->sql_query($sql); $row = $this->db->sql_fetchrow($result); $this->template->assign_vars(array('PAYPAL_TITLE' => $row['paypal_title'], 'PAYPAL_TEXT' => generate_text_for_display($row['paypal_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'PAYPAL_EMAIL' => $row['paypal_email'], 'AMOUNT_LIST' => $amount_list, 'PAYPAL_ACTION' => $row['paypal_sandbox'] == 1 ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr', 'S_SANDBOX' => $row['paypal_sandbox'] == 1 ? true : false, 'S_CURL' => function_exists('curl_init'), 'CURRENCY_CODE' => $this->currency_code_select($row['paypal_currency']), 'CURRENCY' => $row['paypal_currency'], 'USER_ID' => $this->user->data['user_id'], 'IPN_URL' => $this->helper->route('tas2580_paypal_ipn', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL), 'RETURN_URL' => $this->helper->route('tas2580_paypal_controller', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL))); return $this->helper->render('paypal_body.html', $row['paypal_title']); }
/** * Display stats on index page * * @param object $event The event object * @return null * @access public */ public function display_24_hour_stats($event) { // if the user is a bot if ($this->user->data['is_bot']) { return; } $this->user->add_lang_ext('rmcgirr83/activity24hours', 'common'); // obtain posts/topics/new users activity $activity = $this->obtain_activity_data(); // obtain user activity data $active_users = $this->obtain_active_user_data(); // Obtain guests data $total_guests_online_24 = $this->obtain_guest_count_24(); $user_count = 0; foreach ((array) $active_users as $row) { if (!$row['session_viewonline'] && !empty($row['session_time']) || !$row['user_allow_viewonline']) { if ($this->auth->acl_get('u_viewonline') || $row['user_id'] === $this->user->data['user_id']) { $row['username'] = '******' . $row['username'] . '</em>'; } else { continue; } } if ($row['user_lastvisit'] < $this->interval && $row['session_time'] < $this->interval) { continue; } $max_last_visit = max($row['user_lastvisit'], $row['session_time']); $hover_info = ' title="' . $this->user->format_date($max_last_visit) . '"'; ++$user_count; $this->template->assign_block_vars('lastvisit', array('USERNAME_FULL' => '<span' . $hover_info . '>' . get_username_string($row['user_type'] == USER_IGNORE ? 'no_profile' : 'full', $row['user_id'], $row['username'], $row['user_colour']) . '</span>')); } // assign the forum stats to the template. $this->template->assign_vars(array('USERS_24HOUR_TOTAL' => $this->user->lang('USERS_24HOUR_TOTAL', $user_count), 'USERS_ACTIVE' => $user_count, 'GUEST_ONLINE_24' => $this->config['load_online_guests'] ? $this->user->lang('GUEST_ONLINE_24', $total_guests_online_24) : '', 'HOUR_TOPICS' => $this->user->lang('24HOUR_TOPICS', $activity['topics']), 'HOUR_POSTS' => $this->user->lang('24HOUR_POSTS', $activity['posts']), 'HOUR_USERS' => $this->user->lang('24HOUR_USERS', $activity['users']), 'S_CAN_VIEW_24_HOURS' => true)); }
/** * Display zodiac on viewing user profile * * @param object $event The event object * @return null * @access public */ public function memberlist_view_profile($event) { $user_id = $event['member']['user_id']; $reg_date = $event['member']['user_regdate']; $this->user->add_lang_ext('rmcgirr83/searchusertopics', 'common'); // get all topics started by the user and make sure they are visible $sql = 'SELECT t.*, p.post_visibility FROM ' . TOPICS_TABLE . ' t LEFT JOIN ' . POSTS_TABLE . ' p ON t.topic_first_post_id = p.post_id WHERE t.topic_poster = ' . $user_id . ' ORDER BY t.topic_time ASC'; $result = $this->db->sql_query($sql); $topics_num = 0; while ($row = $this->db->sql_fetchrow($result)) { if (!$this->auth->acl_get('f_read', $row['forum_id'])) { continue; } if ($row['post_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $row['forum_id'])) { continue; } ++$topics_num; } $this->db->sql_freeresult($result); if ($topics_num) { // Do the relevant calculations $users_days = max(1, round((time() - $reg_date) / 86400)); $topics_per_day = $topics_num / $users_days; $topics_percent = $this->config['num_topics'] ? min(100, $topics_num / $this->config['num_topics'] * 100) : 0; $this->template->assign_vars(array('TOPICS' => $topics_num, 'L_TOTAL_TOPICS' => $this->user->lang('TOTAL_TOPICS', $topics_num), 'TOPICS_PER_DAY' => $this->user->lang('TOPICS_PER_DAY', $topics_per_day), 'TOPICS_PERCENT' => $this->user->lang('TOPICS_PERCENT', $topics_percent), 'U_SEARCH_TOPICS' => $this->auth->acl_get('u_search') ? append_sid("{$this->root_path}search.{$this->php_ext}", "author_id={$user_id}&sr=topics&sf=firstpost") : '')); } }
public function acp_ranks_list_modify_rank_row($event) { $this->user->add_lang_ext('paybas/rankpoststyling', 'rankpoststyling'); $rank_row = $event['rank_row']; $rank_row['RANK_STYLE'] = isset($event['row']['rank_style']) ? $event['row']['rank_style'] : ''; $event['rank_row'] = $rank_row; }
/** * Display zodiac on viewing user profile * * @param object $event The event object * @return null * @access public */ public function memberlist_view_profile($event) { $user_id = $event['member']['user_id']; $this->user->add_lang_ext('rmcgirr83/topicsbyuser', 'common'); // get all topics started by the user and make sure they are visible $sql = 'SELECT t.*, p.post_visibility FROM ' . TOPICS_TABLE . ' t LEFT JOIN ' . POSTS_TABLE . ' p ON t.topic_first_post_id = p.post_id WHERE t.topic_poster = ' . $user_id . ' ORDER BY t.topic_time ASC'; $result = $this->db->sql_query($sql); $count = 0; $topic_options = '<option value="">' . $this->user->lang['CHOOSE_A_TOPIC'] . '</option>'; while ($row = $this->db->sql_fetchrow($result)) { if (!$this->auth->acl_get('f_read', $row['forum_id'])) { continue; } if ($row['post_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $row['forum_id'])) { continue; } ++$count; $topic_color = $row['post_visibility'] != ITEM_APPROVED ? 'class="error"' : ''; $topic_options .= '<option value="' . append_sid("{$this->root_path}viewtopic.{$this->php_ext}", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']) . '" ' . $topic_color . '> ' . truncate_string($row['topic_title'], 30, 255, false, $this->user->lang['ELLIPSIS']) . '</option>'; } $this->db->sql_freeresult($result); if (!empty($count)) { $this->template->assign_vars(array('HAS_TOPICS' => true, 'S_TOPIC_OPTIONS' => $topic_options)); } }
public function ucp_prefs_get_data($event) { // Request the user option vars and add them to the data array $event['data'] = array_merge($event['data'], array('rt_enable' => $this->request->variable('rt_enable', (int) $this->user->data['user_rt_enable']), 'rt_alt_location' => $this->request->variable('rt_alt_location', (int) $this->user->data['user_rt_alt_location']), 'rt_sort_start_time' => $this->request->variable('rt_sort_start_time', (int) $this->user->data['user_rt_sort_start_time']), 'rt_unread_only' => $this->request->variable('rt_unread_only', (int) $this->user->data['user_rt_unread_only']))); // Output the data vars to the template (except on form submit) if (!$event['submit'] && $this->auth->acl_get('u_rt_view')) { $this->user->add_lang_ext('paybas/recenttopics', 'recenttopics_ucp'); $template_vars = array(); if ($this->auth->acl_get('u_rt_enable') || $this->auth->acl_get('u_rt_alt_location') || $this->auth->acl_get('u_rt_sort_start_time') || $this->auth->acl_get('u_rt_unread_only')) { $template_vars += array('S_RT_SHOW' => true); } if ($this->auth->acl_get('u_rt_enable')) { $template_vars += array('A_RT_ENABLE' => true, 'S_RT_ENABLE' => $event['data']['rt_enable']); } if ($this->auth->acl_get('u_rt_alt_location')) { $template_vars += array('A_RT_ALT_LOCATION' => true, 'S_RT_ALT_LOCATION' => $event['data']['rt_alt_location']); } if ($this->auth->acl_get('u_rt_sort_start_time')) { $template_vars += array('A_RT_SORT_START_TIME' => true, 'S_RT_SORT_START_TIME' => $event['data']['rt_sort_start_time']); } if ($this->auth->acl_get('u_rt_unread_only')) { $template_vars += array('A_RT_UNREAD_ONLY' => true, 'S_RT_UNREAD_ONLY' => $event['data']['rt_unread_only']); } $this->template->assign_vars($template_vars); } }
public function main($event) { if ($this->config['load_birthdays'] && $this->config['allow_birthdays'] && $this->config['allow_birthdays_ahead'] > 0 && $this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) { $this->user->add_lang_ext('rmcgirr83/upcomingbirthdays', 'upcomingbirthdays'); $this->upcoming_birthdays(); } }
public function main($event) { // add lang file $this->user->add_lang_ext('v12mike/postoftheday', 'postoftheday'); $this->functions->topposts(); $this->template->assign_vars(array('S_POSTOFTHEDAY' => 1, 'S_POSTOFTHEDAY_LOCATION' => $this->config['post_of_the_day_location'])); }
public function page_header_after($event) { if (!empty($this->config['phpbbde_contactform_forum_id'])) { $this->user->add_lang_ext('phpbbde/contactform', 'global'); $this->template->assign_vars(array('U_CONTACTFORM' => $this->helper->route('phpbbde_contactform_main_controller'))); } }
/** * Setup Smart Subjects * * @param \phpbb\event\data $event The event object * @return void */ public function setup($event) { $this->user->add_lang_ext('vse/smartsubjects', 'smartsubjects'); $page_data = $event['page_data']; $page_data['S_SMART_SUBJECTS_MOD'] = $this->forum_auth($event['forum_id']) && $this->auth->acl_get('m_', $event['forum_id']); $event['page_data'] = $page_data; }
/** * Display an article * * @param string $article URL of the article * @return object */ public function article($article) { $this->user->add_lang_ext('tas2580/wiki', 'common'); if (!$this->auth->acl_get('u_wiki_view')) { trigger_error('NOT_AUTHORISED'); } $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['WIKI'], 'U_VIEW_FORUM' => $this->helper->route('tas2580_wiki_index', array()))); $this->template->assign_vars(array('WIKI_FOOTER' => $this->user->lang('WIKI_FOOTER', base64_decode('aHR0cHM6Ly90YXMyNTgwLm5ldA=='), base64_decode('dGFzMjU4MA==')))); include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext; include $this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext; $action = $this->request->variable('action', ''); $id = $this->request->variable('id', 0); switch ($action) { case 'edit': return $this->edit->edit_article($article); case 'versions': return $this->compare->view_versions($article); case 'compare': $from = $this->request->variable('from', 0); $to = $this->request->variable('to', 0); return $this->compare->compare_versions($article, $from, $to); case 'delete': return $this->delete->version($id); case 'detele_article': return $this->delete->article($article); case 'active': return $this->edit->active($id); case 'deactivate': return $this->edit->deactivate($article); default: return $this->view->view_article($article, $id); } }
/** * Allow to change their colour * * @param object $event The event object * @return null * @access public */ public function modify_profile_info($event) { $this->user->add_lang_ext('dmzx/usernamecolourchanger', 'common'); // Request the user option vars and add them to the data array $event['data'] = array_merge($event['data'], array('user_colour' => $this->request->variable('user_colour', $this->user->data['user_colour'], true))); $this->template->assign_vars(array('COLOUR' => $event['data']['user_colour'], 'USE_USERNAMECOLOURCHANGER' => $this->auth->acl_get('u_usernamecolourchanger_use'))); }
public function handle_downloadlog() { if (!$this->auth->acl_get('a_')) { trigger_error('Access Denied'); } else { $this->user->add_lang_ext('dmzx/downloadlog', 'common'); $fileid = $this->request->variable('file', 0); $start = $this->request->variable('start', 0); // Pagination number from ACP $dll = $this->config['downloadlog_value']; // Generate pagination $sql = 'SELECT COUNT(downloadslog_id) AS total_downloadlogs FROM ' . $this->userdownloadslog_table . ' WHERE user_id = user_id AND file_id = ' . $fileid; $result = $this->db->sql_query($sql); $total_downloadlogs = (int) $this->db->sql_fetchfield('total_downloadlogs'); $sql = 'SELECT d.user_id, d.down_date, u.user_id, u.username, u.user_colour FROM ' . $this->userdownloadslog_table . ' d, ' . USERS_TABLE . ' u WHERE u.user_id = d.user_id AND file_id = ' . $fileid . ' ORDER BY d.down_date DESC'; $top_result = $this->db->sql_query_limit($sql, $dll, $start); while ($row = $this->db->sql_fetchrow($top_result)) { $this->template->assign_block_vars('downloaders', array('D_USERNAME' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'D_TIME' => $this->user->format_date($row['down_date']))); } } $pagination_url = $this->helper->route('dmzx_downloadlog_controller', array('file' => $fileid)); //Start pagination $this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $total_downloadlogs, $dll, $start); $this->template->assign_vars(array('DOWNLOADERS_USERS' => $total_downloadlogs == 1 ? $this->user->lang['DOWNLOADERS_COUNT'] : sprintf($this->user->lang['DOWNLOADERS_COUNTS'], $total_downloadlogs), 'DOWNLOADERS_VERSION' => $this->config['downloadlog_version'])); page_header('Downloaders Log', false); $this->template->set_filenames(array('body' => 'DownloadLog.html')); page_footer(); }
public function display_list() { $this->user->add_lang_ext('phpbb/titania', 'faq', false, true); /** * From phpBB faq.php */ // Pull the array data from the lang pack $switch_column = $found_switch = false; $help_blocks = array(); foreach ($this->user->help as $help_ary) { if ($help_ary[0] == '--') { if ($help_ary[1] == '--') { $switch_column = true; $found_switch = true; continue; } $this->template->assign_block_vars('faq_block', array('BLOCK_TITLE' => $help_ary[1], 'SWITCH_COLUMN' => $switch_column)); if ($switch_column) { $switch_column = false; } continue; } $this->template->assign_block_vars('faq_block.faq_row', array('FAQ_QUESTION' => $help_ary[0], 'FAQ_ANSWER' => $help_ary[1])); } // Lets build a page ... $this->template->assign_vars(array('L_FAQ_TITLE' => $this->user->lang['FAQ_EXPLAIN'], 'L_BACK_TO_TOP' => $this->user->lang['BACK_TO_TOP'], 'SWITCH_COLUMN_MANUALLY' => !$found_switch)); $this->display->assign_global_vars(); return $this->helper->render('faq_body.html', 'FAQ_EXPLAIN'); }
/** * Show a message if can't post without approval * * @param object $event The event object * @return null * @access public */ public function modify_template_vars($event) { if ($this->check_auth($event['forum_id'])) { $this->user->add_lang_ext('rmcgirr83/newtopicsneedapproval', 'common'); $this->template->assign_var('S_REQUIRES_APPROVAL', true); } }
public function page_header($event) { // add lang file $this->user->add_lang_ext('dmzx/newtopic', 'common'); $forum_box = $this->make_forum_select2(false, false, false, false); $this->template->assign_vars(array('EXT_NEW_TOPIC' => $forum_box)); }
/** * Constructor * * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\template\template $template * @param \phpbb\user $user * * @access public */ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user) { $this->config = $config; $this->db = $db; $this->template = $template; $this->user = $user; $this->user->add_lang_ext('svennd/simplecount', 'simplecount_var'); }
/** * Constructor * * @param config $config * @param Container $container * @param helper $helper * @param template $template * @param user $user */ public function __construct(config $config, helper $helper, template $template, user $user) { $this->config = $config; $this->helper = $helper; $this->template = $template; $this->user = $user; $this->user->add_lang_ext('phpbbde/externalimgaslink', 'extimgaslink'); }
/** * Constructor * * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\template\template $template * @param \phpbb\user $user * * @access public */ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user) { $this->config = $config; $this->db = $db; $this->template = $template; $this->user = $user; $this->user->add_lang_ext('mop/timeago', 'timeago_acp'); }
/** * Load icon picker */ public function picker() { $this->user->add_lang_ext('blitze/sitemaker', 'icons'); $this->sitemaker->add_assets(array('js' => array('@blitze_sitemaker/assets/icons/picker.min.js'), 'css' => array('@blitze_sitemaker/vendor/fontawesome/css/font-awesome.min.css', '@blitze_sitemaker/assets/icons/picker.min.css'))); $this->ptemplate->set_style(array("ext/blitze/sitemaker/styles")); $this->ptemplate->set_filenames(array('icons' => 'icon_picker.html')); return $this->ptemplate->assign_display('icons'); }
/** * Add configuration to UCP * * @param object $event The event object * @return null * @access public */ public function ucp_prefs_add($event) { $this->user->add_lang_ext('crizzo/maxwidthswitch', 'ucp'); // I'm so happy that this is just a radiobox! Just a boolean! <3 $maxwidth = $this->request->variable('maxwidth', (bool) $this->user->data['user_maxwidth']); $event['data'] = array_merge($event['data'], array('maxwidth' => $maxwidth)); $this->template->assign_vars(array('S_MAXWIDTH' => $maxwidth)); }
/** * Constructor * * @param \phpbb\user $user, \phpbb\template\template $template */ public function __construct(\phpbb\user $user, \phpbb\template\template $template, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext) { $this->user = $user; $this->template = $template; $this->db = $db; $this->root_path = $root_path; $this->php_ext = $php_ext; $this->user->add_lang_ext('crizzo/whoposted', 'whoposted'); }
public function page_header($event) { $this->user->add_lang_ext('dmzx/totalavtiveext', 'common'); $sql = 'SELECT SUM(ext_active) AS count FROM ' . EXT_TABLE; $result = $this->db->sql_query($sql); $ext_count = (int) $this->db->sql_fetchfield('count'); $this->template->assign_vars(array('TOTAL_EXT' => $this->user->lang['TOTAL_EXT'] . ' <strong>' . number_format($ext_count) . '</strong>')); }
/** * Set up the the lang vars * * @param object $event The event object * @return null * @access public */ public function user_setup($event) { // what page are we on? $page_name = substr($this->user->page['page_name'], 0, strpos($this->user->page['page_name'], '.')); // We only care about memberlist and viewtopic if (in_array($page_name, array('viewtopic', 'memberlist', 'search'))) { $this->user->add_lang_ext('rmcgirr83/zodiacs', 'zodiacs'); } }
/** * Constructor * * @param \phpbb\db\driver\driver_interface $db Database object * @param \phpbb\user $user * @param \phpbb\auth\auth $auth * @param string $root_path core.root_path * @param string $php_ext core.php_ext */ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\auth\auth $auth, $root_path, $php_ext) { $this->db = $db; $this->user = $user; $this->auth = $auth; $this->root_path = $root_path; $this->php_ext = $php_ext; $this->user->add_lang_ext('tierra/topicsolved', 'common'); }
/** * 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; } }