简体   繁体   中英

Joomla Infinite Scrolling mysql pagination issues

I have set up infinite scrolling on a Joomla based website to load db results from mysql query. It works fine but when I have it set up to load 10 results at a time, it skips results 11-20 and then loads the rest of the values, and likewise when I set up to show 20 results it loads the first 40 without any repeats, and then proceeds to load 10 previouss results and 10 new ones for each new pagination result until it reaches the end of the list. Here is the code I have for pagination,

//
jimport('joomla.html.pagination');
// prepare the pagination values
$total = $this->xyz->getTotal('posts',' and cat_id = ' . $cat->cat_id);
$limit = $mainframe->getUserStateFromRequest('global.list.limit','limit', $mainframe->getCfg('list_limit'));
$limitstart = $mainframe->getUserStateFromRequest(JRequest::getVar('option').'limitstart','limitstart', 0);
$this->items = $this->xyz->categoryItems(JRequest::getInt('cat_id'),$limitstart,$limit);
// create the pagination object
$_pagination = new JPagination($total, $limitstart,$limit);
$_pagination_footer = $_pagination->getListFooter();
//

I should mention that I set the $limit value to 10 on line 7 of the code above to make it load 10 at a time. If it is left as $limit it loads 20 at a time.

Preferably I would like to load 50 at a time without any repeats or omissions but as it is now, I get plenty of repeats when set to 50. I found that setting it to 10 gives me the best results but still skips 11-20.

Any suggestions or thoughts would be greatly appreciated.

在两种不同的情况下也有类似的问题:1)SEF已关闭您可能要调试global.list.limit以检查其加载的值的一致性2)SEF已打开在相同的sef url的重定向库中查找不一致的条目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM