本文整理汇总了PHP中JPagination::getResultsCounter方法的典型用法代码示例。如果您正苦于以下问题:PHP JPagination::getResultsCounter方法的具体用法?PHP JPagination::getResultsCounter怎么用?PHP JPagination::getResultsCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPagination
的用法示例。
在下文中一共展示了JPagination::getResultsCounter方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: array
//.........这里部分代码省略.........
for(var i=0; i < document.adminForm.contenttype.length; i++){
if (document.adminForm.contenttype[i].checked){ tag += document.adminForm.contenttype[i].value; }
}
tag += '}';
setTag(tag);
insertTag();
}
//-->
</script>
<table>
<tr>
<td width="100%">
<?php
echo JText::_('JOOMEXT_FILTER');
?>
:
<input type="text" name="search" id="acymailingsearch" value="<?php
echo $pageInfo->search;
?>
" class="text_area" onchange="document.adminForm.submit();" />
<button class="btn" onclick="this.form.submit();"><?php
echo JText::_('JOOMEXT_GO');
?>
</button>
<button class="btn" onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php
echo JText::_('JOOMEXT_RESET');
?>
</button>
</td>
</tr>
</table>
<?php
?>
<table class="adminlist table table-striped" cellpadding="1" width="100%">
<thead>
<tr>
<th class="title"><?php
echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'a.pack_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title titleid"><?php
echo JHTML::_('grid.sort', JText::_('ID'), 'a.pack_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $a = count($rows); $i < $a; $i++) {
$row =& $rows[$i];
?>
<tr id="content<?php
echo $row->pack_id;
?>
" class="row<?php
echo $k;
?>
" onclick="updateTagProd(<?php
echo $row->pack_id;
?>
);" style="cursor:pointer;">
<td><?php
echo $row->pack_name;
?>
</td>
<td align="center"><?php
echo $row->pack_id;
?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php
echo $pageInfo->filter->order->value;
?>
" />
<input type="hidden" name="filter_order_Dir" value="<?php
echo $pageInfo->filter->order->dir;
?>
" />
<?php
}
示例3: acymailingtagcontent_show
//.........这里部分代码省略.........
<?php
echo JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_(ACYMAILING_J16 ? 'COM_CONTENT_PUBLISHED_DATE' : 'START PUBLISHING'), 'a.publish_up', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title titleid">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="6">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $a = count($rows); $i < $a; $i++) {
$row =& $rows[$i];
?>
<tr id="content<?php
echo $row->id;
?>
" class="<?php
echo "row{$k}";
?>
" onclick="applyContent(<?php
echo $row->id . ",'row{$k}'";
?>
);" style="cursor:pointer;">
<td class="acytdcheckbox"></td>
<td>
<?php
$text = '<b>' . JText::_('JOOMEXT_ALIAS') . ': </b>' . $row->alias;
echo acymailing_tooltip($text, $row->title, '', $row->title);
?>
</td>
<td>
<?php
if (!empty($row->name)) {
$text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
$text .= '<br /><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
示例4: productDisplay
//.........这里部分代码省略.........
<tr>
<th class="title titlenum">
<?php
echo JText::_('HIKA_NUM');
?>
</th>
<th class="title titlebox">
<input type="checkbox" name="checkAll" id="checkAll" value="" onclick="checkAllBox();"/>
</th>
<th class="title">
<?php
echo JText::_('HIKA_NAME');
?>
</th>
<th class="title">
<?php
echo JText::_('PRODUCT_PRICE');
?>
</th>
<th class="title">
<?php
echo JText::_('PRODUCT_QUANTITY');
?>
</th>
<th class="title">
<?php
echo 'ID';
?>
</th>
</tr>
</thead>
<tbody id="ToCheck">
<?php
$i = 0;
$row = '';
$currencyClass = hikashop_get('class.currency');
$currencies = new stdClass();
$currency_symbol = '';
foreach ($products as $product) {
$i++;
$row .= '<tr><td class="title titlenum">';
$row .= $i;
$row .= '</td><td class="title titlebox"><input type="checkbox" id="product_checkbox' . $product->product_id . '" name="' . $product->product_id;
$row .= '" value=""/></td><td class="center">';
$row .= $product->product_name;
$row .= '</td><td class="center">';
foreach ($prices as $price) {
if ($price->price_product_id == $product->product_id) {
$row .= $price->price_value;
$currency = $currencyClass->getCurrencies($price->price_currency_id, $currencies);
foreach ($currency as $currrencie) {
if ($price->price_currency_id == $currrencie->currency_id) {
$currency_symbol = $currrencie->currency_symbol;
}
}
$row .= ' ' . $currency_symbol;
}
}
$row .= '</td><td class="center">';
if ($product->product_quantity > -1) {
$row .= $product->product_quantity;
} else {
$row .= JText::_('UNLIMITED');
}
$row .= '</td><td class="center">';
$row .= $product->product_id;
$row .= '</td></tr>';
}
echo $row;
?>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
</table>
</fieldset>
<input type="hidden" name="product_insert" id="product_insert" value="" />
<button class="btn" onclick="checkSelect(); insertTag(document.getElementById('product_insert').value); window.parent.SqueezeBox.close();"><?php
echo JText::_('HIKA_INSERT');
?>
</button>
<?php
global $Itemid;
?>
<input type="hidden" name="Itemid" value="<?php
echo $Itemid;
?>
"/>
<?php
echo JHTML::_('form.token');
}
示例5: array
//.........这里部分代码省略.........
</tr>
</table>
<table class="adminlist" cellpadding="1" width="100%">
<thead>
<tr>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('NAME'), 'a.product_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('DESCRIPTION'), 'a.product_s_desc', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title titleid">
<?php
echo JHTML::_('grid.sort', JText::_('ID'), 'a.product_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $a = count($rows); $i < $a; $i++) {
$row =& $rows[$i];
?>
<tr id="content<?php
echo $row->product_id;
?>
" class="<?php
echo "row{$k}";
?>
" onclick="updateTag(<?php
echo $row->product_id;
?>
);" style="cursor:pointer;">
<td>
<?php
echo acymailing::tooltip('SKU : ' . $row->product_sku, $row->product_name, '', $row->product_name);
?>
</td>
<td>
<?php
echo $row->product_s_desc;
?>
示例6: array
//.........这里部分代码省略.........
echo JHTML::_('acyselect.radiolist', $priceDisplay, 'pricedisplay', 'size="1"', 'value', 'text', $pageInfo->pricedisplay);
?>
</td>
</tr>
</table>
<table class="adminlist table table-striped" cellpadding="1" width="100%">
<thead>
<tr>
<th></th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'a.product_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('HIKA_DESCRIPTION'), 'a.product_description', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title titleid">
<?php
echo JHTML::_('grid.sort', JText::_('ID'), 'a.product_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $a = count($rows); $i < $a; $i++) {
$row =& $rows[$i];
?>
<tr id="content<?php
echo $row->product_id;
?>
" class="<?php
echo "row{$k}";
?>
" onclick="updateTagProd(<?php
echo $row->product_id;
?>
);" style="cursor:pointer;">
<td class="acytdcheckbox"></td>
<td>
<?php
echo acymailing_tooltip('CODE : ' . $row->product_code, $row->product_name, '', $row->product_name);
?>
</td>
<td>
<?php
echo $row->product_description;
?>
</td>
<td align="center">
示例7: array
//.........这里部分代码省略.........
</table>
<table class="adminlist" cellpadding="1" width="100%">
<thead>
<tr>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
<th class="title titleid">
<?php
echo JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
<?php
echo $pagination->getListFooter();
?>
<?php
echo $pagination->getResultsCounter();
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $a = count($rows); $i < $a; $i++) {
$row =& $rows[$i];
?>
<tr id="content<?php
echo $row->id;
?>
" class="<?php
echo "row{$k}";
?>
" onclick="applyContent(<?php
echo $row->id . ",'row{$k}'";
?>
);" style="cursor:pointer;">
<td>
<?php
$text = '<b>' . JText::_('ALIAS', true) . ': </b>' . $row->alias;
echo acymailing::tooltip($text, $row->title, '', $row->title);
?>
</td>
<td>
<?php
if (!empty($row->name)) {
$text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
$text .= '<br/><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
$text .= '<br/><b>' . JText::_('ACY_ID') . ' : </b>' . $row->created_by;
示例8: floor
function communitysurveys_show()
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$limitstart = $app->getUserStateFromRequest(S_APP_NAME . '.acysurveys.limitstart', 'limitstart', 0, 'int');
$limit = $app->input->getInt('limit', 20);
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$content = '';
$paramBase = S_APP_NAME . '.acysurveys';
$pageInfo = new stdClass();
$pageInfo->filter->order = $pageInfo->filter = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower($pageInfo->search);
$query = '
select
a.id, a.title, a.alias, a.created_by, a.created, u.name, u.username
from
#__survey a
left join
#__users u on a.created_by = u.id
where
a.published = 1
order by
a.created desc';
$db->setQuery($query, $limitstart, $limit);
$surveys = $db->loadObjectList();
if (!empty($surveys)) {
$query = 'select count(*) from #__survey a where a.published = 1';
jimport('joomla.html.pagination');
$db->setQuery($query);
$total = $db->loadResult();
$pagination = new JPagination($total, $limitstart, $limit);
$content = '
<table class="adminlist table table-striped table-hover" cellpadding="1" width="100%">
<thead>
<tr>
<th class="title">' . JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
<th class="title">' . JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
<th class="title">' . JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
<th class="title titleid">' . JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5">' . $pagination->getListFooter() . $pagination->getResultsCounter() . '</td>
</tr>
</tfoot>
<tbody>';
foreach ($surveys as $row) {
$k = 0;
$content .= '<tr><td>';
$text = '<b>' . JText::_('JOOMEXT_ALIAS') . ': </b>' . $row->alias;
$content .= '<a href="#" onclick="setTag(\'{surveyurl:' . $row->id . '}\');insertTag();">' . acymailing_tooltip($text, $row->title, '', $row->title) . '</a>';
$content .= '</td><td>';
$text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
$text .= '<br/><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
$text .= '<br/><b>' . JText::_('ACY_ID') . ' : </b>' . $row->created_by;
$content .= acymailing_tooltip($text, $row->name, '', $row->name);
$content .= '</td>
<td align="center">' . JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC4')) . '</td>
<td align="center">' . $row->id . '</td></tr>';
$k = 1 - $k;
}
$content .= '</tbody></table>
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="" />
<input type="hidden" name="filter_order_Dir" value="" />';
}
echo $content;
}
示例9: show_listing
function show_listing($listing, $url, $params, $searchbox, $searchboxbutton, $lists, $pagination, $options, $lang, $menuid, $categoriesbegenningby)
{
global $mainframe;
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
// show search bar
if ($searchbox) {
$jumpmenulist = "\t\t<!--\n\t\tfunction jumpmenu(target,obj,restore){\n\t\t eval(target+\".location='\"+obj.options[obj.selectedIndex].value+\"'\");\t\t\n\t\t if (restore) obj.selectedIndex=0;\t\t\n\t\t}\t\t\n\t\t//-->";
?>
<?php
$document->addScriptDeclaration($jumpmenulist);
?>
<div id="searchbar">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<form name="adminFormSearchAC" action="" method="post">
<?php
echo $searchbox;
?>
<?php
echo $lists['list_searchfield'];
?>
<?php
echo $searchboxbutton;
?>
</form>
</td>
<td><div class="orderinglist">
<?php
if (count($listing) && @$listing[0]->id != '' && $options['letter'] == '') {
echo $lists['list_defaultordering'];
}
?>
</div></td>
</tr>
</table>
</div>
<?php
}
// If result search letter -> show result categories beginning with this letter
if ($categoriesbegenningby) {
echo "<div id=\"alphapcategoriesbegenningby\"><span class=\"bigletter\">" . $options['letter'] . "</span><span class=\"allcategoriesbeginningby\">" . $categoriesbegenningby . "</span></div>";
}
if (count($listing) > $pagination->limit) {
$newlimit = count($listing);
$pagination = new JPagination($options['total'], $newlimit, $pagination->limitstart);
}
// show Pages Counter
if ($params->get('list_shownumberpagetotal') && (count($listing) && @$listing[0]->id != '')) {
if (!($options['section'] == '' && ($options['letter'] != '' || $options['search'] != '') && ($params->get('weblinkssection') || $params->get('contactsection')))) {
echo "<div id=\"alphapagecounter\"><p>";
echo $pagination->getResultsCounter();
echo "</p></div>";
}
}
$ac_alignimage = $params->get('list_imageposition');
$ac_numcolumnslisting = $params->get('list_numcols');
$ac_k = $ac_alignimage == '2' ? 0 : 'none';
// for alternate image left-right
$line = 0;
// just using for 2 columns
for ($i = 0; $i < count($listing); $i++) {
//for ( $i=0; $i < $new_pagination ; $i++ ){
// prepare each listing
if (@$listing[$i]->id != '') {
// define all vars for listing template
$id_article = $listing[$i]->id;
// id of item article
$num = $params->get('list_numindex') ? $i + 1 + $options['limitstart'] : '';
//num listing
$title = "";
// title of item
$featured = "";
// show "Featured" article on homepage of AlphaContent if this option is selected
$icon_new = "";
// icon new
$icon_hot = "";
// icon hot
$section_category = "";
// section / category
$author = "";
// author or alias author if defined in item
$content = "";
// content intro
$date = "";
// date created
$hits = "";
// num hits
$comments = "";
// num of comments
$rating = "";
// rating bar (native Joomla)
$print = "";
// link to print
$pdf = "";
// link to pdf
$emailthis = "";
//.........这里部分代码省略.........
示例10: myproductslisting
function myproductslisting()
{
$user =& JFactory::getUser();
$userid = $user->id;
$usertype = $user->usertype;
$db =& JFactory::getDBO();
if ($usertype == 'Merchants' && $userid != 0) {
?>
<script type="text/javascript" src="components/com_dealcatalog/js/jquery1.7.js"></script>
<script type="text/javascript" src="components/com_dealcatalog/js/jquery.fancybox.js"></script>
<script type="text/javascript" src="components/com_dealcatalog/css/dealcatalog.css"></script>
<link rel="stylesheet" type="text/css" href="components/com_dealcatalog/js/jquery.fancybox.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox();
});
</script>
<?php
//Company name
$query = "select company_name from #__deal_merchants where user_id='{$userid}'";
$db->setQuery($query);
$company = $db->loadRow();
$company_name = $company[0];
//Pagination
global $mainframe;
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
if ($_REQUEST['limitstart'] == '') {
$limitstart = 0;
}
$query = "select a.product_name,a.product_image1,a.product_thumbimage1,b.id,b.product_id,b.vendor_id,b.stock_in,b.price,b.discount_price,b.listingstart_date,b.listingend_date,b.merchantproduct_image1,b.merchantproduct_thumbimage1,b.is_deal,b.deal_price,b.dealstart_date,b.dealend_date,c.company_name from #__deal_products as a,#__deal_productslisting_deals as b,#__deal_merchants as c where c.user_id='{$userid}' and a.id=b.product_id and b.vendor_id=c.id order by b.id desc";
$db->setQuery($query);
$total = $db->loadResultArray();
$total = count($total);
//Products
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
$query = "select a.product_name,a.product_image1,a.product_thumbimage1,b.id,b.product_id,b.vendor_id,b.stock_in,b.price,b.discount_price,b.listingstart_date,b.listingend_date,b.merchantproduct_image1,b.merchantproduct_thumbimage1,b.is_deal,b.deal_price,b.dealstart_date,b.dealend_date,c.company_name from #__deal_products as a,#__deal_productslisting_deals as b,#__deal_merchants as c where c.user_id='{$userid}' and a.id=b.product_id and b.vendor_id=c.id order by b.id desc";
$db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$product_all = $db->loadObjectList();
?>
<div id="merchant_layout">
<div id="merchant_menu">
<ul>
<li> <a href="index.php?option=com_dealcatalog&task=merchantdefault&Itemid=<?php
echo $_REQUEST['Itemid'];
?>
" > DashBoard </a> </li>
<li> <a href="index.php?option=com_dealcatalog&task=products&Itemid=<?php
echo $_REQUEST['Itemid'];
?>
" > Products </a> </li>
<li> <a href="index.php?option=com_dealcatalog&task=addproductslistingdeals&Itemid=<?php
echo $_REQUEST['Itemid'];
?>
" > Add Products Listing and Deals </a> </li>
<li> <a href="index.php?option=com_dealcatalog&task=myproductslisting&Itemid=<?php
echo $_REQUEST['Itemid'];
?>
" > My Products Usage</a> </li>
<li> <a href="index.php?option=com_dealcatalog&task=coupons&Itemid=<?php
echo $_REQUEST['Itemid'];
?>
" > My Customers Coupons </a> </li>
</ul>
</div>
<div id="myusage">
<div class="welcome">
<?php
echo "Welcome back " . $company_name;
?>
</div>
<div class="lists">
<h2> My Products Listing </h2>
<div id="products_display">
<div id="search_product">
<div class="cat_head"> Showing the Results for "<b> Products Listing and Deals </b>" </div>
<div class="cat_title">
<div class="product_count">Showing the <?php
echo $pageNav->getResultsCounter();
?>
</div>
</div>
<form method="post" name="myproductslisting" id="myproductslisting" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<?php
$k = $limitstart;
for ($i = 0, $n = count($product_all); $i < $n; $i++) {
$row =& $product_all[$i];
$productlist = $row->id;
$product_id = $row->product_id;
$vendor_id = $row->vendor_id;
$product_name = $row->product_name;
$price = $row->price;
$company_name = $row->company_name;
$discount_price = $row->discount_price;
$listenddate = $row->listingend_date;
$pimage = $row->product_image1;
//.........这里部分代码省略.........
示例11: array
function _getNinjaBoardHTML($rows, $row_count, $userId, $nbPlugShowSubject, $nbPlugTruncateSubject, $nbPlugShowMessage, $nbPlugTruncateMessage, $nbPlugShowForum, $nbPlugShowHits, $nbPlugShowCreated, $nbPlugShowModified, $nbPlugDateFormat, $nbPlugShowEdit, $nbPlugSortBy, $nbPlugSortOrder, $nbPlugShowPagination, $nbPlugPaginationCount, $offset, $limit, $itemId, &$params, &$user, &$my)
{
$mainframe =& JFactory::getApplication();
$column_array = array($nbPlugShowSubject, $nbPlugShowMessage, $nbPlugShowForum, $nbPlugShowHits, $nbPlugShowCreated, $nbPlugShowModified, $nbPlugShowEdit);
$columns = array_sum($column_array);
if ($row_count <= 0) {
$html = '<div class="jsNinjaBoard"><div class="jsNBposts"><table><tr><td>You currently have no NinjaBoard posts</td></tr></table></div>';
} else {
//show only selected fields in a table row
$html = '<div class="jsNinjaBoard"><div class="jsNBposts"><table><thead><tr>';
if ($nbPlugShowSubject) {
$html .= '<th>' . JText::_('NB_SUBJECT_JSP') . '</th>';
}
if ($nbPlugShowMessage) {
$html .= '<th>' . JText::_('NB_MESSAGE_JSP') . '</th>';
}
if ($nbPlugShowForum) {
$html .= '<th>' . JText::_('NB_FORUM_JSP') . '</th>';
}
if ($nbPlugShowHits) {
$html .= '<th>' . JText::_('NB_HITS_JSP') . '</th>';
}
if ($nbPlugShowCreated) {
$html .= '<th>' . JText::_('NB_CREATED_JSP') . '</th>';
}
if ($nbPlugShowModified) {
$html .= '<th>' . JText::_('NB_MODIFIED_JSP') . '</th>';
}
if ($nbPlugShowEdit) {
$html .= '<th>' . JText::_('NB_VIEW_POST_JSP') . '</th>';
}
$html .= '</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_JSP');
$item->subject_short = JString::strlen($item->subject_long) > $nbPlugTruncateSubject ? JString::substr($item->subject_long, 0, $subject_max - 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_JSP');
$item->message_short = JString::strlen($item->message_long) > $nbPlugTruncateMessage ? JString::substr($item->message_long, 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_JSP') . '">' . '<img src="' . JURI::base() . 'plugins/community/ninjaboard/post.png" width="32" height="32" alt="' . JText::_('NB_VIEW_POST_JSP') . '" />' . '</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_JSP');
$item->m_datetime = $row->modified > 0 ? date($nbPlugDateFormat, strtotime($row->modified)) : JText::_('NB_NO_DATE_JSP');
//show only selected fields in a table row
$html .= '<tr>';
if ($nbPlugShowSubject) {
$html .= '<td>' . $item->subject . '</td>';
}
if ($nbPlugShowMessage) {
$html .= '<td>' . $item->message . '</td>';
}
if ($nbPlugShowForum) {
$html .= '<td>' . $item->forum_link . '</td>';
}
if ($nbPlugShowHits) {
$html .= '<td>' . $row->hits . '</td>';
}
if ($nbPlugShowCreated) {
$html .= '<td>' . $item->c_datetime . '</td>';
}
if ($nbPlugShowModified) {
$html .= '<td>' . $item->m_datetime . '</td>';
}
if ($nbPlugShowEdit) {
$html .= '<td>' . $item->view_link . '</td>';
}
$html .= '</tr>';
}
$html .= '</tbody></table></div>';
//if(($nbPlugShowPagination)&&($row_count>$limit)){
$html .= '<div class="jsNBpagination"><table><tr><td>';
//$html .= 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);
$html .= $pagination->getPagesLinks() . $pagination->getResultsCounter();
$html .= '</td></tr></table></div>';
//}
$html .= '</div>';
}
return $html;
}
示例12: display
//.........这里部分代码省略.........
$ninjaboard_ShowEdit = $this->params['ninjaboard_ShowEdit'];
$ninjaboard_SortBy = $this->params['ninjaboard_SortBy'];
$ninjaboard_SortOrder = $this->params['ninjaboard_SortOrder'];
$ninjaboard_ShowPagination = $this->params['ninjaboard_ShowPagination'];
$ninjaboard_PaginationCount = $this->params['ninjaboard_PaginationCount'];
$limit = $ninjaboard_PaginationCount > 0 ? $ninjaboard_PaginationCount : 0;
$offset = JRequest::getVar('limitstart', 0, 'REQUEST');
//connect to database
$database =& JFactory::getDBO();
//get current user
$userId = $user->id;
//get user posts
$rows = $this->getPosts($userId, $ninjaboard_SortBy, $ninjaboard_SortOrder, $ninjaboard_PaginationCount, $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="cbeNinjaBoard"><div class="cbeNBposts"><table><tr><td>You currently have no NinjaBoard posts</td></tr></table></div>';
} else {
$list = '<div class="cbeNinjaBoard"><div class="cbeNBposts"><table><thead><tr>';
if ($ninjaboard_ShowSubject) {
$list .= '<th>' . JText::_('Subject') . '</th>';
}
if ($ninjaboard_ShowMessage) {
$list .= '<th>' . JText::_('Message') . '</th>';
}
if ($ninjaboard_ShowForum) {
$list .= '<th>' . JText::_('Forum') . '</th>';
}
if ($ninjaboard_ShowHits) {
$list .= '<th>' . JText::_('Hits') . '</th>';
}
if ($ninjaboard_ShowCreated) {
$list .= '<th>' . JText::_('Created') . '</th>';
}
if ($ninjaboard_ShowModified) {
$list .= '<th>' . JText::_('Modified') . '</th>';
}
if ($ninjaboard_ShowEdit) {
$list .= '<th>' . JText::_('View Post') . '</th>';
}
$list .= '</tr></thead><tbody>';
$items = array();
foreach ($rows as $row) {
//get the item subjec, show no subject if there is none, truncate subject if necessary
$item->subject_long = stripslashes($row->subject) ? stripslashes($row->subject) : JText::_('No Subject');
$item->subject_short = JString::strlen($row->subject) > $ninjaboard_TruncateSubject ? JString::substr($row->subject, 0, $subject_max - 4) . '...' : $item->subject_long;
$item->subject = $ninjaboard_TruncateSubject > 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::_('No Message');
$item->message_short = JString::strlen($row->message) > $ninjaboard_TruncateMessage ? JString::substr($row->message, 0, $ninjaboard_TruncateMessage - 4) . '...' : $item->message_long;
$item->unparsed = $ninjaboard_TruncateMessage > 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::_('View Post') . '">' . '<img src="' . JURI::base() . 'components/com_cbe/enhanced/ninjaboard/post.png" width="32" height="32" alt="View Post" />' . '</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->forumname) . '">' . JText::_($row->forumname) . '</a>';
//format dates
$item->c_datetime = $row->created > 0 ? date($ninjaboard_DateFormat, strtotime($row->created)) : JText::_('No Date');
$item->m_datetime = $row->modified > 0 ? date($ninjaboard_DateFormat, strtotime($row->modified)) : JText::_('No Date');
//show only selected fields in a table row
$list .= '<tr>';
if ($ninjaboard_ShowSubject) {
$list .= '<td>' . $item->subject . '</td>';
}
if ($ninjaboard_ShowMessage) {
$list .= '<td>' . $item->message . '</td>';
}
if ($ninjaboard_ShowForum) {
$list .= '<td>' . $item->forum_link . '</td>';
}
if ($ninjaboard_ShowHits) {
$list .= '<td>' . $row->hits . '</td>';
}
if ($ninjaboard_ShowCreated) {
$list .= '<td>' . $item->c_datetime . '</td>';
}
if ($ninjaboard_ShowModified) {
$list .= '<td>' . $item->m_datetime . '</td>';
}
if ($ninjaboard_ShowEdit) {
$list .= '<td>' . $item->view_link . '</td>';
}
$list .= '</tr>';
}
$list .= '</tbody></table></div>';
if ($ninjaboard_ShowPagination && $row_count > $limit) {
$list .= '<div class="cbeNBpagination"><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>';
}
echo $list;
}