/** * Display support topics from all contributions or of a specific type. * * @param string $type Contribution type's string identifier * @return \Symfony\Component\HttpFoundation\Response */ public function display_topics($type) { $type_id = $this->get_type_id($type); if ($type_id === false) { return $this->helper->error('NO_PAGE', 404); } if ($type == 'all') { // Mark all topics read if ($this->request->variable('mark', '') == 'topics') { $this->tracking->track(TITANIA_ALL_SUPPORT, self::ALL_SUPPORT); } // Mark all topics read $this->template->assign_var('U_MARK_TOPICS', $this->helper->route('phpbb.titania.support', array('type' => 'all', 'mark' => 'topics'))); } $this->display->assign_global_vars(); $u_all_support = $this->helper->route('phpbb.titania.support', array('type' => 'all')); $this->template->assign_var('U_ALL_SUPPORT', $u_all_support); // Generate the main breadcrumbs $this->display->generate_breadcrumbs(array('ALL_SUPPORT' => $u_all_support)); // Links to the support topic lists foreach ($this->types->get_all() as $id => $class) { $this->template->assign_block_vars('support_types', array('U_SUPPORT' => $this->helper->route('phpbb.titania.support', array('type' => $class->url)), 'TYPE_SUPPORT' => $class->langs)); } $data = \topics_overlord::display_forums_complete('all_support', false, array('contrib_type' => $type_id)); // Canonical URL $data['sort']->set_url($this->helper->route('phpbb.titania.support', array('type' => $type))); $this->template->assign_var('U_CANONICAL', $data['sort']->build_canonical()); return $this->helper->render('all_support.html', 'CUSTOMISATION_DATABASE'); }
phpbb::$user->add_lang('viewforum'); if ($topic_id) { // Subscriptions titania_subscriptions::handle_subscriptions(TITANIA_TOPIC, $topic_id, $topic->get_url()); // Check access level if ($topic->topic_access < titania::$access_level || $topic->topic_type == TITANIA_QUEUE_DISCUSSION && !titania::$contrib->is_author && !titania::$contrib->is_active_coauthor && !titania_types::$types[titania::$contrib->contrib_type]->acl_get('queue_discussion')) { titania::needs_auth(); } posts_overlord::display_topic_complete($topic); titania::page_header(censor_text($topic->topic_subject) . ' - ' . titania::$contrib->contrib_name); if (phpbb::$auth->acl_get('u_titania_post')) { phpbb::$template->assign_var('U_POST_REPLY', titania_url::append_url($topic->get_url(), array('action' => 'reply'))); } // Canonical URL phpbb::$template->assign_var('U_CANONICAL', $topic->get_url()); } else { // Subscriptions titania_subscriptions::handle_subscriptions(TITANIA_SUPPORT, titania::$contrib->contrib_id, titania::$contrib->get_url('support')); // Mark all topics read if (request_var('mark', '') == 'topics') { titania_tracking::track(TITANIA_SUPPORT, titania::$contrib->contrib_id); } $data = topics_overlord::display_forums_complete('support', titania::$contrib); titania::page_header(titania::$contrib->contrib_name . ' - ' . phpbb::$user->lang['CONTRIB_SUPPORT']); if (phpbb::$auth->acl_get('u_titania_topic') && titania::$config->support_in_titania) { phpbb::$template->assign_var('U_POST_TOPIC', titania_url::append_url(titania::$contrib->get_url('support'), array('action' => 'post'))); } $data['sort']->set_url(titania::$contrib->get_url('support')); phpbb::$template->assign_vars(array('U_MARK_TOPICS' => titania_url::append_url(titania::$contrib->get_url('support'), array('mark' => 'topics')), 'U_CANONICAL' => $data['sort']->build_canonical(), 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => titania_url::build_url('search', array('type' => TITANIA_SUPPORT, 'contrib' => titania::$contrib->contrib_id)))); } titania::page_footer(true, 'contributions/contribution_support.html');
if (sizeof($authed) == 1) { $queue_type = $authed[0]; } else { foreach ($authed as $type_id) { $sql = 'SELECT COUNT(topic_id) AS cnt FROM ' . TITANIA_TOPICS_TABLE . ' WHERE topic_type = ' . TITANIA_QUEUE_DISCUSSION . ' AND topic_category = ' . (int) $type_id; phpbb::$db->sql_query($sql); $cnt = phpbb::$db->sql_fetchfield('cnt'); phpbb::$db->sql_freeresult(); phpbb::$template->assign_block_vars('categories', array('U_VIEW_CATEGORY' => titania_url::append_url($base_url, array('queue' => titania_types::$types[$type_id]->url)), 'CATEGORY_NAME' => titania_types::$types[$type_id]->lang, 'CATEGORY_CONTRIBS' => $cnt)); } phpbb::$template->assign_vars(array('S_QUEUE_LIST' => true)); titania::page_header('QUEUE_DISCUSSION'); titania::page_footer(true, 'manage/queue.html'); } } } else { if (!titania_types::$types[$queue_type]->acl_get('queue_discussion')) { titania::needs_auth(); } } // Add the queue type to the base url $base_url = titania_url::append_url($base_url, array('queue' => titania_types::$types[$queue_type]->url)); // Add to Breadcrumbs titania::generate_breadcrumbs(array(titania_types::$types[$queue_type]->lang => $base_url)); topics_overlord::display_forums_complete('queue_discussion', false, array('topic_category' => $queue_type)); // Mark all topics read phpbb::$template->assign_var('U_MARK_TOPICS', titania_url::append_url($base_url, array('mark' => 'topics'))); titania::page_header('QUEUE_DISCUSSION'); titania::page_footer(true, 'manage/queue_discussion.html');
/** * Display queue discussion type. * * @param string $queue_type Queue type URL identifier. * @return \Symfony\Component\HttpFoundation\Response */ public function display_type($queue_type) { $type = $this->load_type($queue_type); if (!$type->acl_get('queue_discussion')) { return $this->helper->needs_auth(); } // Mark all topics read if ($this->request->variable('mark', '') == 'topics') { $this->tracking->track(TITANIA_QUEUE_DISCUSSION, self::ALL_TYPES); } $this->display->assign_global_vars(); $this->generate_navigation('queue_discussion'); // Add to Breadcrumbs $this->display->generate_breadcrumbs(array($type->lang => $this->get_type_url($type))); \topics_overlord::display_forums_complete('queue_discussion', false, array('topic_category' => $type->id)); // Mark all topics read $this->template->assign_var('U_MARK_TOPICS', $this->get_type_url($type, array('mark' => 'topics'))); return $this->helper->render('manage/queue_discussion.html', 'QUEUE_DISCUSSION'); }
/** * Display support page. * * @param string $contrib_type Contrib type URL identifier. * @param string $contrib Contrib name clean. * * @return \Symfony\Component\HttpFoundation\Response */ public function display_support($contrib_type, $contrib) { $this->load_contrib($contrib_type, $contrib); if (!$this->check_auth()) { return $this->helper->needs_auth(); } $this->user->add_lang('viewforum'); // Subscriptions $this->subscriptions->handle_subscriptions(TITANIA_SUPPORT, $this->contrib->contrib_id, $this->contrib->get_url('support'), 'SUBSCRIBE_SUPPORT'); // Mark all topics read if ($this->request->variable('mark', '') == 'topics') { $this->tracking->track(TITANIA_SUPPORT, $this->contrib->contrib_id); } $can_post_topic = $this->ext_config->support_in_titania && $this->auth->acl_get('u_titania_topic'); $data = \topics_overlord::display_forums_complete('support', $this->contrib); $data['sort']->set_url($this->contrib->get_url('support')); $this->template->assign_vars(array('U_POST_TOPIC' => $can_post_topic ? $this->contrib->get_url('posting') : '', 'U_MARK_TOPICS' => $this->contrib->get_url('support', array('mark' => 'topics')), 'U_CANONICAL' => $data['sort']->build_canonical(), 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => $this->helper->route('phpbb.titania.search.results'), 'SEARCH_HIDDEN_FIELDS' => build_hidden_fields(array('type' => TITANIA_SUPPORT, 'contrib' => $this->contrib->contrib_id)))); $this->assign_vars(); return $this->helper->render('contributions/contribution_support.html', $this->contrib->contrib_name . ' - ' . $this->user->lang['CONTRIB_SUPPORT']); }
/** * Display author's support topics page. * * @return \Symfony\Component\HttpFoundation\Response */ protected function support() { if (!$this->is_owner) { return $this->helper->needs_auth(); } // Mark all topics read if ($this->request->variable('mark', '') == 'topics') { foreach ($this->cache->get_author_contribs($this->author->user_id, $this->types, $this->user) as $contrib_id) { $this->tracking->track(TITANIA_SUPPORT, $contrib_id); } } \topics_overlord::display_forums_complete('author_support', $this->author); // Mark all topics read $this->template->assign_var('U_MARK_TOPICS', $this->author->get_url('support', array('mark' => 'topics'))); return $this->helper->render('contributions/contribution_support.html', $this->get_title('AUTHOR_SUPPORT')); }
<?php /** * * @package titania * @version $Id$ * @copyright (c) 2008 phpBB Customisation Database Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ if (!defined('IN_TITANIA')) { exit; } // Mark all topics read if (request_var('mark', '') == 'topics') { foreach (titania::$cache->get_author_contribs(titania::$author->user_id) as $contrib_id) { titania_tracking::track(TITANIA_SUPPORT, $contrib_id); } } topics_overlord::display_forums_complete('author_support', titania::$author); // Mark all topics read phpbb::$template->assign_var('U_MARK_TOPICS', titania_url::build_url(titania::$author->get_url('support'), array('mark' => 'topics'))); titania::page_header(titania::$author->get_username_string('username') . ' - ' . phpbb::$user->lang['AUTHOR_SUPPORT']); titania::page_footer(true, 'contributions/contribution_support.html');
case 'support': // The type of contribs (mod, style, converter, official_tool, etc.) $type = request_var('type', 'all'); $type_id = titania_types::type_from_url($type); $type = !$type_id ? 'all' : $type; if ($type == 'all') { // Mark all topics read if (request_var('mark', '') == 'topics') { titania_tracking::track(TITANIA_SUPPORT, 0); } // Mark all topics read phpbb::$template->assign_var('U_MARK_TOPICS', titania_url::append_url(titania_url::build_url('support/all'), array('mark' => 'topics'))); } // Generate the main breadcrumbs titania::generate_breadcrumbs(array('ALL_SUPPORT' => titania_url::build_url('support/' . $type . '/'))); $data = topics_overlord::display_forums_complete('all_support', false, array('contrib_type' => $type_id)); // Links to the support topic lists foreach (titania_types::$types as $id => $class) { phpbb::$template->assign_block_vars('support_types', array('U_SUPPORT' => titania_url::build_url('support/' . $class->url . '/'), 'TYPE_SUPPORT' => $class->langs)); } // Canonical URL $data['sort']->set_url('support/' . $type . '/'); phpbb::$template->assign_var('U_CANONICAL', $data['sort']->build_canonical()); titania::page_header('CUSTOMISATION_DATABASE'); titania::page_footer(true, 'all_support.html'); break; /** * Display all contributions */ /** * Display all contributions