当前位置: 首页>>代码示例>>PHP>>正文


PHP JPagination::getPagesCounter方法代码示例

本文整理汇总了PHP中JPagination::getPagesCounter方法的典型用法代码示例。如果您正苦于以下问题:PHP JPagination::getPagesCounter方法的具体用法?PHP JPagination::getPagesCounter怎么用?PHP JPagination::getPagesCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JPagination的用法示例。


在下文中一共展示了JPagination::getPagesCounter方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: JPagination

 function _displaylist($tpl = null)
 {
     $document = JFactory::getDocument();
     $this->assignRef('rules', $this->rules);
     $pagination = new JPagination($this->total, $this->limitstart, $this->limit);
     $document->setTitle($document->getTitle() . ' - ' . $pagination->getPagesCounter());
     $this->assignRef('pagination', $pagination);
     $this->assignRef('params', $this->params);
     parent::display($tpl);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:10,代码来源:view.html.php

示例2: onContentPrepare

 /**
  * Plugin that adds a pagebreak into the text and truncates text at that point
  *
  * @param   string   $context  The context of the content being passed to the plugin.
  * @param   object   &$row     The article object.  Note $article->text is also available
  * @param   mixed    &$params  The article params
  * @param   integer  $page     The 'page' number
  *
  * @return  mixed  Always returns void or true
  *
  * @since   1.6
  */
 public function onContentPrepare($context, &$row, &$params, $page = 0)
 {
     $canProceed = $context == 'com_content.article';
     if (!$canProceed) {
         return;
     }
     $style = $this->params->get('style', 'pages');
     // Expression to search for.
     $regex = '#<hr(.*)class="system-pagebreak"(.*)\\/>#iU';
     $input = JFactory::getApplication()->input;
     $print = $input->getBool('print');
     $showall = $input->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;
     }
     $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) {
//.........这里部分代码省略.........
开发者ID:educakanchay,项目名称:kanchay,代码行数:101,代码来源:pagebreak.php

示例3:

            </tr>

        <?php 
}
?>

        <tr>
            <td colspan = "6" class = "<?php 
echo $boardclass;
?>
profile-bottomnav  fbm " align="center">

                <?php 
// TODO: fxstein - Need to perform SEO cleanup
echo $pageNav->getPagesLinks("index.php?option=com_kunena&amp;func=fbprofile&amp;task=showprf&amp;userid={$userid}" . KUNENA_COMPONENT_ITEMID_SUFFIX);
echo $pageNav->getLimitBox("index.php?option=com_kunena&amp;func=fbprofile&amp;task=showprf&amp;userid={$userid}" . KUNENA_COMPONENT_ITEMID_SUFFIX);
?>
                <br/>
<?php 
echo $pageNav->getPagesCounter();
?>
            </td>
        </tr>
    </tbody>
</table>
</div>
</div>
</div>
</div>
</div>
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:30,代码来源:forummsg.php

