//Funzione che crea il Path della foglia
function creaPath($id, $c, $pagina, $l){
$output = "";
//Se $pagina è uguale a search non metti i link nel path
$query = mysql_query("SELECT * FROM categorie WHERE idCategoria=$c");
if($result = mysql_fetch_array($query)){
$tipo = $result['tipo'];
if($result['idCategoria'] == 0){
return $output .= creaPath($id, $result["idPadre"], "", $l) . "Home";
}else{
if($result['idCategoria'] == $id){
return $output .= creaPath($id, $result["idPadre"], "", $l) . " > " . $result['nome'];
}else{
return $output .= creaPath($id, $result["idPadre"], "", $l) . " > " . "" . $result['nome'] . "";
}
}
} else{
return $output .= "Home";
}
}
?>
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
?>
$titlekey = str_replace("_", " ", $_GET["titlekey"]);
$titlekey = ucwords(strtolower($titlekey));
if ($titlekey != "") {
echo "Vendita $titlekey in Cuoio Comprare $titlekey";
} else { ?>
Catalogo e Accessori per la tua moto - Kit antiforatura
} ?>
 |
|
 |
|

|
 |

CATALOGO CUOIO |
 |
if(isset($_GET['p'])){
$idPadre = $_GET['p'];
}else{
$idPadre = 0;
}
if(isset($_GET['t'])){
$tipo = $_GET['t'];
}else{
$tipo = 1;
}
if(isset($_GET['id'])){
$id = $_GET['id'];
}else{
$id = $idPadre;
}
$n = 1;
if($tipo == 1){
$nPerRiga = 3;
$strsql = "SELECT * FROM categorie WHERE idPadre=$idPadre AND attivo = 1 ORDER by idCategoria DESC ";
}else{
$strsql = "SELECT * FROM categorie WHERE idCategoria=$idPadre AND attivo = 1 ORDER by idCategoria DESC ";
}
$rs = mysql_query($strsql,$conn);
if($tipo == 1){
?>
echo creaPath($id, $id, "", "ita");
if(mysql_num_rows($rs) > 0){
//PAGINAZIONE
$nPerPagina = 1000;
if (isset($_GET['page'])){
$page = $_GET['page'];
$da = (($_GET['page']-1)*$nPerPagina);
}else{
$page = 1;
$da = 0;
}
$n_risultati = mysql_num_rows($rs);
$pagTotali = ceil($n_risultati/$nPerPagina);
$strPag = "Pagina $page di " . $pagTotali;
if($page != 1){
$strPagBack = " indietro - ";
}else{
$strPagBack="";
}
if($page != $pagTotali){
$strPagForward = " - avanti";
}else{
$strPagForward = "";
}
$strsql .= " LIMIT $da, $nPerPagina";
$rs = mysql_query($strsql) or die(mysql_error());
$c = mysql_num_rows($rs);
$a = 0;
while ($row = mysql_fetch_array($rs)){
$a ++;
if($n == 1){
?> |
if ($row['tipo'] != 1) { ?>
<< Torna indietro
} ?> |
|
}
if($a == 1){ ?>
}
if($n%$nPerRiga == 1){ ?>
}
$name = str_replace(" ", "_", $row['nome']);
$name = strtolower($name);
$link = "$name"."-".$row['idCategoria']."-".$row['tipo'].".html";
?>
if ($row['tipo'] == 1) { ?>
|
}
if($n%$nPerRiga == 0){
?>
}
$n++;
}
}else{
?>
}
}
mysql_free_result($rs);
?>
|
$rs = mysql_query($strsql) or die(mysql_error());
$c = mysql_num_rows($rs);
$a = 0;
$iframe = 0;
//* echo" ";?>
|
|
|
|
|
|
|
|
|

|
|
|