22/10/2009, 14:41
|
| | Fecha de Ingreso: octubre-2009
Mensajes: 100
Antigüedad: 15 años, 1 mes Puntos: 0 | |
Respuesta: Problema Con Paginacion Listo aca va lo que tengo
<?php
$usuario =& JFactory::getUser();
$user= JFactory::getUser();
$id = $user->id;
defined('_JEXEC') or die( 'Restricted access' );
$db = &JFactory::getDBO();
$path = $PHP_SELF."?option=".$_GET["option"]."&view=".$_GET["view"]."&id=".$_GET["id"]."&Itemid=".$_GET["Itemid"];
$num = 0 ;
$pag = 1;
$dir = "" ;
$pri = 1 ;
// $arrpag[][][] ;
$ant = 0 ;
$arr = "";
$fir = 0;
$query = "select a.id as id from jos153_properties_lightbox a where a.uid = '".$id."'" ;
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach($rows AS $row){
if($pri == 1){
$dir .="<a href = '".$path."&pag=".$row->id."'>".$pag."</a> " ;
$pag++;
$pri = 0;
$fir = $row->id ;
$arr[$row->id]["ant"] = $ant ;
$arr[$row->id]["nex"] = 0 ;
$ant = $row->id ;
}
if($num == 3){
$dir .="<a href = '".$path."&pag=".$row->id."'>".$pag."</a> " ;
$pag++;
$arr[$ant]["nex"] = $row->id;
$arr[$row->id]["ant"] = $ant ;
$arr[$row->id]["nex"] = 0 ;
$num = 0;
$ant = $row->id ;
}
$num++;
}
if(isset($_GET["pag"])){
if($arr[$_GET["pag"]]["ant"] != 0){
$dir = "<a href = '".$path."&pag=".$arr[$_GET["pag"]]["ant"]."'>Preview</a> " . $dir ;
}else{
$dir = "Preview " . $dir ;
}
}else{
$dir = "Preview " . $dir ;
}
if(isset($_GET["pag"])){
if($arr[$_GET["pag"]]["nex"] != 0){
$dir = $dir . "<a href = '".$path."&pag=".$arr[$_GET["pag"]]["nex"]."'>Next</a> " ;
}else{
$dir = $dir . "Next " ;
}
}else{
if($fir != 0){
$dir = $dir . "<a href = '".$path."&pag=".$arr[$fir]["nex"]."'>Next</a> " ;
}else{
$dir = $dir . "Next " ;
}
}
$query = "select a.*, b.*, c.name as type from jos153_properties_lightbox a join jos153_properties_products b on a.propid = b.id join jos153_properties_category c on b.parent = c.id where ";
if(isset($_GET["pag"])){
$query.="a.id >=".$_GET["pag"]. " and " ;
}
$query.="a.uid = '".$id."'ORDER BY date DESC limit 3";
$db->setQuery($query);
$rows = $db->loadObjectList();
?>
Estimado pateketrueke estoy leyendo te hice caso, pero cada vez se me complica mas la cosa jaja |