A Question For Php Coders.. I just need some clafication please.....
I have this query for you that I just need a little bit of clarification on please..
If you kindly take a look at this page... Untitled Document you will notice that all the categories are display on the left hand side.. And when you click on one it will change and so on, to what ever you look at..
The code for that page is as follows...
<?php
include_once ("header.php");
$cat = $_GET["cat"];
$link = $_GET["category"];
$search = $_GET["search"];
$cat_title = str_replace("_"," ",$link);
if($cat != "t")
{
$GetFile = file("http://www.digitalresellersvault.com...e/template.php");
$Content = join("", $GetFile);
$categories=$common->categories($db);
$content=str_replace("{categories}",$categories,$c ontent);
$Pat = "/<{Begin}>(.*?)<{End}>/s";
preg_match($Pat,$Content,$Output);
$SelectedContent = $Output[1];
$q = "select * from ".$prefix."products where show_product = '1' ORDER BY Rand() LIMIT 1";
$r = $db->get_a_line($q);
$id = $r[id];
$imageurl = $r[imageurl];
$prod_description = $r[prod_description];
$salesprice = $r[price];
$product_name = $r[product_name];
$salespage_link='<a href="prods.php?pid='.$id.'"><img border="0" src="http://www.digitalresellersvault.com...infobutton.jpg" width="104" height="16"></a>';
$prod_image ='<img src="images/'.$imageurl.'" border="0">';
$Content = preg_replace($Pat,$ToReplace,$Content);
$Content = preg_replace("/{ { (.*?) } }/e", "$$1", $Content);
echo $Content;
include_once ("footer.php");
exit();
}
elseif($cat == "t")
{
$search = $_GET["search"];
$link = $_GET["category"];
$cat_title = str_replace("_"," ",$link);
$GetFile = file("http://www.digitalresellersvault.com...e/template.php");
$Content = join("", $GetFile);
$categories=$common->categories($db);
$content=str_replace("{categories}",$categories,$c ontent);
$Pat = "/<{Begin}>(.*?)<{End}>/s";
preg_match($Pat,$Content,$Output);
$SelectedContent = $Output[1];
if($search_txt != "")
{
$cond = "where product_name like '%".$search_txt."%' && show_product = '1'";
}
else
{
$cond = "where category = '$cat_title' && show_product = '1'";
}
########## 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=10;
$links="marketplace.php?cat=t&category=$link&searc h_txt=$search_txt&";
if($page=="")
{
$page=1;
}
$start=($page-1)*$records;
$Content=$common->print_page_break3($db,$Content,$count,$records,$l inks,$page);
########## pagination ###########
$ChangeColor = 1;
$ToReplace = "";
$GetProduct = $db->get_rsltset("select * from ".$prefix."products $cond order by id DESC 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"width="140" height="140">';
$salespage_link='<a href="prods.php?pid='.$id.'"><img border="0" src="http://www.digitalresellersvault.com...infobutton.jpg" width="104" height="16"></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");
?>
My question/query is as follows..
I would like to get the newest product link under the navigational section on the left hand side to show all of the products under the newest categories that we have added..
This will always automatically update when you add a new category to the membership script..
My question.. Do I need to create a separate file lets say newestproduct.php and then use the above code in that page.. to get part to work?
Or can I do it from one marketplace.php file? If so I guess I need to modified the above code? Or do I add the code at the bottom...
I am hoping that I have made sense
Martin Keens Internet Marketing
Membership Guru Free Report
Instant List Building Kits