本文整理汇总了PHP中JPagination::getPagesLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP JPagination::getPagesLinks方法的具体用法?PHP JPagination::getPagesLinks怎么用?PHP JPagination::getPagesLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPagination
的用法示例。
在下文中一共展示了JPagination::getPagesLinks方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPhotos
/**
* TuiyoModelPhotos::getPhotos()
* An array of all photos belonging to userID
* @param mixed $userID
* @param mixed $albumID
* @param mixed $limit
* @param mixed $published
* @param bool $newFirst
* @return
*/
public function getPhotos($userID, $albumID = NULL, $published = NULL, $newFirst = TRUE, $uselimit = TRUE, $overiteLimit = NULL)
{
$limit = $uselimit ? $this->getState('limit') : NULL;
$limit = !is_null($overiteLimit) ? (int) $overiteLimit : $limit;
$limitstart = $this->getState('limitstart');
//1. Get all Photos
$photosTable = TuiyoLoader::table("photos", true);
$photos = $photosTable->getAllPhotos($userID, $albumID, $limitstart, $published, $newFirst, $limit);
//print_R( $photos );
//1b. Paginate?
jimport('joomla.html.pagination');
$dbo = $photosTable->_db;
$this->_total = $dbo->loadResult();
$pageNav = new JPagination($this->_total, $limitstart, $limit);
$root = JURI::root();
$this->pageNav = $pageNav->getPagesLinks();
//Set the total count
$this->setState('total', $this->_total);
$this->setState('pagination', $this->pageNav);
//2. Check the existence of each photo!
foreach ($photos as $photo) {
$photo->date_added = TuiyoTimer::diff(strtotime($photo->date_added));
$photo->last_modified = TuiyoTimer::diff(strtotime($photo->last_modified));
$photo->src_original = $root . substr($photo->src_original, 1);
$photo->src_thumb = $root . substr($photo->src_thumb, 1);
}
return (array) $photos;
}
示例2: appFullView
/**
* Application full view
**/
function appFullView()
{
$document =& JFactory::getDocument();
$this->showSubmenu();
$applicationName = JString::strtolower(JRequest::getVar('app', '', 'GET'));
if (empty($applicationName)) {
JError::raiseError(500, 'CC APP ID REQUIRED');
}
if (!$this->accessAllowed('registered')) {
return;
}
$output = '';
//@todo: Since group walls doesn't use application yet, we process it manually now.
if ($applicationName == 'walls') {
CFactory::load('libraries', 'wall');
$jConfig = JFactory::getConfig();
$limit = $jConfig->get('list_limit');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
$eventId = JRequest::getVar('eventid', '', 'GET');
$my = CFactory::getUser();
$config = CFactory::getConfig();
$eventsModel = CFactory::getModel('Events');
$event =& JTable::getInstance('Event', 'CTable');
$event->load($eventId);
$config = CFactory::getConfig();
$document->setTitle(JText::sprintf('CC EVENTS WALL TITLE', $event->title));
CFactory::load('helpers', 'owner');
$guest = $event->isMember($my->id);
$waitingApproval = $event->isPendingApproval($my->id);
$status = $event->getUserStatus($my->id);
$responded = $status == COMMUNITY_EVENT_STATUS_ATTEND || $status == COMMUNITY_EVENT_STATUS_WONTATTEND || $status == COMMUNITY_EVENT_STATUS_MAYBE;
if (!$config->get('lockeventwalls') || $config->get('lockeventwalls') && $guest && !$waitingApproval && $responded || COwnerHelper::isCommunityAdmin()) {
$output .= CWallLibrary::getWallInputForm($event->id, 'events,ajaxSaveWall', 'events,ajaxRemoveWall');
// Get the walls content
$output .= '<div id="wallContent">';
$output .= CWallLibrary::getWallContents('events', $event->id, $event->isAdmin($my->id), 0, $limitstart, 'wall.content', 'events,events');
$output .= '</div>';
jimport('joomla.html.pagination');
$wallModel = CFactory::getModel('wall');
$pagination = new JPagination($wallModel->getCount($event->id, 'events'), $limitstart, $limit);
$output .= '<div class="pagination-container">' . $pagination->getPagesLinks() . '</div>';
}
} else {
CFactory::load('libraries', 'apps');
$model = CFactory::getModel('apps');
$applications =& CAppPlugins::getInstance();
$applicationId = $model->getUserApplicationId($applicationName);
$application = $applications->get($applicationName, $applicationId);
if (!$application) {
JError::raiseError(500, 'CC APPLICATION NOT FOUND');
}
// Get the parameters
$manifest = JPATH_PLUGINS . DS . 'community' . DS . $applicationName . DS . $applicationName . '.xml';
$params = new JParameter($model->getUserAppParams($applicationId), $manifest);
$application->params =& $params;
$application->id = $applicationId;
$output = $application->onAppDisplay($params);
}
echo $output;
}
示例3: getAllNotifications
/**
* TuiyoModelNotifications::getAllNotifications()
* Add function documentation
* @param mixed $userID
* @param mixed $status
* @return void
*/
public function getAllNotifications($userID, $status = NULL)
{
$nTable = TuiyoLoader::table("notifications", true);
$limit = $this->getState('limit');
$limitstart = $this->getState('limitstart');
$notices = $nTable->getUserNotifications((int) $userID, $limitstart, $limit);
//1b. Paginate?
jimport('joomla.html.pagination');
$dbo = $nTable->_db;
$this->_total = $dbo->loadResult();
$pageNav = new JPagination($this->_total, $limitstart, $limit);
$this->pageNav = $pageNav->getPagesLinks();
//Set the total count
$this->setState('total', $this->_total);
$this->setState('pagination', $this->pageNav);
return $notices;
}
示例4: appFullView
/**
* Application full view
**/
public function appFullView()
{
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_COMMUNITY_GROUPS_WALL_TITLE'));
$applicationName = JString::strtolower(JRequest::getVar('app', '', 'GET'));
if (empty($applicationName)) {
JError::raiseError(500, 'COM_COMMUNITY_APP_ID_REQUIRED');
}
$output = '';
$groupModel = CFactory::getModel('groups');
$groupId = JRequest::getInt('groupid', '', 'GET');
$group =& JTable::getInstance('Group', 'CTable');
$group->load($groupId);
// @rule: Test if the group is unpublished, don't display it at all.
if (!$group->published) {
$this->_redirectUnpublishGroup();
return;
}
//@todo: Since group walls doesn't use application yet, we process it manually now.
if ($applicationName == 'walls') {
CFactory::load('libraries', 'wall');
$limit = JRequest::getInt('limit', 5, 'REQUEST');
$limitstart = JRequest::getInt('limitstart', 0, 'REQUEST');
$my = CFactory::getUser();
$config = CFactory::getConfig();
$isBanned = $group->isBanned($my->id);
// Test if the current browser is a member of the group
$isMember = $group->isMember($my->id);
$waitingApproval = $groupModel->isWaitingAuthorization($my->id, $group->id);
CFactory::load('helpers', 'owner');
if (!$isMember && !COwnerHelper::isCommunityAdmin() && $group->approvals == COMMUNITY_PRIVATE_GROUP) {
$this->noAccess(JText::_('COM_COMMUNITY_GROUPS_PRIVATE_NOTICE'));
return;
}
if (!$config->get('lockgroupwalls') || $config->get('lockgroupwalls') && ($isMember && !$isBanned) && !$waitingApproval || COwnerHelper::isCommunityAdmin()) {
$output .= CWallLibrary::getWallInputForm($group->id, 'groups,ajaxSaveWall', 'groups,ajaxRemoveWall');
}
// Get the walls content
$output .= '<div id="wallContent">';
if (!$isBanned) {
$output .= CWallLibrary::getWallContents('groups', $group->id, $my->id == $group->ownerid, $limit, $limitstart, 'wall.content', 'groups,group');
} else {
$output .= CWallLibrary::getWallContents('groups', $group->id, $my->id == $group->ownerid, $limit, $limitstart, 'wall.content', 'groups,group', null, 1);
}
$output .= '</div>';
jimport('joomla.html.pagination');
$wallModel = CFactory::getModel('wall');
$pagination = new JPagination($wallModel->getCount($group->id, 'groups'), $limitstart, $limit);
$output .= '<div class="pagination-container">' . $pagination->getPagesLinks() . '</div>';
} else {
CFactory::load('libraries', 'apps');
$model = CFactory::getModel('apps');
$applications =& CAppPlugins::getInstance();
$applicationId = $model->getUserApplicationId($applicationName);
$application = $applications->get($applicationName, $applicationId);
if (!$application) {
JError::raiseError(500, 'COM_COMMUNITY_APPS_NOT_FOUND');
}
// Get the parameters
$manifest = CPluginHelper::getPluginPath('community', $applicationName) . DS . $applicationName . DS . $applicationName . '.xml';
$params = new CParameter($model->getUserAppParams($applicationId), $manifest);
$application->params =& $params;
$application->id = $applicationId;
$output = $application->onAppDisplay($params);
}
echo $output;
}
示例5: view
function view()
{
$mainframe = JFactory::getApplication();
$jshopConfig = JSFactory::getConfig();
$session = JFactory::getSession();
$session->set("jshop_end_page_buy_product", $_SERVER['REQUEST_URI']);
$session->set("jshop_end_page_list_product", $_SERVER['REQUEST_URI']);
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadProductList', array());
$manufacturer_id = JRequest::getInt('manufacturer_id');
$category_id = JRequest::getInt('category_id');
$label_id = JRequest::getInt('label_id');
$vendor_id = JRequest::getInt('vendor_id');
$manufacturer = JTable::getInstance('manufacturer', 'jshop');
$manufacturer->load($manufacturer_id);
$manufacturer->getDescription();
JPluginHelper::importPlugin('jshopping');
$dispatcher->trigger('onBeforeDisplayManufacturer', array(&$manufacturer));
if ($manufacturer->manufacturer_publish == 0) {
JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
return;
}
if (getShopManufacturerPageItemid() == JRequest::getInt('Itemid')) {
appendPathWay($manufacturer->name);
}
if ($manufacturer->meta_title == "") {
$manufacturer->meta_title = $manufacturer->name;
}
setMetaData($manufacturer->meta_title, $manufacturer->meta_keyword, $manufacturer->meta_description);
$action = xhtmlUrl($_SERVER['REQUEST_URI']);
if (!$manufacturer->products_page) {
$manufacturer->products_page = $jshopConfig->count_products_to_page;
}
$count_product_to_row = $manufacturer->products_row;
if (!$count_product_to_row) {
$count_product_to_row = $jshopConfig->count_products_to_row;
}
$context = "jshoping.manufacturlist.front.product";
$contextfilter = "jshoping.list.front.product.manf." . $manufacturer_id;
$orderby = $mainframe->getUserStateFromRequest($context . 'orderby', 'orderby', $jshopConfig->product_sorting_direction, 'int');
$order = $mainframe->getUserStateFromRequest($context . 'order', 'order', $jshopConfig->product_sorting, 'int');
$limit = $mainframe->getUserStateFromRequest($context . 'limit', 'limit', $manufacturer->products_page, 'int');
if (!$limit) {
$limit = $manufacturer->products_page;
}
$limitstart = JRequest::getInt('limitstart');
$orderbyq = getQuerySortDirection($order, $orderby);
$image_sort_dir = getImgSortDirection($order, $orderby);
$field_order = $jshopConfig->sorting_products_field_s_select[$order];
$filters = getBuildFilterListProduct($contextfilter, array("manufacturers"));
$total = $manufacturer->getCountProducts($filters);
jimport('joomla.html.pagination');
$pagination = new JPagination($total, $limitstart, $limit);
$pagenav = $pagination->getPagesLinks();
$dispatcher->trigger('onBeforeFixLimitstartDisplayProductList', array(&$limitstart, &$total, 'manufacturer'));
if ($limitstart >= $total) {
$limitstart = 0;
}
$rows = $manufacturer->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
addLinkToProducts($rows, 0, 1);
foreach ($jshopConfig->sorting_products_name_s_select as $key => $value) {
$sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value');
}
insertValueInArray($manufacturer->products_page, $jshopConfig->count_product_select);
//insert products_page count
foreach ($jshopConfig->count_product_select as $key => $value) {
$product_count[] = JHTML::_('select.option', $key, $value, 'count_id', 'count_value');
}
$sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'sort_id', 'sort_value', $order);
$product_count_sel = JHTML::_('select.genericlist', $product_count, 'limit', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'count_id', 'count_value', $limit);
$_review = JTable::getInstance('review', 'jshop');
$allow_review = $_review->getAllowReview();
if ($jshopConfig->show_product_list_filters) {
$filter_categorys = $manufacturer->getCategorys();
$first_category = array();
$first_category[] = JHTML::_('select.option', 0, _JSHOP_ALL, 'id', 'name');
if (isset($filters['categorys'][0])) {
$active_category = $filters['categorys'][0];
} else {
$active_category = 0;
}
$categorys_sel = JHTML::_('select.genericlist', array_merge($first_category, $filter_categorys), 'categorys[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'id', 'name', $active_category);
} else {
$categorys_sel = '';
}
if ($jshopConfig->use_plugin_content) {
changeDataUsePluginContent($manufacturer, "manufacturer");
}
$display_list_products = count($rows) > 0 || willBeUseFilter($filters);
$dispatcher->trigger('onBeforeDisplayProductList', array(&$rows));
$view_name = "manufacturer";
$view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
$view->setLayout("products");
$view->assign('config', $jshopConfig);
$view->assign('template_block_list_product', "list_products/list_products.php");
$view->assign('template_block_form_filter', "list_products/form_filters.php");
$view->assign('template_block_pagination', "list_products/block_pagination.php");
$view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
//.........这里部分代码省略.........
示例6: onContentPrepare
//.........这里部分代码省略.........
// Simple performance check to determine whether bot should process further.
if (JString::strpos($row->text, 'class="system-pagebreak') === false) {
return true;
}
$view = $input->getString('view');
$full = $input->getBool('fullview');
if (!$page) {
$page = 0;
}
if ($params->get('intro_only') || $params->get('popup') || $full || $view != 'article') {
$row->text = preg_replace($regex, '', $row->text);
return;
}
// Find all instances of plugin and put in $matches.
$matches = array();
preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER);
if ($showall && $this->params->get('showall', 1)) {
$hasToc = $this->params->get('multipage_toc', 1);
if ($hasToc) {
// Display TOC.
$page = 1;
$this->_createToc($row, $matches, $page);
} else {
$row->toc = '';
}
$row->text = preg_replace($regex, '<br />', $row->text);
return true;
}
// Split the text around the plugin.
$text = preg_split($regex, $row->text);
// Count the number of pages.
$n = count($text);
// We have found at least one plugin, therefore at least 2 pages.
if ($n > 1) {
$title = $this->params->get('title', 1);
$hasToc = $this->params->get('multipage_toc', 1);
// Adds heading or title to <site> Title.
if ($title) {
if ($page) {
if ($page && @$matches[$page - 1][2]) {
$attrs = JUtility::parseAttributes($matches[$page - 1][1]);
if (@$attrs['title']) {
$row->page_title = $attrs['title'];
}
}
}
}
// Reset the text, we already hold it in the $text array.
$row->text = '';
if ($style == 'pages') {
// Display TOC.
if ($hasToc) {
$this->_createToc($row, $matches, $page);
} else {
$row->toc = '';
}
// Traditional mos page navigation
$pageNav = new JPagination($n, $page, 1);
// Page counter.
$row->text .= '<div class="pagenavcounter">';
$row->text .= $pageNav->getPagesCounter();
$row->text .= '</div>';
// Page text.
$text[$page] = str_replace('<hr id="system-readmore" />', '', $text[$page]);
$row->text .= $text[$page];
// $row->text .= '<br />';
$row->text .= '<div class="pager">';
// Adds navigation between pages to bottom of text.
if ($hasToc) {
$this->_createNavigation($row, $page, $n);
}
// Page links shown at bottom of page if TOC disabled.
if (!$hasToc) {
$row->text .= $pageNav->getPagesLinks();
}
$row->text .= '</div>';
} else {
$t[] = $text[0];
$t[] = (string) JHtml::_($style . '.start', 'article' . $row->id . '-' . $style);
foreach ($text as $key => $subtext) {
if ($key >= 1) {
$match = $matches[$key - 1];
$match = (array) JUtility::parseAttributes($match[0]);
if (isset($match['alt'])) {
$title = stripslashes($match['alt']);
} elseif (isset($match['title'])) {
$title = stripslashes($match['title']);
} else {
$title = JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $key + 1);
}
$t[] = (string) JHtml::_($style . '.panel', $title, 'article' . $row->id . '-' . $style . $key);
}
$t[] = (string) $subtext;
}
$t[] = (string) JHtml::_($style . '.end');
$row->text = implode(' ', $t);
}
}
return true;
}
示例7: jimport
<?php
if ($this->multiple_stats == 1) {
?>
<div class="fulltablelink">
<?php
echo JHtml::link(JoomleagueHelperRoute::getStatsRankingRoute($this->project->id, $this->division ? $this->division->id : 0, $this->teamid, $rows->id), JText::_('COM_JOOMLEAGUE_STATSRANKING_VIEW_FULL_TABLE'));
?>
</div>
<?php
} else {
jimport('joomla.html.pagination');
$pagination = new JPagination($this->playersstats[$rows->id]->pagination_total, $this->limitstart, $this->limit);
?>
<div class="pageslinks">
<?php
echo $pagination->getPagesLinks();
?>
</div>
<p class="pagescounter">
<?php
echo $pagination->getPagesCounter();
?>
</p>
<?php
}
?>
<?php
}
示例8:
<?php
if ($total != 0) {
?>
<div class = "jr-pagenav">
<ul>
<li class = "jr-pagenav-text"><?php
echo _PAGE;
?>
</li>
<li class = "jr-pagenav-nb">
<?php
// TODO: fxstein - Need to perform SEO cleanup
echo $pageNav->getPagesLinks(JRoute::_(KUNENA_LIVEURLREL . "&func=view&id={$id}&catid={$catid}"));
?>
</li>
</ul>
</div>
<?php
}
?>
</td>
</tr>
</table>
<!-- /top nav -->
<!-- <table border = "0" cellspacing = "0" cellpadding = "0" width = "100%" align = "center"> -->
示例9: getDisplayTab
//.........这里部分代码省略.........
$nbPlugSortBy = $params->get('nbPlugSortBy', "1");
$nbPlugSortOrder = $params->get('nbPlugSortOrder', "DESC");
$nbPlugShowPagination = $params->get('nbPlugShowPagination', "1");
$nbPlugPaginationCount = $params->get('nbPlugPaginationCount', "5");
$limit = $nbPlugPaginationCount > 0 ? $nbPlugPaginationCount : 0;
$offset = JRequest::getVar('limitstart', 0, 'REQUEST');
//get current user
$userId = $user->id;
//get user posts
$rows = $this->getPosts($userId, $nbPlugSortBy, $nbPlugSortOrder, $nbPlugPaginationCount, $limit, $offset);
//get user post count
$row_count = $this->countPosts($userId);
//get item id
$itemId = $this->getItemId();
//create_html
if ($row_count <= 0) {
$list = '<div class="cbNinjaBoard"><div class="cbNBposts"><table><tr><td>You currently have no NinjaBoard posts</td></tr></table></div></div>';
} else {
$list = "";
//show only selected fields in a table row
$list .= '<div class="cbNinjaBoard"><div class="cbNBposts"><table><thead><tr>';
if ($nbPlugShowSubject) {
$list .= '<th>' . JText::_('NB_SUBJECT_CBP') . '</th>';
}
if ($nbPlugShowMessage) {
$list .= '<th>' . JText::_('NB_MESSAGE_CBP') . '</th>';
}
if ($nbPlugShowForum) {
$list .= '<th>' . JText::_('NB_FORUM_CBP') . '</th>';
}
if ($nbPlugShowHits) {
$list .= '<th>' . JText::_('NB_HITS_CBP') . '</th>';
}
if ($nbPlugShowCreated) {
$list .= '<th>' . JText::_('NB_CREATED_CBP') . '</th>';
}
if ($nbPlugShowModified) {
$list .= '<th>' . JText::_('NB_MODIFIED_CBP') . '</th>';
}
if ($nbPlugShowEdit) {
$list .= '<th>' . JText::_('NB_VIEW_POST_CBP') . '</th>';
}
$list .= '</tr></thead><tbody>';
$items = array();
foreach ($rows as $row) {
//get the item subject, show no subject if there is none, truncate subject if necessary
$item->subject_long = stripslashes($row->subject) ? stripslashes($row->subject) : JText::_('NB_NO_SUBJECT_CBP');
$item->subject_short = JString::strlen($row->subject) > $nbPlugTruncateSubject ? JString::substr($row->subject, 0, $nbPlugTruncateSubject - 4) . '...' : $item->subject_long;
$item->subject = $nbPlugTruncateSubject > 0 ? $item->subject_short : $item->subject_long;
//get the item message, show no message if there is none, truncate message if necessary
$item->message_long = stripslashes($row->message) ? stripslashes($row->message) : JText::_('NB_NO_MESSAGE_CBP');
$item->message_short = JString::strlen($row->message) > $nbPlugTruncateMessage ? JString::substr($row->message, 0, $nbPlugTruncateMessage - 4) . '...' : $item->message_long;
$item->unparsed = $nbPlugTruncateMessage > 0 ? $item->message_short : $item->message_long;
$item->message = KFactory::get('admin::com.ninja.helper.bbcode')->parse(array('text' => $item->unparsed));
//link to edit post
$item->view_link = '<a href="' . (JURI::base() . 'index.php?option=com_ninjaboard&view=topic&id=' . $row->topic_id . '&Itemid=' . $itemId . '#post' . $row->post_id) . '" title="' . JText::_('NB_VIEW_POST_CBP') . '">' . '<img src="' . JURI::base() . 'components/com_comprofiler/plugin/user/plug_cbninjaboard/post.png" width="32" height="32" alt="' . JText::_('NB_VIEW_POST_CBP') . '" />' . '</a>';
//link to forum
$item->forum_link = '<a href="' . (JURI::base() . 'index.php?option=com_ninjaboard&view=forum&id=' . $row->forum_id . '&Itemid=' . $itemId) . '" title="' . JText::_($row->forum_name) . '">' . JText::_($row->forum_name) . '</a>';
//format dates
$item->c_datetime = $row->created > 0 ? date($nbPlugDateFormat, strtotime($row->created)) : JText::_('NB_NO_DATE_CBP');
$item->m_datetime = $row->modified > 0 ? date($nbPlugDateFormat, strtotime($row->modified)) : JText::_('NB_NO_DATE_CBP');
//show only selected fields in a table row
$list .= '<tr>';
if ($nbPlugShowSubject) {
$list .= '<td>' . $item->subject . '</td>';
}
if ($nbPlugShowMessage) {
$list .= '<td>' . $item->message . '</td>';
}
if ($nbPlugShowForum) {
$list .= '<td>' . $item->forum_link . '</td>';
}
if ($nbPlugShowHits) {
$list .= '<td>' . $row->hits . '</td>';
}
if ($nbPlugShowCreated) {
$list .= '<td>' . $item->c_datetime . '</td>';
}
if ($nbPlugShowModified) {
$list .= '<td>' . $item->m_datetime . '</td>';
}
if ($nbPlugShowEdit) {
$list .= '<td>' . $item->view_link . '</td>';
}
$list .= '</tr>';
}
$list .= '</table></div>';
if ($nbPlugShowPagination && $row_count > $limit) {
$list .= '<div class="cbNBpagination"><table><tr><td>';
//$list .= KFactory::get('site::com.ninjaboard.helper.paginator',array('name' => 'posts'))->pagination($row_count, $offset, $limit , 4, true);
jimport('joomla.html.pagination');
$pagination = new JPagination($row_count, $offset, $limit);
$list .= $pagination->getPagesLinks() . $pagination->getResultsCounter();
$list .= '</td></tr></table></div>';
}
$list .= '</div>';
}
return $list;
}
}
示例10: onContentPrepare
/**
* @param string The context of the content being passed to the plugin.
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param int The 'page' number
*
* @return void
* @since 1.6
*/
public function onContentPrepare($context, &$row, &$params, $page = 0)
{
// Expression to search for.
$regex = '#<hr(.*)class="system-pagebreak"(.*)\\/>#iU';
$print = JRequest::getBool('print');
$showall = JRequest::getBool('showall');
if (!$this->params->get('enabled', 1)) {
$print = true;
}
if ($print) {
$row->text = preg_replace($regex, '<br />', $row->text);
return true;
}
// Simple performance check to determine whether bot should process further.
if (JString::strpos($row->text, 'class="system-pagebreak') === false) {
return true;
}
$db = JFactory::getDbo();
$view = JRequest::getString('view');
$full = JRequest::getBool('fullview');
if (!$page) {
$page = 0;
}
if ($params->get('intro_only') || $params->get('popup') || $full || $view != 'article') {
$row->text = preg_replace($regex, '', $row->text);
return;
}
// Find all instances of plugin and put in $matches.
$matches = array();
preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER);
if ($showall && $this->params->get('showall', 1)) {
$hasToc = $this->params->get('multipage_toc', 1);
if ($hasToc) {
// Display TOC.
$page = 1;
$this->_createToc($row, $matches, $page);
} else {
$row->toc = '';
}
$row->text = preg_replace($regex, '<br />', $row->text);
return true;
}
// Split the text around the plugin.
$text = preg_split($regex, $row->text);
// Count the number of pages.
$n = count($text);
// We have found at least one plugin, therefore at least 2 pages.
if ($n > 1) {
$title = $this->params->get('title', 1);
$hasToc = $this->params->get('multipage_toc', 1);
// Adds heading or title to <site> Title.
if ($title) {
if ($page) {
$page_text = $page + 1;
if ($page && @$matches[$page - 1][2]) {
$attrs = JUtility::parseAttributes($matches[$page - 1][1]);
if (@$attrs['title']) {
$row->page_title = $attrs['title'];
}
}
}
}
// Reset the text, we already hold it in the $text array.
$row->text = '';
// Display TOC.
if ($hasToc) {
$this->_createToc($row, $matches, $page);
} else {
$row->toc = '';
}
// traditional mos page navigation
jimport('joomla.html.pagination');
$pageNav = new JPagination($n, $page, 1);
// Page counter.
$row->text .= '<div class="pagenavcounter">';
$row->text .= $pageNav->getPagesCounter();
$row->text .= '</div>';
// Page text.
$text[$page] = str_replace('<hr id="system-readmore" />', '', $text[$page]);
$row->text .= $text[$page];
// $row->text .= '<br />';
$row->text .= '<div class="pagination">';
// Adds navigation between pages to bottom of text.
if ($hasToc) {
$this->_createNavigation($row, $page, $n);
}
// Page links shown at bottom of page if TOC disabled.
if (!$hasToc) {
$row->text .= $pageNav->getPagesLinks();
}
$row->text .= '</div>';
//.........这里部分代码省略.........
示例11:
echo _GEN_DELETE;
?>
"/>
</td>
</tr>
<?php
} else {
echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '"><td class="td-1" colspan = "5" >' . _USER_NOSUBSCRIPTIONS . '</td></tr>';
}
?>
<tr><td colspan = "5" class = "fb_profile-bottomnav">
<?php
// TODO: fxstein - Need to perform SEO cleanup
echo $pageNav->getPagesLinks("index.php?option=com_kunena&func=myprofile&do=showsub" . KUNENA_COMPONENT_ITEMID_SUFFIX);
?>
<br/>
<?php
echo $pageNav->getPagesCounter();
?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
示例12: die
<?php
defined('_JEXEC') or die('Restricted access');
jimport('joomla.html.pagination');
$limit = $ad_toplist;
$limitstart = JRequest::getVar('limitstart', 0, 'int');
$page_nav_links = '';
GalleryHeader();
if (!$ad_rating) {
$app->redirect(JRoute::_('index.php?option=com_datsogallery' . $itemid, false));
}
$db->setQuery('SELECT count(*) FROM #__datsogallery WHERE imgvotes > 0 AND published = 1 AND approved = 1');
$total = $db->loadResult();
$pageNav = new JPagination($total, $limitstart, $limit);
$page_nav_links = $pageNav->getPagesLinks();
$db->setQuery('SELECT *, imgvotesum AS rating' . ' FROM #__datsogallery AS a,' . ' #__datsogallery_catg AS ca' . ' WHERE a.catid = ca.cid' . ' AND a.imgvotes > 0' . ' AND a.published = 1' . ' AND a.approved = 1' . ' AND ca.approved = 1' . ' AND ca.published = 1' . ' AND ca.access IN (' . $groups . ')' . ' ORDER BY rating DESC' . ' LIMIT ' . $pageNav->limitstart . ', ' . $pageNav->limit);
$pw_title = JText::_('COM_DATSOGALLERY_TOP_RATED');
$rows = $db->loadObjectList();
$document->setTitle($pw_title);
?>
<div class="datso_pgn">
<?php
echo $page_nav_links;
?>
</div>
<div style="clear:both"></div>
<div class="dg_head_background"><?php
echo $pw_title;
?>
示例13: getPagesLinks
/**
* Create and return the pagination page list string, ie. Previous, Next, 1 2 3 ... x.
*
* @return string Pagination page list string.
*
* @since 11.1
* overide to use bootstrap in j2.5
*/
public function getPagesLinks()
{
$app = JFactory::getApplication();
if (JVM_VERSION === 3 || $app->isSite() && jrequest::getVar('tmpl') !== 'component') {
return parent::getPagesLinks();
}
// Build the page navigation list.
$data = $this->_buildDataObject();
$list = array();
$list['prefix'] = $this->prefix;
$itemOverride = false;
// Build the select list
if ($data->all->base !== null) {
$list['all']['active'] = true;
$list['all']['data'] = $this->pagination_item_active($data->all);
} else {
$list['all']['active'] = false;
$list['all']['data'] = $this->pagination_item_inactive($data->all);
}
if ($data->start->base !== null) {
$list['start']['active'] = true;
$list['start']['data'] = $this->pagination_item_active($data->start);
} else {
$list['start']['active'] = false;
$list['start']['data'] = $this->pagination_item_inactive($data->start);
}
if ($data->previous->base !== null) {
$list['previous']['active'] = true;
$list['previous']['data'] = $this->pagination_item_active($data->previous);
} else {
$list['previous']['active'] = false;
$list['previous']['data'] = $this->pagination_item_inactive($data->previous);
}
$list['pages'] = array();
//make sure it exists
foreach ($data->pages as $i => $page) {
if ($page->base !== null) {
$list['pages'][$i]['active'] = true;
$list['pages'][$i]['data'] = $this->pagination_item_active($page);
} else {
$list['pages'][$i]['active'] = false;
$list['pages'][$i]['data'] = $this->pagination_item_inactive($page);
}
}
if ($data->next->base !== null) {
$list['next']['active'] = true;
$list['next']['data'] = $this->pagination_item_active($data->next);
} else {
$list['next']['active'] = false;
$list['next']['data'] = $this->pagination_item_inactive($data->next);
}
if ($data->end->base !== null) {
$list['end']['active'] = true;
$list['end']['data'] = $this->pagination_item_active($data->end);
} else {
$list['end']['active'] = false;
$list['end']['data'] = $this->pagination_item_inactive($data->end);
}
if ($this->total > $this->limit) {
return $this->pagination_list_render($list);
} else {
return '';
}
}
示例14: display
function display($cachable = false, $urlparams = false)
{
$mainframe = JFactory::getApplication();
$jshopConfig = JSFactory::getConfig();
$session = JFactory::getSession();
$session->set("jshop_end_page_buy_product", $_SERVER['REQUEST_URI']);
$session->set("jshop_end_page_list_product", $_SERVER['REQUEST_URI']);
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadProductList', array());
$product = JTable::getInstance('product', 'jshop');
$params = $mainframe->getParams();
$header = getPageHeaderOfParams($params);
$prefix = $params->get('pageclass_sfx');
$seo = JTable::getInstance("seo", "jshop");
$seodata = $seo->loadData("all-products");
setMetaData($seodata->title, $seodata->keyword, $seodata->description, $params);
$category_id = JRequest::getInt('category_id');
$manufacturer_id = JRequest::getInt('manufacturer_id');
$label_id = JRequest::getInt('label_id');
$vendor_id = JRequest::getInt('vendor_id');
$action = xhtmlUrl($_SERVER['REQUEST_URI']);
$products_page = $jshopConfig->count_products_to_page;
$count_product_to_row = $jshopConfig->count_products_to_row;
$context = "jshoping.alllist.front.product";
$contextfilter = "jshoping.list.front.product.fulllist";
$orderby = $mainframe->getUserStateFromRequest($context . 'orderby', 'orderby', $jshopConfig->product_sorting_direction, 'int');
$order = $mainframe->getUserStateFromRequest($context . 'order', 'order', $jshopConfig->product_sorting, 'int');
$limit = $mainframe->getUserStateFromRequest($context . 'limit', 'limit', $products_page, 'int');
if (!$limit) {
$limit = $products_page;
}
$limitstart = JRequest::getInt('limitstart');
$orderbyq = getQuerySortDirection($order, $orderby);
$image_sort_dir = getImgSortDirection($order, $orderby);
$field_order = $jshopConfig->sorting_products_field_s_select[$order];
$filters = getBuildFilterListProduct($contextfilter, array());
$total = $product->getCountAllProducts($filters);
jimport('joomla.html.pagination');
$pagination = new JPagination($total, $limitstart, $limit);
$pagenav = $pagination->getPagesLinks();
$dispatcher->trigger('onBeforeFixLimitstartDisplayProductList', array(&$limitstart, &$total, 'products'));
if ($limitstart >= $total) {
$limitstart = 0;
}
$rows = $product->getAllProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
addLinkToProducts($rows, 0, 1);
foreach ($jshopConfig->sorting_products_name_s_select as $key => $value) {
$sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value');
}
insertValueInArray($products_page, $jshopConfig->count_product_select);
//insert products_page count
foreach ($jshopConfig->count_product_select as $key => $value) {
$product_count[] = JHTML::_('select.option', $key, $value, 'count_id', 'count_value');
}
$sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'sort_id', 'sort_value', $order);
$product_count_sel = JHTML::_('select.genericlist', $product_count, 'limit', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'count_id', 'count_value', $limit);
$_review = JTable::getInstance('review', 'jshop');
$allow_review = $_review->getAllowReview();
if ($jshopConfig->show_product_list_filters) {
$first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'manufacturer_id', 'name');
$_manufacturers = JTable::getInstance('manufacturer', 'jshop');
if ($jshopConfig->manufacturer_sorting == 2) {
$morder = 'name';
} else {
$morder = 'ordering';
}
$listmanufacturers = $_manufacturers->getList();
array_unshift($listmanufacturers, $first_el);
if (isset($filters['manufacturers'][0])) {
$active_manufacturer = $filters['manufacturers'][0];
} else {
$active_manufacturer = '';
}
$manufacuturers_sel = JHTML::_('select.genericlist', $listmanufacturers, 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'manufacturer_id', 'name', $active_manufacturer);
$first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'category_id', 'name');
$categories = buildTreeCategory(1);
array_unshift($categories, $first_el);
if (isset($filters['categorys'][0])) {
$active_category = $filters['categorys'][0];
} else {
$active_category = 0;
}
$categorys_sel = JHTML::_('select.genericlist', $categories, 'categorys[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'category_id', 'name', $active_category);
} else {
$manufacuturers_sel = '';
$categorys_sel = '';
}
$display_list_products = count($rows) > 0 || willBeUseFilter($filters);
$dispatcher->trigger('onBeforeDisplayProductList', array(&$rows));
$view_name = "products";
$view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
$view->setLayout("products");
$view->assign('config', $jshopConfig);
$view->assign('template_block_list_product', "list_products/list_products.php");
$view->assign('template_block_form_filter', "list_products/form_filters.php");
$view->assign('template_block_pagination', "list_products/block_pagination.php");
$view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
$view->assign('filter_show', 1);
//.........这里部分代码省略.........
示例15: view
function view()
{
$mainframe = JFactory::getApplication();
$db = JFactory::getDBO();
$user = JFactory::getUser();
$jshopConfig = JSFactory::getConfig();
$session = JFactory::getSession();
$session->set("jshop_end_page_buy_product", $_SERVER['REQUEST_URI']);
$session->set("jshop_end_page_list_product", $_SERVER['REQUEST_URI']);
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadProductList', array());
$category_id = JRequest::getInt('category_id');
$category = JSFactory::getTable('category', 'jshop');
$category->load($category_id);
$category->getDescription();
$dispatcher->trigger('onAfterLoadCategory', array(&$category, &$user));
if (!$category->category_id || $category->category_publish == 0 || !in_array($category->access, $user->getAuthorisedViewLevels())) {
JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
return;
}
$manufacturer_id = JRequest::getInt('manufacturer_id');
$label_id = JRequest::getInt('label_id');
$vendor_id = JRequest::getInt('vendor_id');
$view_name = "category";
$view_config = array("template_path" => $jshopConfig->template_path . $jshopConfig->template . "/" . $view_name);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
if ($category->category_template == "") {
$category->category_template = "default";
}
$view->setLayout("category_" . $category->category_template);
$jshopConfig->count_products_to_page = $category->products_page;
$context = "jshoping.list.front.product";
$contextfilter = "jshoping.list.front.product.cat." . $category_id;
$orderby = $mainframe->getUserStateFromRequest($context . 'orderby', 'orderby', $jshopConfig->product_sorting_direction, 'int');
$order = $mainframe->getUserStateFromRequest($context . 'order', 'order', $jshopConfig->product_sorting, 'int');
$limit = $mainframe->getUserStateFromRequest($context . 'limit', 'limit', $category->products_page, 'int');
if (!$limit) {
$limit = $category->products_page;
}
$limitstart = JRequest::getInt('limitstart');
$orderbyq = getQuerySortDirection($order, $orderby);
$image_sort_dir = getImgSortDirection($order, $orderby);
$field_order = $jshopConfig->sorting_products_field_select[$order];
$filters = getBuildFilterListProduct($contextfilter, array("categorys"));
if (getShopMainPageItemid() == JRequest::getInt('Itemid')) {
appendExtendPathWay($category->getTreeChild(), 'category');
}
$orderfield = $jshopConfig->category_sorting == 1 ? "ordering" : "name";
$sub_categories = $category->getChildCategories($orderfield, 'asc', $publish = 1);
$dispatcher->trigger('onBeforeDisplayCategory', array(&$category, &$sub_categories));
if ($category->meta_title == "") {
$category->meta_title = $category->name;
}
setMetaData($category->meta_title, $category->meta_keyword, $category->meta_description);
$total = $category->getCountProducts($filters);
$action = xhtmlUrl($_SERVER['REQUEST_URI']);
$dispatcher->trigger('onBeforeFixLimitstartDisplayProductList', array(&$limitstart, &$total, 'category'));
if ($limitstart >= $total) {
$limitstart = 0;
}
$products = $category->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
addLinkToProducts($products, $category_id);
jimport('joomla.html.pagination');
$pagination = new JPagination($total, $limitstart, $limit);
$pagenav = $pagination->getPagesLinks();
foreach ($jshopConfig->sorting_products_name_select as $key => $value) {
$sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value');
}
insertValueInArray($category->products_page, $jshopConfig->count_product_select);
//insert category count
foreach ($jshopConfig->count_product_select as $key => $value) {
$product_count[] = JHTML::_('select.option', $key, $value, 'count_id', 'count_value');
}
$sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'sort_id', 'sort_value', $order);
$product_count_sel = JHTML::_('select.genericlist', $product_count, 'limit', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'count_id', 'count_value', $limit);
$_review = JSFactory::getTable('review', 'jshop');
$allow_review = $_review->getAllowReview();
if (!$category->category_ordertype) {
$category->category_ordertype = 1;
}
$manufacuturers_sel = '';
if ($jshopConfig->show_product_list_filters) {
$filter_manufactures = $category->getManufacturers();
$first_manufacturer = array();
$first_manufacturer[] = JHTML::_('select.option', 0, _JSHOP_ALL, 'id', 'name');
$manufacuturers_sel = JHTML::_('select.genericlist', array_merge($first_manufacturer, $filter_manufactures), 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'id', 'name', $filters['manufacturers'][0]);
}
if ($jshopConfig->use_plugin_content) {
changeDataUsePluginContent($category, "category");
}
$willBeUseFilter = willBeUseFilter($filters);
$display_list_products = count($products) > 0 || $willBeUseFilter;
$dispatcher->trigger('onBeforeDisplayProductList', array(&$products));
$view->assign('config', $jshopConfig);
$view->assign('template_block_list_product', "list_products/list_products.php");
$view->assign('template_no_list_product', "list_products/no_products.php");
$view->assign('template_block_form_filter', "list_products/form_filters.php");
$view->assign('template_block_pagination', "list_products/block_pagination.php");
$view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
$view->assign('filter_show', 1);
//.........这里部分代码省略.........