本文整理汇总了PHP中titania::generate_breadcrumbs方法的典型用法代码示例。如果您正苦于以下问题:PHP titania::generate_breadcrumbs方法的具体用法?PHP titania::generate_breadcrumbs怎么用?PHP titania::generate_breadcrumbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类titania
的用法示例。
在下文中一共展示了titania::generate_breadcrumbs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
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');
示例2: array
} else {
if (!titania_types::$types[$queue_type]->acl_get('view')) {
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));
// Main output
if ($queue_id) {
phpbb::$user->add_lang('viewforum');
$action = request_var('action', '');
if ($tag) {
// Add tag to Breadcrumbs
titania::generate_breadcrumbs(array(titania_tags::get_tag_name($tag) => titania_url::append_url($base_url, array('tag' => $tag))));
}
switch ($action) {
case 'in_progress':
$queue = queue_overlord::get_queue_object($queue_id, true);
$queue->in_progress();
redirect(titania_url::append_url($base_url, array('q' => $queue->queue_id)));
break;
case 'no_progress':
$queue = queue_overlord::get_queue_object($queue_id, true);
$queue->no_progress();
redirect(titania_url::append_url($base_url, array('q' => $queue->queue_id)));
break;
case 'delete_queue':
if (phpbb::$user->data['user_type'] != USER_FOUNDER) {
titania::needs_auth();
示例3: array
/**
* Menu Array
*
* 'filename' => array(
* 'title' => 'nav menu title',
* 'url' => $page_url,
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
$nav_ary = array('attention' => array('title' => 'ATTENTION', 'url' => titania_url::build_url('manage/attention'), 'auth' => !phpbb::$auth->acl_gets('u_titania_mod_author_mod', 'u_titania_mod_contrib_mod', 'u_titania_mod_faq_mod', 'u_titania_mod_post_mod') && !sizeof(titania_types::find_authed('moderate')) ? false : true, 'count' => $attention_count), 'queue' => array('title' => 'VALIDATION_QUEUE', 'url' => titania_url::build_url('manage/queue'), 'auth' => sizeof(titania_types::find_authed('view')) && titania::$config->use_queue ? true : false), 'queue_discussion' => array('title' => 'QUEUE_DISCUSSION', 'url' => titania_url::build_url('manage/queue_discussion'), 'auth' => sizeof(titania_types::find_authed('queue_discussion')) && titania::$config->use_queue ? true : false), 'administration' => array('title' => 'ADMINISTRATION', 'url' => titania_url::build_url('manage/administration'), 'auth' => phpbb::$auth->acl_get('u_titania_admin') ? true : false, 'match' => array('categories')), 'categories' => array('title' => 'MANAGE_CATEGORIES', 'url' => titania_url::build_url('manage/categories'), 'auth' => phpbb::$auth->acl_get('u_titania_admin') ? true : false, 'display' => false));
// Display nav menu
titania::generate_nav($nav_ary, $page, 'attention');
// Generate the main breadcrumbs
titania::generate_breadcrumbs(array(phpbb::$user->lang['MANAGE'] => titania_url::build_url('manage')));
if ($page) {
titania::generate_breadcrumbs(array($nav_ary[$page]['title'] => $nav_ary[$page]['url']));
}
// And now to load the appropriate page...
switch ($page) {
case 'queue':
case 'queue_discussion':
case 'attention':
case 'administration':
case 'categories':
include TITANIA_ROOT . 'manage/' . $page . '.' . PHP_EXT;
break;
default:
include TITANIA_ROOT . 'manage/queue.' . PHP_EXT;
exit;
break;
}
示例4: foreach
$categories_ary = titania::$cache->get_categories();
// Parents
foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
$category_object->__set_array($categories_ary[$row['category_id']]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']]) ? phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']] : $categories_ary[$row['category_id']]['category_name'] => titania_url::build_url('manage/categories', array('c' => $row['category_id']))));
}
// Self
$category_object->__set_array($categories_ary[$category_id]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$category_id]['category_name']]) ? phpbb::$user->lang[$categories_ary[$category_id]['category_name']] : $categories_ary[$category_id]['category_name'] => titania_url::build_url('manage/categories', array('c' => $category_id))));
// Second set of breadcrumbs for category navigation
// Parents
foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
$category_object->__set_array($categories_ary[$row['category_id']]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']]) ? phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']] : $categories_ary[$row['category_id']]['category_name'] => titania_url::build_url('manage/categories', array('c' => $row['category_id']))), $block = 'nav_categories');
}
// Self
$category_object->__set_array($categories_ary[$category_id]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$category_id]['category_name']]) ? phpbb::$user->lang[$categories_ary[$category_id]['category_name']] : $categories_ary[$category_id]['category_name'] => titania_url::build_url('manage/categories', array('c' => $category_id))), $block = 'nav_categories');
unset($categories_ary, $category_object);
}
phpbb::$template->assign_vars(array('ICON_MOVE_UP' => '<img src="' . titania::$images_path . 'icon_up.gif" alt="' . phpbb::$user->lang['MOVE_UP'] . '" title="' . phpbb::$user->lang['MOVE_UP'] . '" />', 'ICON_MOVE_UP_DISABLED' => '<img src="' . titania::$images_path . 'icon_up_disabled.gif" alt="' . phpbb::$user->lang['MOVE_UP'] . '" title="' . phpbb::$user->lang['MOVE_UP'] . '" />', 'ICON_MOVE_DOWN' => '<img src="' . titania::$images_path . 'icon_down.gif" alt="' . phpbb::$user->lang['MOVE_DOWN'] . '" title="' . phpbb::$user->lang['MOVE_DOWN'] . '" />', 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . titania::$images_path . 'icon_down_disabled.gif" alt="' . phpbb::$user->lang['MOVE_DOWN'] . '" title="' . phpbb::$user->lang['MOVE_DOWN'] . '" />', 'ICON_EDIT' => '<img src="' . titania::$images_path . 'icon_edit.gif" alt="' . phpbb::$user->lang['EDIT'] . '" title="' . phpbb::$user->lang['EDIT'] . '" />', 'ICON_EDIT_DISABLED' => '<img src="' . titania::$images_path . 'icon_edit_disabled.gif" alt="' . phpbb::$user->lang['EDIT'] . '" title="' . phpbb::$user->lang['EDIT'] . '" />', 'ICON_DELETE' => '<img src="' . titania::$images_path . 'icon_delete.gif" alt="' . phpbb::$user->lang['DELETE'] . '" title="' . phpbb::$user->lang['DELETE'] . '" />', 'ICON_DELETE_DISABLED' => '<img src="' . titania::$images_path . 'icon_delete_disabled.gif" alt="' . phpbb::$user->lang['DELETE'] . '" title="' . phpbb::$user->lang['DELETE'] . '" />', 'SECTION_NAME' => '<a href="' . titania_url::build_url('manage/categories') . '">' . phpbb::$user->lang['MANAGE_CATEGORIES'] . '</a>', 'U_CREATE_CATEGORY' => titania_url::build_url('manage/categories', array('c' => $category_id, 'action' => 'add')), 'U_MANAGE_CATEGORIES' => titania_url::build_url('manage/categories'), 'S_MANAGE' => true));
break;
}
function trigger_back($message)
{
$message = isset(phpbb::$user->lang[$message]) ? phpbb::$user->lang[$message] : $message;
$message .= '<br /><br /><a href="' . titania_url::build_url('manage/categories') . '">' . phpbb::$user->lang['BACK'] . '</a>';
trigger_error($message);
}
titania::page_header('MANAGE_CATEGORIES');
titania::page_footer(true, 'manage/categories.html');
示例5: load_contrib
/**
* Load contribution
*
* Call this AFTER you have loaded the main object (like the FAQ item if requested for example)
*
* @param mixed $contrib contrib_id (always send if you have loaded an item for this contrib!)
*/
function load_contrib($contrib_id = false)
{
$contrib = request_var('id', 0) ? request_var('id', 0) : utf8_normalize_nfc(request_var('c', '', true));
$type = request_var('type', '');
// Load the contribution
titania::$contrib = new titania_contribution();
if (!titania::$contrib->load($contrib)) {
trigger_error('CONTRIB_NOT_FOUND');
}
// Make sure the contrib requested is the same as the contrib loaded
if ($contrib_id !== false && $contrib_id != titania::$contrib->contrib_id || $type != titania_types::$types[titania::$contrib->contrib_type]->url) {
// Mismatch, redirect
redirect(titania::$contrib->get_url(basename(request_var('page', 'details'))));
}
// Put the author in titania::$author
titania::$author = titania::$contrib->author;
// Check to see if the currently accessing user is an author
if (titania::$access_level == TITANIA_ACCESS_PUBLIC && phpbb::$user->data['is_registered'] && !phpbb::$user->data['is_bot']) {
if (titania::$contrib->is_author || titania::$contrib->is_active_coauthor) {
titania::$access_level = TITANIA_ACCESS_AUTHORS;
}
}
// Count the number of FAQ items to display
$flags = titania_count::get_flags(titania::$access_level);
$faq_count = titania_count::from_db(titania::$contrib->contrib_faq_count, $flags);
/**
* Menu Array
*
* 'filename' => array(
* 'title' => 'nav menu title',
* 'url' => $page_url,
* 'auth' => ($can_see_page) ? true : false, // Not required, always true if missing
* ),
*/
$nav_ary = array('details' => array('title' => 'CONTRIB_DETAILS', 'url' => titania::$contrib->get_url()), 'faq' => array('title' => 'CONTRIB_FAQ', 'url' => titania::$contrib->get_url('faq'), 'auth' => titania::$access_level != TITANIA_ACCESS_PUBLIC || $faq_count ? true : false, 'count' => $faq_count), 'support' => array('title' => 'CONTRIB_SUPPORT', 'url' => titania::$contrib->get_url('support'), 'auth' => titania::$config->support_in_titania || titania::$access_level < TITANIA_ACCESS_PUBLIC ? true : false), 'manage' => array('title' => 'CONTRIB_MANAGE', 'url' => titania::$contrib->get_url('manage'), 'auth' => (titania::$contrib->is_author || titania::$contrib->is_active_coauthor) && phpbb::$auth->acl_get('u_titania_post_edit_own') && !in_array(titania::$contrib->contrib_status, array(TITANIA_CONTRIB_CLEANED, TITANIA_CONTRIB_DISABLED)) || phpbb::$auth->acl_get('u_titania_mod_contrib_mod') || titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')));
// Display nav menu
$page = request_var('page', '');
titania::generate_nav($nav_ary, $page, 'details');
// Search for a category with the same name as the contrib type. This is a bit ugly, but there really isn't any better option
$categories_ary = titania::$cache->get_categories();
foreach ($categories_ary as $category_id => $category_row) {
$category_row['category_name'] = isset(phpbb::$user->lang[$category_row['category_name']]) ? phpbb::$user->lang[$category_row['category_name']] : $category_row['category_name'];
if ($category_row['category_name'] == titania_types::$types[titania::$contrib->contrib_type]->lang || $category_row['category_name'] == titania_types::$types[titania::$contrib->contrib_type]->langs) {
$category_object = new titania_category();
$category_object->__set_array($categories_ary[$category_id]);
// Generate the main breadcrumbs
titania::generate_breadcrumbs(array($category_object->category_name => titania_url::build_url($category_object->get_url())));
break;
}
}
titania::generate_breadcrumbs(array(titania::$contrib->contrib_name => titania::$contrib->get_url()));
if ($page) {
titania::generate_breadcrumbs(array($nav_ary[$page]['title'] => $nav_ary[$page]['url']));
}
}
示例6: titania_display_categories
$category_id = (int) $category;
}
titania_display_categories($category_id);
$categories_ary = false;
if ($category_id != 0) {
// Breadcrumbs
$category_object = new titania_category();
$categories_ary = titania::$cache->get_categories();
// Parents
foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
$category_object->__set_array($categories_ary[$row['category_id']]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']]) ? phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']] : $categories_ary[$row['category_id']]['category_name'] => titania_url::build_url($category_object->get_url())));
}
// Self
$category_object->__set_array($categories_ary[$category_id]);
titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$category_id]['category_name']]) ? phpbb::$user->lang[$categories_ary[$category_id]['category_name']] : $categories_ary[$category_id]['category_name'] => titania_url::build_url($category_object->get_url())));
// Get the child categories we want to select the contributions from
$child_categories = array_keys(titania::$cache->get_category_children($category_id));
phpbb::$template->assign_vars(array('CATEGORY_ID' => $category_id, 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => titania_url::build_url('find-contribution')));
$sort = false;
// If there are categories we are listing as well, only show 10 by default
if (sizeof($child_categories)) {
// Setup the sort tool to only display the 10 most recent
$sort = contribs_overlord::build_sort();
$sort->set_defaults(10);
}
// Include the current category in the ones selected
$child_categories[] = $category_id;
$data = contribs_overlord::display_contribs('category', $child_categories, $sort);
// Canonical URL
$data['sort']->set_url($category_object->get_url());