0

Hello everyone,

i met a real big problem and i'll really appreciate if someone can help me on this.
i know there's something wrong in my file but i can't locate this problem.
so the problem is i can't browse pages..for example i have 19 pages when i click on page 2 or three or...till 19 it doesn't browse anything it still on page one.
the file causing that is browse.php

here's the whole file :

<?php
/*
This script handles the browse function creating
a previous and next link if appropriate as well
as creating page numbers to allow the user to link
to a page out of order
*/

// The PREVIOUS page begins at the current offset LESS the number of ROWS per page
$previous_offset = $offset - ROWS;


// The NEXT page begins at the current offset PLUS the number of ROWS per page
$next_offset = $offset + ROWS;


// format query string depending on if
// mod_rewrite is on of off
if (REWRITE_URLS == 1) {
    $browse_script_name = $browse_script_name . "?offset=";
} else {
    $browse_script_name = $browse_script_name . "&offset=";
}


// show the row numbers that are being viewed like this:
// "10 - 15 of 20"
$browse_info = "
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
	<tr>
		<td align=\"center\" valign=\"middle\" style=\"white-space: nowrap; font-weight: bold;\">Showing " . ($offset + 1) . " - " . ($row_counter + $offset) . " of $rows_found Articles</td>
	</tr>
</table>";






// Are there any PREVIOUS Pages?
if ($offset > 0)
{
	// yes, so create a link
	$browse_previous = "
	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
		<tr>
			<td style=\"white-space: nowrap;\"><a class=\"browse\" href=\"$browse_script_name" . $previous_offset . $browse_string . "\">&#171; Previous</a></td>
		</tr>
	</table>";
	
} else {

	// no there is no previous page so dont make a link
	$browse_previous = "
	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
		<tr>
			<td style=\"white-space: nowrap;\">&#171; Previous</td>
		</tr>
	</table>";
	
}// end if ($offset > 0)




// are there any NEXT pages
if ((ROWS != false) && ($rows_found > $next_offset))
{
	// yes so create a link
	$browse_next = "
	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
		<tr>
			<td style=\"white-space: nowrap;\"><a class=\"browse\" href=\"$browse_script_name" . $next_offset . $browse_string . "\">Next &#187;</a></td>
		</tr>
	</table>";
	
} else {

	// no so dont create a link
	$browse_next = "
	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
		<tr>
			<td style=\"white-space: nowrap;\">Next &#187;</td>
		</tr>
	</table>";
	
}// end if (($row != false) && ($rows_found > $next_offset))



// initialize $browse_page
$browse_page = "
<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">
	<tr>
	    <td>";
				
// output page numbers as links
for ($x = 0, $page = 1; $x < $rows_found; $x += ROWS, $page++)
{	 
	// is this the current page?
	if ($x < $offset || $x > ($offset + ROWS - 1))
	{
		// no, so make a link
		$browse_page .= " <a class=\"browse\" href=\"$browse_script_name" . $x . $browse_string . "\">". $page . "</a> ";
			
		
	} else {
	
		// yes, so dont make a link
		$browse_page .= " $page ";
		
		
	}// end if ($x < $offset || $x > ($offset + ROWS - 1))

}// end for ($x = 0, $page = 1; $x < $rows_found; $x += ROWS, $page++)
$browse_page .= "
        </td>
	</tr>
</table>";

?>

Please tell me what's wrong in here?:icon_sad:

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.