Foros del Web » Creando para Internet » Sistemas de gestión de contenidos »

paginacion con php fmdeluxe

Estas en el tema de paginacion con php fmdeluxe en el foro de Sistemas de gestión de contenidos en Foros del Web. hola estoy cambiando totalmente el template de fmdeluxe aqui pueden ver como va avanzando, pero necesito que la seccion de descargas, es decir las categorias ...
  #1 (permalink)  
Antiguo 06/02/2008, 05:21
p2pdownloading
Invitado
 
Mensajes: n/a
Puntos:
paginacion con php fmdeluxe

hola estoy cambiando totalmente el template de fmdeluxe

aqui pueden ver como va avanzando, pero necesito que la seccion

de descargas, es decir las categorias queden permantentes, pues cada ves

que toco un hiperviculo desaparece y es reemplazada por el contenido del mismo.

este es el codigo de archivo general del template

Código PHP:
<?php

// Pull the header template
$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);

// Pull the stylesheet
$s_sql = mysql_query("SELECT * FROM ".DB_PREFIX."styles WHERE tID = '".$theme."'");
$s=mysql_fetch_array($s_sql);
$stylesheet = "<style type='text/css'>".$s["style"]."</style>";

    
$header = str_replace("{php=style}", $stylesheet, $header);

    
// Lets check to see if the user system is on, if it is place it in the layout, if not...well don't.
    
if($users == '1')
{
    if(
$_SESSION['userID'] != '')
{
    
$sql = mysql_query("SELECT uID, user, permID FROM ".DB_PREFIX."users WHERE sessID = '".$_SESSION['userID']."'");
    if(!
$sql)
{
    
$usql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'login_out'");
    
$u=mysql_fetch_array($usql);
    
$user_login=$u["template"];
} else {

    
$usql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'login_in'");
    
$u=mysql_fetch_array($usql);
    
$user_login=$u["template"];
    
    
$r=mysql_fetch_array($sql);
    
$uID=$r["uID"];
    
$user_name=$r["user"];
    
$permID=$r["permID"];
    
        
$user_login = str_replace("{php=username}", $user_name, $user_login);
    
    
$psql = mysql_query("SELECT * FROM ".DB_PREFIX."permissions WHERE permID = '".$permID."'");
    if(!
$psql)
{
    
$user_login = str_replace("{php=admin_link}", " ", $user_login);
} else {    
    
$r=mysql_fetch_array($psql);
    
$core=$r["core"];
    
$files=$r["files"];
    
$misc=$r["misc"];
    
$admins=$r["admins"];
    
$u_upload=$r["uUpload"];
    
$comms=$r["comms"];

    if(
$core == '1' || $files == '1' || $misc == '1' || $admins == '1' || $u_uploads == '1' || $comms == '1')
{
    
$admin_link = "<a href='admin/index.php'>{*ADMIN_CP*}</a>";
    
$user_login = str_replace("{php=admin_link}", $admin_link, $user_login);
} else {
    
$user_login = str_replace("{php=admin_link}", " ", $user_login);
}
}}
} else {
    
$usql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'login_out'");
    
$u=mysql_fetch_array($usql);
    
$user_login=$u["template"];
}
} else {

    
$user_login = "";
}

    
$header = str_replace("{php=user_login_area}", $user_login, $header);


// Pull the footer template
$f_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'footer'");
$f=mysql_fetch_array($f_sql);

    
$footer=$f["template"];

// ==================================

    
$quickjump = quick_jump($allFiles); // Create the quick jump function
?>
sigue abajo
  #2 (permalink)  
Antiguo 06/02/2008, 05:22
p2pdownloading
Invitado
 
Mensajes: n/a
Puntos:
Re: paginacion con php fmdeluxe

y este es el de las categorias

