Ejemplo n.º 1
0
 /**
  * Check if request is ajax and output quickedit if it is
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function catch_ajax_requests($event)
 {
     // Parse page for quickedit window
     if ($this->helper->is_catchable_request($event)) {
         // Add hidden fields
         $this->helper->add_hidden_fields($event);
         // Update S_HIDDEN_FIELDS in page_data
         $this->template->assign_vars(array_merge($event['page_data'], array('S_HIDDEN_FIELDS' => $event['s_hidden_fields'])));
         $this->template->set_filenames(array('body' => '@marc_quickedit/quickedit_body.html'));
         $json = new \phpbb\json_response();
         $json->send(array('POST_ID' => $event['post_id'], 'MESSAGE' => $this->template->assign_display('body')));
     }
 }
Ejemplo n.º 2
0
 /**
  * Update the template variables
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function site_logo_header($event)
 {
     $site_logo_img = $this->config['site_logo_remove'] ? '' : $this->user->img('site_logo');
     if ($this->config['site_logo_image'] && !$this->config['site_logo_remove']) {
         $logo_path = strpos(strtolower($this->config['site_logo_image']), 'http') !== false ? $this->config['site_logo_image'] : append_sid($this->root_path . $this->config['site_logo_image'], false, false);
         $logo_corners = '0px 0px 0px 0px';
         $logo_corners = $this->config['site_logo_left'] ? $this->config['site_logo_pixels'] . 'px 0px 0px ' . $this->config['site_logo_pixels'] . 'px' : $logo_corners;
         $logo_corners = $this->config['site_logo_right'] ? '0px ' . $this->config['site_logo_pixels'] . 'px ' . $this->config['site_logo_pixels'] . 'px 0px' : $logo_corners;
         $logo_corners = $this->config['site_logo_left'] && $this->config['site_logo_right'] ? $this->config['site_logo_pixels'] . 'px ' . $this->config['site_logo_pixels'] . 'px ' . $this->config['site_logo_pixels'] . 'px ' . $this->config['site_logo_pixels'] . 'px' : $logo_corners;
         $site_logo_img = '<img src=' . $logo_path . ' style="max-width: 100%; height:auto; height:' . $this->config['site_logo_height'] . 'px; width:' . $this->config['site_logo_width'] . 'px; -webkit-border-radius: ' . $logo_corners . '; -moz-border-radius: ' . $logo_corners . '; border-radius: ' . $logo_corners . ';">';
     }
     $this->template->assign_vars(array('SITE_DESCRIPTION' => $this->config['site_name_supress'] ? '' : $this->config['site_desc'], 'SITE_LOGO_CENTRE' => $this->config['site_logo_position'] == 1 ? true : false, 'SITE_LOGO_IMG' => $site_logo_img, 'SITE_LOGO_RIGHT' => $this->config['site_logo_position'] == 2 ? true : false, 'SITENAME_SUPRESS' => $this->config['site_name_supress'] ? true : false, 'S_IN_SEARCH' => $this->config['site_search_remove'] ? true : false));
 }
Ejemplo n.º 3
0
 /**
  * Update the data
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function add_stats_settings($event)
 {
     // Need this as global until it is added to the event
     global $legend;
     //$legend = $event['legend'];
     $display_output = false;
     // No point in doing the processing if it is not being displayed
     if ($this->config['statsonindex_guests'] || $this->config['statsonindex_admin'] && $this->auth->acl_get('a_') || !$this->config['statsonindex_admin'] && $this->user->data['is_registered']) {
         $display_output = true;
         $this->user->add_lang_ext('david63/statsonindex', 'stats_on_index');
         // Activity stats
         // Obtain posts/topics/new users activity
         $activity = $this->obtain_activity_data();
         $tf_posts = number_format($activity['posts'], '0');
         $tf_topics = number_format($activity['topics'], '0');
         $tf_users = number_format($activity['users'], '0');
         // Obtain user activity data
         $active_users = $this->obtain_active_user_data();
         $active_user_count = number_format(sizeof($active_users), '0');
         // 24 hour users online list, assign to the template block: lastvisit
         foreach ($active_users as $row) {
             // Check that the user is valid
             if ($row['user_id']) {
                 if ($row['user_type'] != USER_IGNORE) {
                     $this->template->assign_block_vars('lastvisit_user', array('USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'])));
                 } else {
                     $this->template->assign_block_vars('lastvisit_bot', array('USERNAME_FULL' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour'])));
                 }
             }
         }
         // Extended stats
         $files_per_day = number_format($this->config['num_files'] / ceil((time() - $this->config['board_startdate']) / 86400), '2');
         $files_per_user = number_format($this->config['num_files'] / $this->config['num_users'], '2');
         $files_per_year = number_format($files_per_day * 364.25, '0');
         $posts_per_day = number_format($this->config['num_posts'] / ceil((time() - $this->config['board_startdate']) / 86400), '2');
         $posts_per_topic = number_format($this->config['num_posts'] / $this->config['num_topics'], '2');
         $posts_per_user = number_format($this->config['num_posts'] / $this->config['num_users'], '2');
         $posts_per_year = number_format($posts_per_day * 364.25, '0');
         $topics_per_day = number_format($this->config['num_topics'] / ceil((time() - $this->config['board_startdate']) / 86400), '2');
         $topics_per_user = number_format($this->config['num_topics'] / $this->config['num_users'], '2');
         $topics_per_year = number_format($topics_per_day * 364.25, '0');
         $total_files = number_format($this->config['num_files'], '0');
         $users_per_day = number_format($this->config['num_users'] / ceil((time() - $this->config['board_startdate']) / 86400), '2');
         $users_per_year = number_format($users_per_day * 364.25, '0');
         $none = $this->user->lang('NONE');
         $this->template->assign_vars(array('FILES_PER_DAY' => $this->user->lang('FILE_PER_DAY', $files_per_day == 0 ? $none : $files_per_day), 'FILES_PER_USER' => $this->user->lang('FILES_PER_USER', $files_per_user == 0 ? $none : $files_per_user), 'FILES_PER_YEAR' => $this->user->lang('FILES_PER_YEAR', $files_per_year == 0 ? $none : $files_per_year), 'POSTS_PER_DAY' => $this->user->lang('POST_PER_DAY', $posts_per_day == 0 ? $none : $posts_per_day), 'POSTS_PER_TOPIC' => $this->user->lang('POSTS_PER_TOPIC', $posts_per_topic == 0 ? $none : $posts_per_topic), 'POSTS_PER_USER' => $this->user->lang('POSTS_PER_USER', $posts_per_user == 0 ? $none : $posts_per_user), 'POSTS_PER_YEAR' => $this->user->lang('POSTS_PER_YEAR', $posts_per_year == 0 ? $none : $posts_per_year), 'TFHOUR_POSTS' => $this->user->lang('TFHOUR_POSTS', $tf_posts == 0 ? $none : $tf_posts), 'TFHOUR_TOPICS' => $this->user->lang('TFHOUR_TOPICS', $tf_topics == 0 ? $none : $tf_topics), 'TFHOUR_USERS' => $this->user->lang('TFHOUR_USERS', $tf_users == 0 ? $none : $tf_users), 'TOPICS_PER_DAY' => $this->user->lang('TOPIC_PER_DAY', $topics_per_day == 0 ? $none : $topics_per_day), 'TOPICS_PER_USER' => $this->user->lang('TOPICS_PER_USER', $topics_per_user == 0 ? $none : $topics_per_user), 'TOPICS_PER_YEAR' => $this->user->lang('TOPICS_PER_YEAR', $topics_per_year == 0 ? $none : $topics_per_year), 'TOTAL_FILES' => $this->user->lang('TOTAL_FILES', $total_files == 0 ? $none : $total_files), 'USERS_PER_DAY' => $this->user->lang('USER_PER_DAY', $users_per_day == 0 ? $none : $users_per_day), 'USERS_PER_YEAR' => $this->user->lang('USERS_PER_YEAR', $users_per_year == 0 ? $none : $users_per_year), 'USERS_TFHOUR_TOTAL' => $this->user->lang('USERS_TFHOUR_TOTAL', $active_user_count == 0 ? $none : (int) $active_user_count), 'START_DATE' => $this->user->format_date($this->config['board_startdate']), 'ONLINE_FOR' => floor((time() - $this->config['board_startdate']) / 86400), 'S_SHOW_BOTS' => $this->config['statsonindex_bots'], 'S_SHOW_DAYS' => $this->config['statsonindex_days'], 'S_SHOW_STATS' => $this->config['statsonindex_stats'], 'S_SHOW_SUMMARY' => $this->config['statsonindex_summary'], 'S_SHOW_USERS' => $this->config['statsonindex_users'], 'LEGEND' => false, 'LEGEND_USERS' => $legend, 'TOTAL_POSTS' => $this->user->lang('TOTAL_POSTS_COUNT', number_format($this->config['num_posts'], '0')), 'TOTAL_TOPICS' => $this->user->lang('TOTAL_TOPICS', number_format($this->config['num_topics'], '0')), 'TOTAL_USERS' => $this->user->lang('TOTAL_USERS', number_format($this->config['num_users'], '0'))));
     }
     $this->template->assign_var('S_DISPLAY_STATS_OUTPUT', $display_output);
 }
Ejemplo n.º 4
0
 /**
  * Add some additional template variables
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function page_header($event)
 {
     $this->template->assign_vars(array('DISCLAIMER_BODY' => sprintf($this->user->lang('DISCLAIMER_TEXT'), $this->config['sitename']), 'S_DISCLAIMER' => $this->config['show_disclaimer'], 'SITE' => $this->config['sitename']));
 }
Ejemplo n.º 5
0
 /**
  * Add the required template variables
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function page_header($event)
 {
     $this->template->assign_vars(array('S_USER_RANKS' => $this->config['userranks_enable'], 'S_USER_RANKS_LINK_ENABLED' => $this->config['userranks_header_link'], 'U_USER_RANKS' => $this->controller_helper->route('david63_userranks_main_controller', array('name' => 'ranks')), 'U_USER_RANKS_MEMBERS' => $this->config['userranks_members'] || $this->config['userranks_members_admin'] && $this->auth->acl_get('a_')));
 }
Ejemplo n.º 6
0
 public function page_footer($event)
 {
     $this->template->assign_vars(array('S_COOKIE_ON_INDEX' => $this->config['cookie_on_index'], 'S_COOKIE_SHOW_POLICY' => $this->config['cookie_show_policy'], 'U_COOKIE_PAGE' => $this->helper->route('david63_cookiepolicy_controller', array('name' => 'cookie'))));
 }