...

View Full Version : Why Is This Not Working Probably Please?



Byronwells
01-15-2010, 02:24 AM
Alright guys

I have this membership script that uses the following code to generate another page when a certain limit of products have been added to one page.. That limit is set to 10 on the original script..

Please see this website http://www.ultimateresalegiveaway.com/marketplace.php?cat=t&category=1

If you click on page 2 it changes to another page but nothing is displayed.. Is there something wrong with the code please?

This is the code for that particular section...



########## pagination ###########
$q = "select count(*) as cnt from ".$prefix."products $cond";
$r = $db->get_a_line($q);
$count = $r[cnt];
if($count == "0")
{
$warning = "No Results Found";
}
$records=5;
$links="marketplace.php?cat=t&search_txt=$search_txt&";
if($page=="")
{
$page=1;
}
$start=($page-1)*$records;
$Content=$common->print_page_break3($db,$Content,$count,$records,$links,$page);
########## pagination ###########

$ChangeColor = 1;
$ToReplace = "";
$GetProduct = $db->get_rsltset("select * from ".$prefix."products $cond order by id asc limit $start, $records");
for($i = 0; $i < count($GetProduct); $i++)
{
$bgcolor = "#FFFFFF";
@extract($GetProduct[$i]);
if($period3_interval == "D"){$interval = "Day(s)";}
if($period3_interval == "W"){$interval = "Week(s)";}
if($period3_interval == "M"){$interval = "Month(s)";}
if($period3_interval == "Y"){$interval = "Year(s)";}

if($subscription_active == "1")
{
$salesprice = $amount3." every ".$period3_value." ".$interval;
}
else
{
$salesprice = $price;
}
$prod_image ='<img src="images/'.$imageurl.'" border="0">';
$salespage_link='<a href="prods.php?pid='.$id.'">Click Here For More Information</a>';
$ToReplace .= preg_replace($Ptn,"$$1",$SelectedContent);
}
}

$Content = preg_replace($Pat,$ToReplace,$Content);
$Content = preg_replace("/{{(.*?)}}/e", "$$1", $Content);
echo $Content;
include_once ("footer.php");
?>

Len Whistler
01-15-2010, 03:02 AM
The $page variable has to be updated with the value from $_GET['catagory']; I like to use the code snippet below to set the page number.




if(!isset($_GET['catagory'])){
$page = 1;
} else {
$page = $_GET['catagory'];
}

$start=($page-1)*$records;


Try replacing the code below, with the code above.


if($page=="")
{
$page=1;
}
$start=($page-1)*$records;



-------------

JAY6390
01-15-2010, 03:13 AM
Or the shorthand code which is

$page = isset($_GET['category']) ? $_GET['category'] : 1;
$start = ($page - 1) * $records;

Byronwells
01-15-2010, 07:38 PM
The $page variable has to be updated with the value from $_GET['catagory']; I like to use the code snippet below to set the page number.




if(!isset($_GET['catagory'])){
$page = 1;
} else {
$page = $_GET['catagory'];
}

$start=($page-1)*$records;


Try replacing the code below, with the code above.


if($page=="")
{
$page=1;
}
$start=($page-1)*$records;



-------------

I must be blind.. I cant see the snippet code in the above code supplied..

Len Whistler
01-15-2010, 08:09 PM
I must be blind.. I cant see the snippet code in the above code supplied..



########## pagination ###########
$q = "select count(*) as cnt from ".$prefix."products $cond";
$r = $db->get_a_line($q);
$count = $r[cnt];
if($count == "0")
{
$warning = "No Results Found";
}
$records=5;
$links="marketplace.php?cat=t&search_txt=$search_txt&";
if($page=="")
{
$page=1;
}
$start=($page-1)*$records;

Byronwells
01-16-2010, 01:26 AM
########## pagination ###########
$q = "select count(*) as cnt from ".$prefix."products $cond";
$r = $db->get_a_line($q);
$count = $r[cnt];
if($count == "0")
{
$warning = "No Results Found";
}
$records=5;
$links="marketplace.php?cat=t&search_txt=$search_txt&";
if($page=="")
{
$page=1;
}
$start=($page-1)*$records;


Len

Thank you for your help trying to sort this issue out :) :) I have sort of sorted it.. I do have another question..... :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum