Affichage des photos dans une autre page
narama87
Messages postés
113
Statut
Membre
-
narama87 Messages postés 113 Statut Membre -
narama87 Messages postés 113 Statut Membre -
Bonjour à tous,
j'ai besoin de votre aide et c'est très urgent .
j'ai une page qui affiche les catégories des photos , en appyant sur l'une des catégories ,
les photos concernées s'affichent en dessous dans la même page ,
je veux que ces photos s'affichent dans une deuxième page.que dois-je faire ? comment savoir si on appui
sur le lien et comment ouvrir une autre page ???
vos idées seront les bienvenus
voici le code :
// Affichage des catégories des photos
global $queryString_rs, $db, $monConfig_url_site, $pageinfo;
$divCat="<div style=\" padding:20px\"><h2>Veuillez choisir une catégorie</h2>";
$sql="SELECT * FROM ".PREFIXE_DB."galerie_category ORDER BY name ASC";
$rs=$db->dbquery($sql);
if (!isset($_GET['catID'])) {$_GET['catID']=1;}
if ($db->dbrows($rs) !=0) {
while($row=$db->dbarray($rs)) // start while
{
$path_vig_cat = $monConfig_url_site . "/uploads/image/galerie/vigCat/" . $row['photo'];
$divCat .='<div style="float:left; margin-left:10px; text-align:center; margin-top:10px; padding-bottom:20px">';
$href="";
$slashref="";
$filtre="-moz-opacity:.5; filter:alpha(opacity=50);";
if ( $_GET['catID'] != $row['id'] ){
$href='<a href="index.php?page='.$pageinfo['id'].'&catID='.$row['id'].'" title="Album photo de la catégorie '.ucfirst($row['name']).'">';
$slashref="</a>";
$filtre="";
}
$divCat .=$href.'<img src="'.$path_vig_cat.'" border="0" style="border:1px solid #666;'.$filtre.'">'.$slashref;
$divCat .='<br />'.ucfirst($row['name']);
$divCat .='</div>';
}
}
$divCat.="</div>";
//******************************************
$LG_PAGE = 2;
$COL_PAGE = 4;
$sTxt .="<div style=\"border-top:1px solid #999; padding-top:50px; padding-bottom:30px; clear:both\">";
// ****************** AFFICHAGE DES PHOTOS DE L'ALBUM SELECTIONNE ****************************//
$limit = $_GET['limit'];
$page = $_GET['npage'];
$picArray = array();
if (!($limit)) $limit = $LG_PAGE*$COL_PAGE;
if (!($page)) $page = 0;
// -> Nombre de colonne à afficher
$col=$COL_PAGE;
$sql="SELECT * FROM ".PREFIXE_DB."galeries WHERE status=1 AND folder = 'galerie' ";
if (isset($_GET['catID']) && $_GET['catID']!="") {
$sql.=" AND cat_id=".$_GET['catID']." ";
}else{
$sql.=" AND cat_id=1 ";
}
$sql.="ORDER BY id DESC";
$rs=$db->dbquery($sql);
if ($db->dbrows($rs) !=0) {
$sTxt .='<table align="center"> ';
$i=0;
$k=0;
while($row=$db->dbarray($rs)) // start while
{
if(($k>=$page) && ($k<$page+$limit))
{
if($i==0 || $i%$col==0) $sTxt .= "<tr>";
define(DS, "/");
$path_to_vig = $monConfig_url_site . DS . "uploads/image" . DS . 'galerie' . DS . $row['id'].'_icone.jpg';
$path_to_big = $monConfig_url_site . DS . "uploads/image" . DS . 'galerie' . DS . $row['filename'].".jpg";
$sTxt .='<td width="200" valign="top"><div style="margin-top:6px; text-align:center">';
$sTxt .='<a href="'.$path_to_big.'" rel="lightbox[roadtrip]" title="'.ucfirst($row['title']).'"><img src="'.$path_to_vig.'" border="0" style=" border:1px solid #666"></a></div>';
$sTxt .='</td>';
}// end if 1
$i++;
if($i%$col==0) $sTxt .="</tr>";
$k++;
} // end while
$sTxt .="</table>";
$numrows = $i;
if ($numrows == 0) exit();
$pages = intval($numrows/$limit);
if ($numrows%$limit)
$pages++;
$current = ($page/$limit) + 1;
if (($pages < 1) || ($pages == 0))
$total = 1;
else
$total = $pages;
$first = $page + 1;
if (!((($page + $limit) / $limit) >= $pages) && $pages != 1)
$last = $page + $limit;
else
$last = $numrows;
$sTxt .='<div align="center">';
if (($page != 0) && $i>$limit){
$back_page = $page - $limit;
$sTxt .="<a href=\"$PHP_SELF?npage=$back_page&limit=$limit".$queryString_rs."\">".TXT_PREV."</a> ";
}
for ($j=1; $j <= $pages; $j++) {
$ppage = $limit*($j - 1);
if (($ppage == $page) && $i>$limit)
$sTxt .="<b>$j</b>";
else if($i>$limit)
$sTxt .=" <a href=\"$PHP_SELF?npage=$ppage&limit=$limit".$queryString_rs."\">$j</a> ";
}
if (!((($page+$limit) / $limit) >= $pages) && $pages != 1 && $i>$limit) {
$next_page = $page + $limit;
$sTxt .=" <a href=\"$PHP_SELF?npage=$next_page&limit=$limit".$queryString_rs."\">".TXT_NEXT."</a>";
}
$sTxt .='</div>';
}//end if
$sTxt .="</div>";
return $divCat.$sTxt;
// Affichage des galeries et des photos dans la même page.
}
j'ai besoin de votre aide et c'est très urgent .
j'ai une page qui affiche les catégories des photos , en appyant sur l'une des catégories ,
les photos concernées s'affichent en dessous dans la même page ,
je veux que ces photos s'affichent dans une deuxième page.que dois-je faire ? comment savoir si on appui
sur le lien et comment ouvrir une autre page ???
vos idées seront les bienvenus
voici le code :
// Affichage des catégories des photos
global $queryString_rs, $db, $monConfig_url_site, $pageinfo;
$divCat="<div style=\" padding:20px\"><h2>Veuillez choisir une catégorie</h2>";
$sql="SELECT * FROM ".PREFIXE_DB."galerie_category ORDER BY name ASC";
$rs=$db->dbquery($sql);
if (!isset($_GET['catID'])) {$_GET['catID']=1;}
if ($db->dbrows($rs) !=0) {
while($row=$db->dbarray($rs)) // start while
{
$path_vig_cat = $monConfig_url_site . "/uploads/image/galerie/vigCat/" . $row['photo'];
$divCat .='<div style="float:left; margin-left:10px; text-align:center; margin-top:10px; padding-bottom:20px">';
$href="";
$slashref="";
$filtre="-moz-opacity:.5; filter:alpha(opacity=50);";
if ( $_GET['catID'] != $row['id'] ){
$href='<a href="index.php?page='.$pageinfo['id'].'&catID='.$row['id'].'" title="Album photo de la catégorie '.ucfirst($row['name']).'">';
$slashref="</a>";
$filtre="";
}
$divCat .=$href.'<img src="'.$path_vig_cat.'" border="0" style="border:1px solid #666;'.$filtre.'">'.$slashref;
$divCat .='<br />'.ucfirst($row['name']);
$divCat .='</div>';
}
}
$divCat.="</div>";
//******************************************
$LG_PAGE = 2;
$COL_PAGE = 4;
$sTxt .="<div style=\"border-top:1px solid #999; padding-top:50px; padding-bottom:30px; clear:both\">";
// ****************** AFFICHAGE DES PHOTOS DE L'ALBUM SELECTIONNE ****************************//
$limit = $_GET['limit'];
$page = $_GET['npage'];
$picArray = array();
if (!($limit)) $limit = $LG_PAGE*$COL_PAGE;
if (!($page)) $page = 0;
// -> Nombre de colonne à afficher
$col=$COL_PAGE;
$sql="SELECT * FROM ".PREFIXE_DB."galeries WHERE status=1 AND folder = 'galerie' ";
if (isset($_GET['catID']) && $_GET['catID']!="") {
$sql.=" AND cat_id=".$_GET['catID']." ";
}else{
$sql.=" AND cat_id=1 ";
}
$sql.="ORDER BY id DESC";
$rs=$db->dbquery($sql);
if ($db->dbrows($rs) !=0) {
$sTxt .='<table align="center"> ';
$i=0;
$k=0;
while($row=$db->dbarray($rs)) // start while
{
if(($k>=$page) && ($k<$page+$limit))
{
if($i==0 || $i%$col==0) $sTxt .= "<tr>";
define(DS, "/");
$path_to_vig = $monConfig_url_site . DS . "uploads/image" . DS . 'galerie' . DS . $row['id'].'_icone.jpg';
$path_to_big = $monConfig_url_site . DS . "uploads/image" . DS . 'galerie' . DS . $row['filename'].".jpg";
$sTxt .='<td width="200" valign="top"><div style="margin-top:6px; text-align:center">';
$sTxt .='<a href="'.$path_to_big.'" rel="lightbox[roadtrip]" title="'.ucfirst($row['title']).'"><img src="'.$path_to_vig.'" border="0" style=" border:1px solid #666"></a></div>';
$sTxt .='</td>';
}// end if 1
$i++;
if($i%$col==0) $sTxt .="</tr>";
$k++;
} // end while
$sTxt .="</table>";
$numrows = $i;
if ($numrows == 0) exit();
$pages = intval($numrows/$limit);
if ($numrows%$limit)
$pages++;
$current = ($page/$limit) + 1;
if (($pages < 1) || ($pages == 0))
$total = 1;
else
$total = $pages;
$first = $page + 1;
if (!((($page + $limit) / $limit) >= $pages) && $pages != 1)
$last = $page + $limit;
else
$last = $numrows;
$sTxt .='<div align="center">';
if (($page != 0) && $i>$limit){
$back_page = $page - $limit;
$sTxt .="<a href=\"$PHP_SELF?npage=$back_page&limit=$limit".$queryString_rs."\">".TXT_PREV."</a> ";
}
for ($j=1; $j <= $pages; $j++) {
$ppage = $limit*($j - 1);
if (($ppage == $page) && $i>$limit)
$sTxt .="<b>$j</b>";
else if($i>$limit)
$sTxt .=" <a href=\"$PHP_SELF?npage=$ppage&limit=$limit".$queryString_rs."\">$j</a> ";
}
if (!((($page+$limit) / $limit) >= $pages) && $pages != 1 && $i>$limit) {
$next_page = $page + $limit;
$sTxt .=" <a href=\"$PHP_SELF?npage=$next_page&limit=$limit".$queryString_rs."\">".TXT_NEXT."</a>";
}
$sTxt .='</div>';
}//end if
$sTxt .="</div>";
return $divCat.$sTxt;
// Affichage des galeries et des photos dans la même page.
}
A voir également:
- Affichage des photos dans une autre page
- Partager des photos - Guide
- Supprimer une page dans word - Guide
- Toutes mes photos - Guide
- Google photos - Télécharger - Albums photo
- Imprimer tableau excel sur une page - Guide