示例4: testGetPagesCounter

 /**
  * Tests the getPagesCounter method.
  *
  * @param   integer  $total       The total number of items.
  * @param   integer  $limitstart  The offset of the item to start at.
  * @param   integer  $limit       The number of items to display per page.
  * @param   array    $expected    The expected results for the JPagination object
  *
  * @return  void
  *
  * @covers        JPagination::getPagesCounter
  * @dataProvider  dataTestGetPagesCounter
  * @since  3.2
  */
 public function testGetPagesCounter($total, $limitstart, $limit, $expected)
 {
     $pagination = new JPagination($total, $limitstart, $limit, '', $this->app);
     $this->assertEquals($pagination->getPagesCounter(), $expected);
     unset($pagination);
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:20,代码来源:JPaginationTest.php

示例5: plgContentPagebreak

/**
* Page break plugin
*
* <b>Usage:</b>
* <code><hr class="system-pagebreak" /></code>
* <code><hr class="system-pagebreak" title="The page title" /></code>
* or
* <code><hr class="system-pagebreak" alt="The first page" /></code>
* or
* <code><hr class="system-pagebreak" title="The page title" alt="The first page" /></code>
* or
* <code><hr class="system-pagebreak" alt="The first page" title="The page title" /></code>
*
*/
function plgContentPagebreak(&$row, &$params, $page = 0)
{
    // expression to search for
    $regex = '#<hr([^>]*?)class=(\\"|\')system-pagebreak(\\"|\')([^>]*?)\\/*>#iU';
    // Get Plugin info
    $plugin =& JPluginHelper::getPlugin('content', 'pagebreak');
    $pluginParams = new JParameter($plugin->params);
    $print = JRequest::getBool('print');
    $showall = JRequest::getBool('showall');
    JPlugin::loadLanguage('plg_content_pagebreak');
    if (!$pluginParams->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 (strpos($row->text, 'class="system-pagebreak') === false && strpos($row->text, 'class=\'system-pagebreak') === false) {
        return true;
    }
    $db =& JFactory::getDBO();
    $view = JRequest::getCmd('view');
    if (!$page) {
        $page = 0;
    }
    // check whether plugin has been unpublished
    if (!JPluginHelper::isEnabled('content', 'pagebreak') || $params->get('intro_only') || $params->get('popup') || $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 && $pluginParams->get('showall', 1)) {
        $hasToc = $pluginParams->get('multipage_toc', 1);
        if ($hasToc) {
            // display TOC
            $page = 1;
            plgContentCreateTOC($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) {
        // Get plugin parameters
        $pluginParams = new JParameter($plugin->params);
        $title = $pluginParams->get('title', 1);
        $hasToc = $pluginParams->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][0]);
                    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) {
            plgContentCreateTOC($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];
//.........这里部分代码省略.........
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:101,代码来源:pagebreak.php

示例6: 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>';
//.........这里部分代码省略.........
开发者ID:reechalee,项目名称:joomla1.6,代码行数:101,代码来源:pagebreak.php

示例7: show_listing


//.........这里部分代码省略.........
                ?>
</span><?php 
            }
            ?>
			<?php 
            if ($emailthis) {
                ?>
 | <span class="small"><?php 
                echo $emailthis;
                ?>
</span><?php 
            }
            ?>
			<?php 
            if ($report) {
                ?>
 | <span class="small"><?php 
                echo $report;
                ?>
</span><?php 
            }
            ?>
			
			<?php 
            if ($readmore) {
                ?>
 | <span class="small"><?php 
                echo $readmore;
                ?>
</span><?php 
            }
            ?>
			<?php 
            if ($googlemaps) {
                ?>
 | <span class="small"><?php 
                echo $googlemaps;
                ?>
</span><?php 
            }
            ?>
			</div>
			</div><!-- END DIV ARTICLE -->
			</td>
			<?php 
            if ($params->get('list_showimage') && $linkimgsrc != '') {
                if ($ac_alignimage == 1 && $ac_k == 'none' || $ac_alignimage == '2' && $ac_k == 1) {
                    ?>
				<td valign="top" width="<?php 
                    echo $params->get('list_widthimage');
                    ?>
px">
				<!-- STARTING DIV IMAGE RIGHT -->
				<div class="_imageright"><?php 
                    echo $linkimgsrc;
                    ?>
</div>				
				<!-- END DIV IMAGE RIGHT -->
				</td>
				<?php 
                }
            }
            ?>
			</tr></table></div><!-- END DIV CONTAINER -->
			<div class="_separate"></div>
			<?php 
            // END LAYOUT HTML
            // using 2 columns
            if ($ac_numcolumnslisting && $ac_m == '1') {
                echo "\n</td>\n";
            }
            if ($ac_numcolumnslisting && $ac_m == '1' && $i == count($listing) - 1) {
                echo "\n<td width=\"50%\" valign=\"top\">&nbsp;";
            }
            if ($ac_numcolumnslisting && $ac_m == '2' || $ac_numcolumnslisting && $ac_m == '1' && $i == count($listing) - 1) {
                echo "\n</td></tr></table>\n";
            }
            $line++;
            if ($ac_alignimage == '2') {
                $ac_k = 1 - $ac_k;
            }
        } else {
            if ($i > 0) {
                $i = $i - 1;
            }
        }
    }
    ?>
	
	<?php 
    if (count($listing) && @$listing[0]->id != '') {
        if (!($options['section'] == '' && ($options['letter'] != '' || $options['search'] != '') && ($params->get('weblinkssection') || $params->get('contactsection')))) {
            echo "<div id=\"alphapagination\"><p>";
            echo $pagination->getPagesLinks();
            echo "<br />";
            echo $pagination->getPagesCounter();
            echo "</p></div>";
        }
    }
}
开发者ID:rsemedo,项目名称:Apply-Within,代码行数:101,代码来源:default.php

