mira esta es la BD donde estan las categorias
cID cName cDesc cParent cOrder cPwd scCount dCount noFiles
1 OTROS P2P los mejores software programas p2p 0 5 1 29 5
2 AZUREUS descargar azureus mods de azureus azureus vuze 0 2 1 0 5
3 EMULE descargar emule mods de emule 0 4 0 4 5
4 BITTORRENT descargar bittorrent mods de bittorrent 0 3 0 1 5
5 ARES descargar ares mods de ares 0 1 0 1 5
6 categoria 1 1 0 1 0 10
7 categorie2 1 0 0 0 10
8 categorie 3 1 0 0 0 10
9 categoria 1 2 0 0 0 10
10 subcattegoria 1 6 0 0 0 10
11 OTROS PROGRAMAS descargar programas gratis download programas 0 6 0 0
y el script para el titulo y los meta es este
Código PHP:
$valor=$_GET['action'];
if($_GET['id'] != '')
{
$cID = mysql_real_escape_string(stripslashes($_GET['id']));
} else {
$cID = '0';
}
if($valor=='category')
{
$sql = mysql_query("SELECT * FROM ".DB_PREFIX."categories WHERE cID = '".$cID."' ORDER BY cOrder ASC");
$r=mysql_fetch_array($sql);
$cName=$r["cName"];
$cDesc=$r["cDesc"];
$dDesc='';
$databaseName="Descargar ".$cName." Gratis| Download ".$cName." Gratis";
} elseif($valor=='downloads') {
$sql = mysql_query("SELECT dName, dDesc, version, cID FROM ".DB_PREFIX."downloads WHERE dID = '".$cID."'");
$r=mysql_fetch_array($sql);
$dName=$r["dName"];
$dDesc=$r["dDesc"];
$version=$r["version"];
$cID=$r["cID"];
$dow = mysql_query("SELECT cName FROM ".DB_PREFIX."categories WHERE cID = '".$cID."' ORDER BY cOrder ASC");
$m=mysql_fetch_array($dow);
$cName=$m["cName"]. " ";
$databaseName="Descargar ". $dName." ".$version." Gratis| Descargar ".$cName." Gratis";
}else {
$sql = mysql_query("SELECT * FROM ".DB_PREFIX."categories WHERE cID = '".$cID."' ORDER BY cOrder ASC");
}
if(mysql_num_rows($sql) == '0')
{
$sqll = mysql_query("SELECT cName FROM ".DB_PREFIX."categories WHERE cParent = '0' ORDER BY cOrder ASC");
$cNames[] = array();
while($r=mysql_fetch_array($sqll)) { $cNames[]=$r["cName"]; }
$cat=implode( ", ", $cNames );
var_dump( $cat );
$h_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'header'");
$h=mysql_fetch_array($h_sql);
$header=$h["template"];
$header = str_replace("{php=database_name}", $databaseName . " |", $header);
$header = str_replace("{php=site_url}", $siteURL, $header);
$header = str_replace("{php=cat_desc}", $cDesc. $dDesc, $header);
$header = str_replace("{php=cat}", $cat, $header);
$header = str_replace("{php=dow_desc}", $dDesc, $header);
} else {
$sqll = mysql_query("SELECT cName FROM ".DB_PREFIX."categories WHERE cParent = '".$cID."' ORDER BY cOrder ASC");
$cNames[] = array();
while($r=mysql_fetch_array($sqll)) { $cNames[]=$r["cName"]; }
$cat=implode( ", ", $cNames );
var_dump( $cat );
$h_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'header'");
$h=mysql_fetch_array($h_sql);
$header=$h["template"];
$header = str_replace("{php=database_name}", $databaseName . " |", $header);
$header = str_replace("{php=site_url}", $siteURL, $header);
$header = str_replace("{php=cat_desc}", $cDesc. $dDesc, $header);
$header = str_replace("{php=cat}", $cat, $header);
$header = str_replace("{php=dow_desc}", $dDesc, $header);
}