"; unlink($filename); } $flag = 1; $arch = fopen("visitas/flag.php","w+"); fputs($arch,""); fclose($arch); } else { if($dia_hoy == "02" && $flag == 1) { $flag = 0; //se pasa flag a cero; $arch = fopen("visitas/flag.php","w+"); fputs($arch,""); fclose($arch); }; }; ///////////////////////////////////////////////////////////////////// $archivo=$c.".txt"; //echo $archivo; if(is_file("visitas/$archivo")) { include("visitas/$archivo"); $visitas=$visitas+1; $arch=fopen("visitas/$archivo","w+"); fputs($arch,""); fclose($arch); } else { $arch=fopen("visitas/$archivo","w+"); fputs($arch,""); fclose($arch); $visitas=2; }; $c *= 1; if ($c == 0) { $c = 1; }; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password); mysql_select_db($mysql_database, $bd); $sql = mysql_query("SELECT name, title, description, pages, ref FROM {$prefix}categories WHERE id = $c"); $current_category = mysql_fetch_array($sql, MYSQL_ASSOC); if (($c > 1) & !$current_category["name"]){ mysql_close(); header("Location: {$dir}"); exit(); }; if (!$current_category["name"]) { $current_category["name"] = "Directory Search"; }; if (!$current_category["title"]) { $current_category["title"] = $current_category["name"]; }; if (!$current_category["description"]) { $current_category["description"] = $current_category["name"]." ".$current_category["title"]; }; $last_category = false; $ref = $c; while(!$last_category){ $n_parent_categories += 1; $sql = mysql_query("SELECT id, name, ref FROM {$prefix}categories WHERE id = $ref"); $parent_categories[$n_parent_categories-1] = mysql_fetch_array($sql, MYSQL_ASSOC); if ($parent_categories[$n_parent_categories-1]["ref"] == 0){ $last_category = true; }else{ $ref = $parent_categories[$n_parent_categories-1]["ref"]; }; }; // agregado por Gabriel, cambié el REF = $C $sql = mysql_query("SELECT name, title, description, pages, ref FROM {$prefix}categories WHERE ref = $c"); $n_subcategories = mysql_num_rows($sql); $sql = mysql_query("SELECT {$prefix}categories.id, {$prefix}categories.name FROM {$prefix}categories LEFT JOIN {$prefix}pages ON {$prefix}pages.category = {$prefix}categories.id AND {$prefix}pages.accepted = 'y' WHERE ref = $c GROUP BY {$prefix}categories.id ORDER BY {$prefix}categories.name"); for ($x = 0; $x < $n_subcategories; $x++){ $subcategories[$x] = mysql_fetch_array($sql, MYSQL_ASSOC); }; $sql = mysql_query("SELECT {$prefix}categories.id, {$prefix}categories.name, COUNT({$prefix}subcategories.id) AS subcategories FROM {$prefix}categories LEFT JOIN {$prefix}categories AS {$prefix}subcategories ON {$prefix}subcategories.ref = {$prefix}categories.id WHERE {$prefix}categories.ref = $c GROUP BY {$prefix}categories.id ORDER BY {$prefix}categories.name"); for ($x = 0; $x < $n_subcategories; $x++){ $subcategories[$x]["subcategories"] = mysql_result($sql, $x, "subcategories"); }; if ($current_category["pages"] == "y"){ if ($s == 0) { $s = 1; }; $n = 10; $sql = mysql_query("SELECT COUNT(*) AS total_pages FROM {$prefix}pages WHERE category = $c AND accepted = 'y'"); $total_pages = mysql_result($sql,0,"total_pages"); ////////VER DESDE ACA!!!!////////////////////////////////// if ($total_pages > 0){ $sql = mysql_query("SELECT id, url, title, description FROM {$prefix}pages WHERE category = $c AND accepted = 'y' ORDER BY title ASC LIMIT ".($s-1).",$n"); $n_pages = mysql_num_rows($sql); for ($x = 0; $x < $n_pages; $x++){ $pages[$x] = mysql_fetch_array($sql, MYSQL_ASSOC); }; }; }; $e = min($s + $n - 1, $s + $n_pages - 1); ?> <? echo $current_category["name"]; if ($current_category["title"] != $current_category["name"]){ echo " - ".$current_category["title"]; };?> " /> " />
'; for ($x = $n_parent_categories-1; $x >= 1; $x--){ if ($x != $n_parent_categories-1) { echo " > "; }; if ($parent_categories[$x]["id"] == 1){ echo ''.$parent_categories[$x]["name"].''; }else{ echo ''.$parent_categories[$x]["name"].''; }; }; echo ' > '.$current_category["name"]; echo '
'; }; ?>
Ir al inicio
0){ echo '
'; echo '
'.$t01.' "'.$current_category["name"].'"
'; if($current_category["pages"] == "y"){ echo '
'.$t03.'
'; }; $t = ceil($n_subcategories/2); echo '
'."\r\n"; echo '
'."\r\n"; echo ''; for ($x = 0; $x < $t; $x++){ // lista de subcategorías a la izquierda echo ''; }; echo "
\r\n"; echo '
'."\r\n"; if ($n_subcategories > 1){ for ($x = $t; $x < $n_subcategories; $x++){ // esta es la lista de subcategorías a la derecha echo ''; }; } else{ echo " \r\n"; }; echo "
\r\n"; echo "
\r\n"; echo "
\r\n"; // Acá aparece el banner echo '
'; if ($current_category["id"] == 16) { $zid=2252; echo ''; } else { if ($current_category["id"] == 13) { $bid=2469; echo ''; } else { if ($current_category["id"]==163) { $bid=2469; echo ''; } else { if ($current_category["id"]==18) { echo "\"sistemas";} else { if ($current_category["id"]==36) { echo '

Anunciante para esta categoría
'; } else { include ("adsgoogle336.php"); } }; }; }; }; echo '
'; // cierra el banner if($c==0 or $c==1) { // if(true) { $consu2=mysql_query("SELECT COUNT({$prefix}pages.id) AS cantidad FROM {$prefix}pages where accepted='y'")or die(mysql_error()); $cant=mysql_fetch_array($consu2); echo '
Cantidad de sitios en la base de datos: '.$cant[cantidad].'
'.$visitas.' visualizaciones este mes
'; } else { ////////////////FUNCION CONTAR SITIOS//////////////////// $sitios = 0; function ContarSitios($cue) { global $sitios; $prefix = "rec2_"; $conscuenta = mysql_query("SELECT COUNT(*) AS total_pages FROM {$prefix}pages WHERE category = $cue AND accepted = 'y'")or die(mysql_error()); $cuenta = mysql_fetch_array($conscuenta); $sitios = $sitios+$cuenta[total_pages]; $sql = mysql_query("SELECT {$prefix}categories.id, {$prefix}categories.name, COUNT({$prefix}pages.id) AS pages FROM {$prefix}categories LEFT JOIN {$prefix}pages ON {$prefix}pages.category = {$prefix}categories.id AND {$prefix}pages.accepted = 'y' WHERE ref = $cue GROUP BY {$prefix}categories.id ORDER BY {$prefix}categories.name"); $n_subcategories = mysql_num_rows($sql); for ($x = 0; $x < $n_subcategories; $x++){ $subcategories[$x] = mysql_fetch_array($sql, MYSQL_ASSOC); ContarSitios($subcategories[$x][id]); }; }; mysql_connect("localhost", $mysql_user, $mysql_password) or die(mysql_error()); mysql_query("USE $mysql_database") or die(mysql_error()); ContarSitios($c); echo '
Cantidad de sitios en '.strtoupper($current_category[name]).' y sus subcategorías: '.$sitios.'
'.$visitas.' visualizaciones este mes
'; }; }; if ($current_category["pages"] == "y"){ if ($n_pages > 0){ echo '
Sitios web en "'.$current_category["name"].'"
'; if ($n_subcategories <= 0){ echo '
'; echo ''.$t03.' '; echo '
'; if ($n_pages > 0) { echo '
'; include ("adsgoogle336.php"); echo '
'; } } else echo ''; echo '
'; echo '
'; for ($x = 0; $x < $n_pages; $x++){ echo '
'; echo '
'.$pages[$x][
'; echo '
'.$pages[$x]["title"].'
'; echo $pages[$x]["description"].'
'; echo ''.$pages[$x]["url"].'
'; echo ''.$pages[$x]["ciudad"].''; switch($pages[$x]["pr"]) { case 0: $pr=0;break; case 1: $pr=4;break; case 2: $pr=8;break; case 3: $pr=12;break; case 4: $pr=16;break; case 5: $pr=20;break; case 6: $pr=24;break; case 7: $pr=28;break; case 8: $pr=32;break; case 9: $pr=36;break; case 10: $pr=40;break; } echo '
'; }; echo '
'; /*echo '
'; echo ' '; echo "
";*/ ?> "; echo '
Free thumbnail preview by Thumbshots.org
'; } } ?> 0) or ($n_pages > 0)){ echo '
'; include ("adsense-links.php"); include ("adsgoogle728.php3"); include ("adsense-links.php"); echo '
'; } ?>
'.$t07.' '; }; for ($x = 1; $x <= ceil($total_pages/$n); $x++){ $current = ($x-1) * $n + 1; if ($current == $s){ echo $x."\r\n"; }else{ echo ''.$x.' '; }; }; if ($e < $total_pages){ $next = $s + $n; echo ''.$t08.' '; }; }; ?>
'.$current_category["name"].''; ?>