示例8: 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 
}
开发者ID:hfmprs,项目名称:JoomLeague,代码行数:30,代码来源:default_stats.php

示例9: _pagination

 /** function that will create pagination for views
  * @param object $setLimit
  * total - total number of rows
  * start - number or index to start e.g 0 ( will start from 0 - limit )
  * value - ending number or limit e.g 20 ( will only show 20 rows )
  * @return $display
  */
 private static function _pagination($setLimit, $onlyBox = false, $showTotal = false)
 {
     jimport('joomla.html.pagination');
     $total = $setLimit->total;
     $start = $setLimit->start;
     $value = $setLimit->end;
     $pagination = new JPagination($total, $start, $value);
     //alex pagination
     $pagination->setAdditionalUrlParam('limit', JRequest::getVar('limit'));
     if (version_compare(JVERSION, '3.0.0', '<')) {
         if ($onlyBox) {
             $display = "<div class=\"list-footer\">\n";
             $display .= "\n<div class=\"limit\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . JText::_('Display Num') . ' ' . $pagination->getLimitBox() . "</div>";
             $display .= "\n<div class=\"counter\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . $pagination->getPagesCounter() . "</div>";
             if ($showTotal) {
                 $display .= "\n<div class=\"outof\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . JText::_('Total Result:') . ' <span style="font-weight: bold; text-decoration: underlined;">' . $total . "</span></div>";
             }
             $display .= "\n</div>";
         } else {
             $display = $pagination->getListFooter();
         }
     } else {
         $display = '<div style="display:inline; font-size:14px;">';
         $display .= '<div class="jnews_pagination_one" style="float:right; margin-left:15px;">';
         $display .= $pagination->getLimitBox();
         $display .= '</div>';
         $pagi = $pagination->getListFooter();
         if (!empty($pagi)) {
             $display .= '<div class="jnews_pagination" style="float:right; margin-left:15px;">';
             $display .= $pagi;
             $display .= '</div>';
         }
         $pagi = $pagination->getPagesCounter();
         if (!empty($pagi)) {
             $display .= '<div style="float:right;padding-top: 4px;">';
             $display .= $pagi;
             $display .= '</div>';
         }
         $display .= '</div>';
     }
     return $display;
 }
开发者ID:naka211,项目名称:kkvn,代码行数:49,代码来源:class.jnews.php

示例10: viewCategory

