ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Pagination search value lost

flyboeing 14 Jan, 2015
Hi all,

I have a custom chronoform for searching my database. I am using CC for showing all the data and there the pagination is working. I encouter a pagination problem when using my searchengine.
When showing the results, on the first page everething is okay. Using the debugger I got the following:
db_multi_record_loader ◾ SELECT `movements_ewas`.* FROM `movements_ewas` AS `movements_ewas` WHERE year LIKE '%2011%' LIMIT 0,20 

But when I go to the next page of my results I get the following thing:
db_multi_record_loader ◾ SELECT `movements_ewas`.* FROM `movements_ewas` AS `movements_ewas` WHERE LIMIT 0,20 

I think the problem is that the WHERE-value is lost when switching pages.

I am using a template override for the pagination.php.
This is my pagination.php
<?php
defined('_JEXEC') or die('Restricted access');

/**
 * This is a file to add template specific chrome to pagination rendering.
 *
 * pagination_list_footer
 * 	Input variable $list is an array with poffsets:
 * 		$list[limit]		: int
 * 		$list[limitstart]	: int
 * 		$list[total]		: int
 * 		$list[limitfield]	: string
 * 		$list[pagescounter]	: string
 * 		$list[pageslinks]	: string
 *
 * pagination_list_render
 * 	Input variable $list is an array with poffsets:
 * 		$list[all]
 * 			[data]		: string
 * 			[active]	: boolean
 * 		$list[start]
 * 			[data]		: string
 * 			[active]	: boolean
 * 		$list[previous]
 * 			[data]		: string
 * 			[active]	: boolean
 * 		$list[next]
 * 			[data]		: string
 * 			[active]	: boolean
 * 		$list[end]
 * 			[data]		: string
 * 			[active]	: boolean
 * 		$list[pages]
 * 			[{PAGE}][data]		: string
 * 			[{PAGE}][active]	: boolean
 *
 * pagination_item_active
 * 	Input variable $item is an object with fields:
 * 		$item->base	: integer
 * 		$item->link	: string
 * 		$item->text	: string
 *
 * pagination_item_inactive
 * 	Input variable $item is an object with fields:
 * 		$item->base	: integer
 * 		$item->link	: string
 * 		$item->text	: string
 *
 * This gives template designers ultimate control over how pagination is rendered.
 *
 * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
 */

function pagination_list_footer($list)
{
	$html = "<del class=\"container\"><div class=\"pagination\">\n";

	$html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
	$html .= $list['pageslinks'];
	$html .= "\n<div class=\"limit\">".$list['pagescounter']."</div>";

	$html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
	$html .= "\n</div></del>";

	return $html;
}

function pagination_list_render($list)
{
	$html = '';

	if ($list['start']['active'])
		$html .= '<div class="pag_button">'.$list['start']['data'].'</div>';
	else
		$html .= '<div class="pag_button poff">'.$list['start']['data'].'</div>';
	
	if ($list['previous']['active'])
		$html .= '<div class="pag_button">'.$list['previous']['data'].'</div>';
	else
		$html .= '<div class="pag_button poff">'.$list['previous']['data'].'</div>';

	$html .= '<div class="pag_button plist">';
	foreach($list['pages'] as $page)
		$html .= $page['data'];
	$html .= '</div>';

	if ($list['next']['active'])
		$html .= '<div class="pag_button">'.$list['next']['data'].'</div>';
	else
		$html .= '<div class="pag_button poff">'.$list['next']['data'].'</div>';

	if ($list['end']['active'])
		$html .= '<div class="pag_button">'.$list['end']['data'].'</div>';
	else
		$html .= '<div class="pag_button poff">'.$list['end']['data'].'</div>';

	return $html;
}

function pagination_item_active(&$item)
{
	return '<a href="'.$item->link.'">'.$item->text.'</a>';
}

function pagination_item_inactive(&$item)
{
	return "<span>".$item->text."</span>";
}
?>

Is there someone who can help me with this?

Regards,
Ruud
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com