Código PHP:
<?php
$tt_sql 
= mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'cat_table_top'");
$tt=mysql_fetch_array($tt_sql);
$table_top=$tt["template"];

    if(isset(
$_POST['sub']))
{
    
$breadcrumb = ":: <a href='index.php'>{*HOME*}</a> ::";
    
$table_top = str_replace("{php=breadcrumb}", $breadcrumb, $table_top);
    
$table_top = lang_convert($table_top);

    
$cat_pass = sha1(md5($_POST['cat_pass']));
    
$cID = $_POST['cid'];
    
    
$sql = mysql_query("SELECT cPwd FROM ".DB_PREFIX."categories WHERE cID = '".$cID."'");    
    
$r=mysql_fetch_array($sql);
    
$cPwd=stripslashes($r["cPwd"]);
    
    if(
$cat_pass === $cPwd)
{
    
$_SESSION['cat_'.$cID] = $cPwd;

    
$cat_page = "{*LOCKED_GRANT*}<meta http-equiv='Refresh' content='2;url=index.php?action=category&id=".$cID."'>";
} else {
    
$cat_page = "{*LOCKED_DENIED*}<meta http-equiv='Refresh' content='2;url=index.php'>";
}

} else {

    if(
$_GET['id'] != '')
{
    
$cID = mysql_real_escape_string(stripslashes($_GET['id']));
} else {
    
$cID = '0';
}

    
$check_sql = mysql_query("SELECT * FROM ".DB_PREFIX."categories WHERE cID = '".$cID."'");
    if(
$cID > '0')
{
    if(
mysql_num_rows($check_sql) == '0')
{
    echo 
"<meta http-equiv='Refresh' content='0;url=index.php?action=failed&fail=cInvalid'>";
    exit;
} else {
    
$cs=mysql_fetch_array($check_sql);
    
$cPwd=$cs["cPwd"];

    if(
$cPwd != '')
{
    if(
$_SESSION['cat_'.$cID] != $cPwd)
{
    echo 
"<meta http-equiv='Refresh' content='0;url=index.php?action=failed&locked=".$cID."'>";
    exit;
}}}
}

    
$breadcrumb = breadcrumb($cID, '1', '');
    
$table_top = str_replace("{php=breadcrumb}", $breadcrumb, $table_top);
    
$table_top = lang_convert($table_top);
    
    
$tr_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'cat_list'");
    
$tr=mysql_fetch_array($tr_sql);
    
$tableRow=$tr["template"];

    
$sql = mysql_query("SELECT * FROM ".DB_PREFIX."categories WHERE cParent = '".$cID."' ORDER BY cOrder ASC");

    if(
mysql_num_rows($sql) == '0')
{
    
$cat_page = "{*NO_CATS*}";

} else { 

    while(
$r=mysql_fetch_array($sql))
{
    
$cat_ID=$r["cID"];
    
$cName=$r["cName"];
    
$cDesc=$r["cDesc"];
    
$cPwd=$r["cPwd"];
    
$scCount=$r["scCount"];
    
$dCount=$r["dCount"];

    if(
$scCount != '0')
{
    
$sc_sql = mysql_query("SELECT cID, scCount, dCount FROM ".DB_PREFIX."categories WHERE cParent = '".$cat_ID."'");
    while(
$sc=mysql_fetch_array($sc_sql))
{
    
$scID=$sc["cID"];
    
$scC=$sc["scCount"];
    
$dc=$sc["dCount"];
    
    
$dCount += $dc;

    if(
$scC != '0')
{
    
$dCount += downCount($scID);
}}
}    

    
$cat_row = str_replace("{php=cat_id}", $cat_ID, $tableRow);
    
$cat_row = str_replace("{php=cat_name}", $cName, $cat_row);
    
$cat_row = str_replace("{php=cat_desc}", $cDesc, $cat_row);
    
$cat_row = str_replace("{php=sub_cats}", $scCount, $cat_row);
    
$cat_row = str_replace("{php=total_files}", $dCount, $cat_row);

    if(
$cPwd != '')
{
    
$locked = "<b>{*LOCKED*}:</b>&nbsp;";
    
$cat_row = str_replace("{php=cat_pwd}", $locked, $cat_row);
} else {
    
$cat_row = str_replace("{php=cat_pwd}", "", $cat_row);
}

    
$cat_page .= $cat_row;
}
    

    if(
$cID == '0')
{
    if(
$allFiles == '1')
{
    
$tr_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'cat_all_files'");
    
$tr=mysql_fetch_array($tr_sql);
    
$all_row=$tr["template"];

    
$all_scCount = '0';
    
$all_dCount = '0';

    
$a_sql = mysql_query("SELECT scCount, dCount FROM ".DB_PREFIX."categories ORDER BY cID ASC");
    while(
$ar=mysql_fetch_array($a_sql))
{
    
$all_dCount += $ar["dCount"];
}
    
$all_row = str_replace("{php=sub_cats}", $all_scCount, $all_row);
    
$all_row = str_replace("{php=total_files}", $all_dCount, $all_row);

    
$cat_page .= $all_row;
}}
}
}
    