function viewCategory()
{
    $app = JFactory::getApplication('site');
    $db = JFactory::getDBO();
    $user = JFactory::getUser();
    $groups = implode(',', $user->getAuthorisedViewLevels());
    $document = JFactory::getDocument();
    $filter_order = $app->getUserStateFromRequest('com_datsogallery.filter_order', 'filter_order', 'a.ordering', 'cmd');
    $filter_order_Dir = $app->getUserStateFromRequest('com_datsogallery.filter_order_Dir', 'filter_order_Dir', '', 'word');
    $catid = JRequest::getVar('catid', 0, '', 'int');
    $menu = JSite::getMenu();
    $ids = $menu->getItems('link', 'index.php?option=com_datsogallery&view=datsogallery');
    $itemid = isset($ids[0]) ? '&Itemid=' . $ids[0]->id : '';
    $is_editor = strtolower($user->usertype) == 'editor' || strtolower($user->usertype) == 'administrator' || strtolower($user->usertype) == 'super administrator';
    GalleryHeader();
    $db->setQuery("select count(*) from #__datsogallery_catg where cid = " . $catid . " AND access IN (" . $groups . ")");
    $is_allowed = $db->loadResult();
    if (!$is_allowed) {
        $app->redirect(JRoute::_('index.php?option=com_datsogallery' . $itemid, false), JText::_('COM_DATSOGALLERY_NOT_ACCESS_THIS_CATEGORY'), 'notice');
    }
    //echo dgCategories($catid);
    require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php';
    if ($ad_sbcat) {
        $ssa = !$ad_slideshow_auto ? ',onOpen:function(currentImage){Shadowbox.play();Shadowbox.pause();}' : '';
        $document->addStyleSheet(JURI::base(true) . '/components/com_datsogallery/libraries/shadowbox/shadowbox.css');
        $document->addScript(JURI::base(true) . '/components/com_datsogallery/libraries/shadowbox/shadowbox.js');
        $sbinit = 'Shadowbox.init({slideshowDelay:' . $ad_slideshow_delay . $ssa . '});';
        $document->addScriptDeclaration($sbinit);
    }
    $db->setQuery("SELECT COUNT(*)" . " FROM #__datsogallery AS a" . " LEFT JOIN #__datsogallery_catg AS c" . " ON c.cid = a.catid" . " WHERE a.published = 1" . " AND a.catid = " . $catid . " AND a.approved = 1" . " AND c.access IN (" . $groups . ")");
    $count = $db->loadResult();
    if (!in_array($filter_order, array('a.imgcounter', 'a.imgdownloaded', 'a.imgtitle', 'a.imgdate', 'a.ordering'))) {
        $filter_order = 'a.ordering';
    }
    if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
        $filter_order_Dir = $ad_sortby;
    }
    $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
    if ($ad_picincat && $count > 0) {
        echo JText::sprintf('COM_DATSOGALLERY_CATEGORY_IMAGES', $count);
    }
    ?>
        <form method="post" id="adminForm">
        <?php 
    $query = "SELECT count(*) AS count" . " FROM #__datsogallery" . " WHERE catid = " . $catid . " AND published = 1" . " AND approved = 1";
    $db->setQuery($query);
    $row = $db->LoadObject();
    $total = $row->count;
    jimport('joomla.html.pagination');
    $limit = JRequest::getVar('limit', $ad_perpage, '', 'int');
    $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
    $pagination = new JPagination($total, $limitstart, $limit);
    if ($count > $ad_perpage) {
        $page_nav_links = $pagination->getPagesLinks();
        ?>
        <div class="datso_pgn"><?php 
        echo $page_nav_links;
        ?>
</div>
        <div style="clear:both"></div>
        <?php 
    }
    $db->setQuery("SELECT * FROM #__datsogallery_catg WHERE cid = " . $catid);
    $rows = $db->loadObjectList();
    $catname = $rows[0]->name;
    if ($show_grid) {
        echo '<div class="dg_head_background">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', $catname . ' ', 'a.imgtitle', $filter_order_Dir, $filter_order));
        echo '<span class="grid_txt"><div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_ORDER') . ' ', 'a.ordering', $filter_order_Dir, $filter_order)) . '</div>';
        echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_DATE_ADD') . ' ', 'a.imgdate', $filter_order_Dir, $filter_order)) . '</div>';
        echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_HITS') . ' ', 'a.imgcounter', $filter_order_Dir, $filter_order)) . '</div>';
        echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_DOWNLOADS') . ' ', 'a.imgdownloaded', $filter_order_Dir, $filter_order)) . '</div>';
        echo '</span></div>';
    } else {
        echo '<div class="dg_head_background">' . $catname . '</div>';
    }
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"dg_body_background\">\n";
    if ($count > $ad_perpage) {
        $addspace = ' - ';
    } else {
        $addspace = '';
    }
    $pages = $pagination->getPagesCounter();
    $document->setTitle($catname . $addspace . $pages);
    if ($ad_metagen) {
        if ($rows[0]->description) {
            $document->setTitle($catname . $addspace . $pages);
            $document->setDescription(limit_words($rows[0]->description, 25));
            $document->setMetadata('keywords', metaGen($rows[0]->description));
        }
    }
    $query = 'SELECT a.*' . ' FROM #__datsogallery AS a' . ' LEFT JOIN #__datsogallery_catg AS c' . ' ON c.cid = a.catid' . ' WHERE a.published = 1' . ' AND a.catid = ' . $catid . ' AND a.approved = 1' . ' AND c.access IN (' . $groups . ')' . $orderby;
    $db->setQuery($query, $pagination->limitstart, $pagination->limit);
    $rows = $db->loadObjectList();
    $rowcounter = 0;
    if (count($rows) > 0) {
        foreach ($rows as $row1) {
            if ($ad_ncsc) {
                $cw = 100 / $ad_cp . "%";
            }
            if ($rowcounter % $ad_cp == 0) {
//.........这里部分代码省略.........
开发者ID:j0rg3m414,项目名称:centerar,代码行数:101,代码来源:datso.functions.php

示例11: showThumbs

    /**
     * Shows thumbnails for gallery
     */
    function showThumbs()
    {
        global $rsgConfig;
        $my = JFactory::getUser();
        $itemCount = $this->gallery->itemCount();
        $limit = $rsgConfig->get("display_thumbs_maxPerPage");
        $limitstart = rsgInstance::getInt('limitstart');
        //instantiate page navigation
        jimport('joomla.html.pagination');
        $pagenav = new JPagination($itemCount, $limitstart, $limit);
        //MK gaat goed: thumbs in gallery
        // increase the gallery hit counter
        $this->gallery->hit();
        if (!$this->gallery->itemCount()) {
            if ($this->gallery->id) {
                // if gallery is not the root gallery display the message
                echo JText::_('No images in gallery');
            }
            // no items to display, so we can return;
            return;
        }
        //Old rights management. If user is owner or user is Super Administrator, you can edit this gallery
        if ($my->id != 0 and ($this->gallery->uid == $my->id or $my->usertype == 'Super Administrator')) {
            $this->allowEdit = true;
        } else {
            $this->allowEdit = false;
        }
        switch ($rsgConfig->get('display_thumbs_style')) {
            case 'float':
                $this->display('thumbs_float.php');
                break;
            case 'table':
                $this->display('thumbs_table.php');
                break;
        }
        ?>
		<div class="rsg2-pageNav">
				<?php 
        if ($itemCount > $limit) {
            echo $pagenav->getPagesLinks();
            echo "<br /><br />" . $pagenav->getPagesCounter();
        }
        ?>
		</div>
		<?php 
    }
开发者ID:realityking,项目名称:rsgallery2,代码行数:49,代码来源:display.class.php

示例12: onAfterRender


//.........这里部分代码省略.........
                             if (!isset($this->parametri['play'])) {
                                 $this->parametri['play'] = $this->params->get('autoplay');
                             }
                         }
                     }
                 }
                 $this->parametri['path'] = $vb_path;
                 if (!isset($this->parametri['pages']) || $this->parametri['pages'] == 0) {
                     $this->parametri['pages'] = 99999999;
                 }
                 // Create video adapter object for each video
                 $video_objects = array();
                 foreach ($videos as $video) {
                     $video = $this->_getVideo($video);
                     if ($video) {
                         $video_objects[] = $video;
                     }
                 }
                 $videos = $video_objects;
                 $count = count($videos);
                 if ($count) {
                     // Create pagination if needed
                     $start = 0;
                     $pagination = '';
                     if ($count > $this->parametri['pages'] && $this->parametri['pages'] != 0 && $this->parametri['display'] == 0) {
                         if (isset($url2[$co - 1])) {
                             $start = (int) $url2[$co - 1];
                         }
                         $path = '';
                         for ($h = 0; $h < $co - 1; $h++) {
                             if (!isset($url2[$h])) {
                                 $url2[$h] = '';
                             }
                             if ($url2[$h] == '') {
                                 $url2[$h] = '0';
                             }
                             $path .= ',' . $url2[$h];
                         }
                         $after = '';
                         for ($h = $co; $h < count($url2); $h++) {
                             if ($url2[$h] == '') {
                                 $url2[$h] = '0';
                             }
                             $after .= ',' . $url2[$h];
                         }
                         jimport('joomla.html.pagination');
                         $pg = new JPagination($count, $start, $this->parametri['pages']);
                         $pg->prefix = 'vb';
                         $pagination = '<div class="' . $this->parametri['pagination_class'] . ' pagination">';
                         if ($this->parametri['pages_results']) {
                             $pagination .= '<p class="counter">' . $pg->getPagesCounter() . '</p>';
                         }
                         $pagination .= $pg->getPagesLinks() . '</div>';
                         $pagination = str_replace(array('vblimitstart=,', ',,'), array('vblimitstart=', ','), preg_replace('/vblimitstart=(\\d+)/', 'vblimitstart=' . $path . ',$1' . $after, $pagination));
                     }
                     // Create the appropriate display method code
                     $thumbnails = '';
                     if ($count == 1) {
                         if ($this->parametri['display'] == 2) {
                             $thumbnails .= $this->_videoBox($videos[0], $co);
                         } elseif ($this->parametri['display'] == 1) {
                             $thumbnails .= $this->_videoLink($videos[0], $co);
                         } else {
                             $thumbnails .= $this->_videoCode($videos[0]);
                         }
                     } elseif ($count > 1) {
                         if ($this->parametri['display'] == 1) {
                             foreach ($videos as $n => $video) {
                                 if ($n < $count - 1) {
                                     $thumbnails .= $this->_videoLink($video, $co, $this->parametri['separator']);
                                 } else {
                                     $thumbnails .= $this->_videoLink($video, $co);
                                 }
                             }
                         } else {
                             $thumbnails .= '<div style="' . $this->parametri['style'];
                             if ($this->parametri['break'] != 0) {
                                 $thumbnails .= ' max-width: ' . (($this->parametri['t_width'] + 30) * $this->parametri['break'] - 20) . 'px;';
                             }
                             $thumbnails .= '" class="vb_gallery_frame ' . $this->parametri['class'] . '"><ul class="vb_video" rel="vbResponsiveRow" elementWidth="' . ($this->parametri['t_width'] + 30) . '">';
                             for ($n = $start; $n < $start + $this->parametri['pages']; $n++) {
                                 if (isset($videos[$n])) {
                                     $thumbnails .= $this->_videoThumb($videos[$n], $co);
                                 } else {
                                     break;
                                 }
                             }
                             $thumbnails .= '</ul></div>';
                         }
                     }
                     // Insert the code into the content
                     $buffer = preg_replace($regex, str_replace('&', '&amp;', $thumbnails) . $pagination, $buffer, 1);
                 }
             }
         }
         $pageload = str_replace($old_buffer, $buffer, $pageload);
         JResponse::setBody($pageload);
         return true;
     }
 }
开发者ID:01J,项目名称:bealtine,代码行数:101,代码来源:videobox.php


注:本文中的JPagination::getPagesCounter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。