$cat_page = lang_convert($cat_page);




$tb_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'cat_table_bottom'");
$tb=mysql_fetch_array($tb_sql);
$table_bottom=$tb["template"];

    if(
$_GET['id'] != '')
{
    
$scribeID = $_GET['id'];
} else {
    
$scribeID = '0';
}
    
$table_bottom = str_replace("{php=time_zone}", $timeZone, $table_bottom);
    
$table_bottom = str_replace("{php=scribe_id}", $scribeID, $table_bottom);
    
$table_bottom = str_replace("{php=quick_jump_menu}", $quickjump, $table_bottom);
    
$table_bottom = lang_convert($table_bottom);


// Display the category table
    
echo $table_top;
    echo 
$cat_page;
    echo 
$table_bottom;



// Start to display downloads if it isn't the main category! 

    
if($cID > '0')
{
    echo 
"<br />";

$tt_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'down_table_top'");
$tt=mysql_fetch_array($tt_sql);
$table_top=$tt["template"];

    
$breadcrumb = breadcrumb($cID, '0', '');
    
$table_top = str_replace("{php=breadcrumb}", $breadcrumb, $table_top);
    
$table_top = lang_convert($table_top);

    
$tr_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'down_list'");
    
$tr=mysql_fetch_array($tr_sql);
    
$tableRow=$tr["template"];

    
$sql = mysql_query("SELECT noFiles FROM ".DB_PREFIX."categories WHERE cID = '".$cID."'");    
    
$r=mysql_fetch_array($sql);
    
$limit=$r["noFiles"];

    
$sql = mysql_query("SELECT dID, dName, dDesc, author, dateAdd, count FROM ".DB_PREFIX."downloads WHERE cID = '".$cID."' && sticky = '1' && approved = '1' ORDER BY dID DESC");
    
    
$noSticky = '0';
    if(
mysql_num_rows($sql) > '0')
{
    
$noSticky = mysql_num_rows($sql);
    
$limit -= $noSticky;

    while(
$r=mysql_fetch_array($sql))
{
    
$dID=stripslashes($r["dID"]);
    
$dName=stripslashes($r["dName"]);
    
$dDesc=substr(stripslashes($r["dDesc"]), 0, 35);
    
$author=stripslashes($r["author"]);
    
$dateAdd=stripslashes($r["dateAdd"]);
    
$count=stripslashes($r["count"]);
    
$rating=rating($dID, 1);
    
    
$down_row = str_replace("{php=down_id}", $dID, $tableRow);
    
$down_row = str_replace("{php=down_name}", $dName, $down_row);
    
$down_row = str_replace("{php=sticky}", "{*PINNED*}", $down_row);
    
$down_row = str_replace("{php=down_desc}", $dDesc, $down_row);
    
$down_row = str_replace("{php=author}", $author, $down_row);
    
$down_row = str_replace("{php=date_added}", $dateAdd, $down_row);
    
$down_row = str_replace("{php=down_count}", $count, $down_row);
    
$down_row = str_replace("{php=rating}", $rating, $down_row);
    

    
$down_page .= $down_row;
}}

    
$query_count    = "SELECT * FROM ".DB_PREFIX."downloads WHERE cID = '".$cID."' && sticky = '0' && approved = '1'";    
        
$result_count   = mysql_query($query_count);    
        
$totalrows      = mysql_num_rows($result_count);
        
    if(
is_numeric($_GET['page']))
{
    
$page = $_GET['page'];
} else {
        
$page = '1';
}       

    
$numofpages = $totalrows / $limit;
       
$limitvalue = $page * $limit - ($limit);

    if(isset(
$_POST['sort_sub']))
{
    
$sort = htmlentities($_POST['sort'], ENT_QUOTES);
    
$order = htmlentities($_POST['order'], ENT_QUOTES);
} else {
    
$sort = "dID";
    
$order = "DESC";
}

        
$query  = "SELECT dID, dName, dDesc, author, dateAdd, count FROM ".DB_PREFIX."downloads WHERE cID = '".$cID."' && sticky = '0' && approved = '1' ORDER BY ".$sort." ".$order." LIMIT $limitvalue, $limit";        
       
$result = mysql_query($query);

    if(
$noSticky == '0' && $totalrows == '0')
{
    
$down_page = "{*NO_DOWNS*}";

} else {

    while(
$r=mysql_fetch_array($result))
{
    
$dID=stripslashes($r["dID"]);
    
$dName=stripslashes($r["dName"]);
    
$dDesc=substr(stripslashes($r["dDesc"]), 0, 35);
    
$author=stripslashes($r["author"]);
    
$dateAdd=stripslashes($r["dateAdd"]);
    
$count=stripslashes($r["count"]);
    
$rating=rating($dID, 1);
    
    
$down_row = str_replace("{php=down_id}", $dID, $tableRow);
    
$down_row = str_replace("{php=down_name}", $dName, $down_row);
    
$down_row = str_replace("{php=sticky}", "", $down_row);
    
$down_row = str_replace("{php=down_desc}", $dDesc, $down_row);
    
$down_row = str_replace("{php=author}", $author, $down_row);
    
$down_row = str_replace("{php=date_added}", $dateAdd, $down_row);
    
$down_row = str_replace("{php=down_count}", $count, $down_row);
    
$down_row = str_replace("{php=rating}", $rating, $down_row);
    

    
$down_page .= $down_row;
}

    
$page_nav = page_nav("action=category&id=".$cID);

    
$pagination = "<table cellspacing='2' cellpadding='2'>
    <tr>
    "
.$page_nav."    
    </tr>
    </table>"
;
}

    
$down_page = lang_convert($down_page);

$tb_sql = mysql_query("SELECT * FROM ".DB_PREFIX."templates WHERE tID = '".$theme."' && tmName = 'down_table_bottom'");
$tb=mysql_fetch_array($tb_sql);
$table_bottom=$tb["template"];

    
$address = "index.php?action=category&id=".$cID;

    
$table_bottom = str_replace("{php=cat_id}", $cID, $table_bottom);
    
$table_bottom = str_replace("{php=pagination}", $pagination, $table_bottom);
    
$table_bottom = str_replace("{php=address}", $address, $table_bottom);
    
$table_bottom = lang_convert($table_bottom);



// Display the downloads table
    
echo $table_top;
    echo 
$down_page;
    echo 
$table_bottom;
}


?>
que parte del codigo tengo que editar para que las categorias se queden fijas y en cambio se mueva el contenido del centro de la pag?

saludos
  #3 (permalink)  
Antiguo 06/02/2008, 09:10
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 5 meses
Puntos: 2135
Re: paginacion con php fmdeluxe

Tema trasladado a Aplicaciones Prefabricadas.

Por favor publica en los foros correctos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:27.