Accueil > Forum > > > > Gallerie images pour template phpbb
Gallerie images pour template phpbb
vendredi 18 mars 2011 à 07:15:46 |
Gallerie images pour template phpbb

McGyver59
|
Bonjour
Voila j'essaie d'afficher un nombre d'images par pages mais cela n'a pas l'air de fonctionner car il y a qu'une seule image qui s'affiche au lieu de six qui sont dans ma bdd. donc si une ame charitable pouvait m'aider se serais gentil
Voici mes fichiers et quelle erreur je fais
Code PHP : <?php
require('header.php');
loadLanguage('lang-download');
loggedonly();
$template->set_filenames(array('download' => 'download.tpl'));
if($CURUSER["view_download"]=="no")
autolink("index.php", "".DOWN_NOT_PERMISSION."");
//get http vars
$addparam = "";
$wherea = array();
$wherea[] = "online = 'yes'";
if ($CURUSER["view_xxx"] != "yes") {
$wherea[] = "category != '20'"; }
$thisurl = "download.php?";
if ($_GET["cat"]) {
$wherea[] = "category = " . sqlesc($_GET["cat"]);
$addparam .= "cat=" . urlencode($_GET["cat"]) . "&";
$thisurl .= "cat=".urlencode($_GET["cat"])."&";
}
if ($_GET["parent_cat"]) {
$addparam .= "parent_cat=" . urlencode($_GET["parent_cat"]) . "&";
$thisurl .= "parent_cat=".urlencode($_GET["parent_cat"])."&";
$wherea[] = "categories.parent_cat=".sqlesc($_GET["parent_cat"]);
}
$parent_cat = unesc($_GET["parent_cat"]);
$category = (int) $_GET["cat"];
$where = implode(" AND ", $wherea);
$wherecatina = array();
$wherecatin = "";
$res = mysql_query("SELECT id FROM categories");
while($row = mysql_fetch_assoc($res)){
if ($_GET["c$row[id]"]) {
$wherecatina[] = $row[id];
$addparam .= "c$row[id]=1&";
$thisurl .= "c$row[id]=1&";
}
$wherecatin = implode(", ", $wherecatina);
}
if ($wherecatin)
$where .= ($where ? " AND " : "") . "category IN(" . $wherecatin . ")";
if ($where != "")
$where = "WHERE $where";
if ($_GET["sort"] || $_GET["order"]) {
switch ($_GET["sort"]) {
case 'name': $sort = "download.name"; $addparam .= "sort=name&"; break;
case 'comments': $sort = "download.comments"; $addparam .= "sort=comments&"; break;
default: $sort = "download.id";
}
if ($_GET["order"] == "asc" || ($_GET["sort"] != "id" && !$_GET["order"])) {
$sort .= " ASC";
$addparam .= "order=asc&";
} else {
$sort .= " DESC";
$addparam .= "order=desc&";
}
$orderby = "ORDER BY $sort";
}else{
$orderby = "ORDER BY download.added DESC";
$_GET["sort"] = "added";
$_GET["order"] = "desc";
}
//Get Total For Pager
$res = mysql_query("SELECT COUNT(*) FROM download LEFT JOIN categories ON category = categories.id $where $parent_check") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
//get sql info
if ($count) {
list($pagertop, $pagerbottom, $limit) = pager(20, $count, "download.php?" . $addparam);
$query = "SELECT download.id, download.banned, download.name, download.owner, download.numratings, download.descr, download.online, download.added, download.edit_by, download.comments, download.views, download.hits, download.id, download.image1, download.link, download.tags, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, IF(download.numratings < 2, NULL, ROUND(download.ratingsum / download.numratings, 1)) AS rating FROM download LEFT JOIN categories ON category = categories.id LEFT JOIN users ON download.owner = users.id $where $parent_check $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
}else{
unset($res);
}
$expire = 7200; // Time in seconds
if (is_valid_id($_GET["page"]))
$thisurl .= "page=$_GET[page]&";
if ($count) {
$nbcols = 6;
$table = '<table cellpadding="0" cellspacing="0" />';
while ($row = mysql_fetch_assoc($res)) {
$tab[] = $row;
}
$count = count($tab);
for($i = 0; $i < $count; $i++) {
if(($i % $nbcols) == 0) {
$tr = '<tr>';
}
$id = $tab[$i]["id"];
/*On coupe le nom du fichier si depasse 18 caractéres*/
$char1 = 18; //cut name length
$smallname = CutName(htmlspecialchars($tab[$i]["name"]), $char1);
/*
$last_access = $CURUSER["last_browse"];
$time_now = gmtime();
if ($last_access > $time_now || !is_numeric($last_access)) {
$last_access = $time_now;
}
$resdet = mysql_query("SELECT tags, views, hits, date, added, edit_by, last_edit, exclue, downloaded, downlang.name AS lang_name, downlang.image AS lang_image, categories.name AS cat_name, host.name AS heberg_name, host.image AS heberg_image FROM download LEFT JOIN downlang ON downlang = downlang.id LEFT JOIN host ON download.host = host.id LEFT JOIN categories ON download.category = categories.id WHERE download.id = $id") or die(mysql_error());
$rowdet = mysql_fetch_array($resdet);
$bimg = @mysql_fetch_array(@mysql_query("SELECT image1 FROM download WHERE id=$id"));
$balon =($bimg["image1"] ? "$site[SITEURL]/uploads/images/" . htmlspecialchars($bimg["image1"]) : "images/nocover.jpg");
$lang = "<img border='0' src='" . $site["SITEURL"] . "/images/languages/" . $rowdet["lang_image"] . "' />";
$hebergeur = "<img border=0 width=16 src=" . $site['SITEURL'] . "/images/hebergeur/" . $rowdet["heberg_image"] . " />";
$hebergeurs = "" . $rowdet["heberg_name"] . "";
if (sql_timestamp_to_unix_timestamp($tab[$i]["added"]) >= $last_access) {
$dispname .= "<b>".$smallname."<font color=red>("._NEW."!)</font></b>";
}
/*<!-- DIV POUR EXCLUE -->*/
$edited = $rowdet["last_edited"];
if ($edited == "yes") {
$edited = "<b>Oui</b>";
} else {
$edited = "<b>Non</b>";
}
$exclue = $rowdet["exclue"];
$exclues = $rowdet["exclue"];
if ($exclue == "yes") {
$exclue = "<b>Oui</b>";
} else {
$exclue = "<b>Non</b>";
}
/*On coupe le nom de la release si depasse 18 caractéres*/
$char1 = 18; //cut name length
$release = CutName(htmlspecialchars($rowdet["tags"]), $char1);
$index_item = "<div class='index_item'>
<a href=\"details.php?id=".$tab[$i]["id"]."&hit=1\" onMouseover=\"return overlib('<table width=100% class=overlib_col1 cellspacing=0 cellpadding=5 align=center><tr><td class=overlib_head colspan=2 align=center>$smallname</td></tr><tr valign=top><td align=center><img src=$balon width=120 border=0></td><td><div align=left><b>Release: <b>".$release."<b><br>".DATE_ADDED.":<b> ".date("d-m-Y ", utc_to_tz_time($tab[$i]["added"]))."</b><br /><b>Posté par: </b>" .$tab[$i]["username"]. "<br /><b>".DETAIL_DATE_EDIT.":<b> ".date("d-m-Y ", utc_to_tz_time($rowdet["last_edit"]))."</b><br /><b>".DATE_EDIT_BY2.": </b>" .$rowdet["edit_by"]. "<br />".TTYPE.":<b> ".$tab[$i]["cat_name"]."</b><br><b>" . VIEWS . ": <b>".$rowdet["views"]."<br>" . COMMENTS . ": <b>".$tab[$i]["comments"]."</b><br />Hébergeur: <b>$hebergeurs</b><br /><b>Language: <img border=0 src=" . $site["SITEURL"] . "/images/languages/" . $rowdet["lang_image"] . " alt=" . $rowdet["lang_name"] . " /><br /></div></td></tr></table>')\"; onMouseout=\"return nd()\"><img class='glossy' src='".$balon."' width='120' height='160' hspace='4'></a>
</div>";
$td = "</td><td width='10'> </td>";
if(($i % $nbcols) == ($nbcols - 1)) {
$tr_fin = '</tr>';
}
}
$pagetop = $pagerbottom;
//fin
// Mettre ici l'envoi des données au gabarit
$template->assign_vars(
array
(
'TABLE' => $table,
'TR' => $tr,
'INDEX_ITEM' => $index_item,
'TD' => $td,
'TR_FIN' => $tr_fin,
'PAGETOP' => $pagetop,
)
);
}
// Affichage du handle "index"
$template->pparse('download');
// Affichage du handle "footer"
require('footer.php');
?>
le template
Code PHP : <div id="corpshaut"></div>
<div id="corps">
<p>
{TABLE}
{TR}
<td background='images/box-stream-video.png' width='155' height='220' />
{INDEX_ITEM}
{TD}
{TR_FIN}
</table><center><br>
{PAGETOP}
</p>
<div style="clear: both"></div>
</div>
<div id="corpsbas"></div>
Je vous remercie de votre aide
|
|
Cette discussion est classée dans : id, name, get, cat, download
Répondre à ce message
Sujets en rapport avec ce message
download.php?id=5 ????kesako [ par theenjoy ]
comment on fait ca ?Exemple, je stocke tous mes liens dans une base sql et je veuut remplacer les liens du style www.moi.com/download/archive.zip en w
Affichage Arborescence menu mysql [ par cseagle ]
Bonjour tout le monde,Je veux faire une gestion de menu dans mysql.J'ai créé deux tables : menu et menu_catDans menu_cat je rentre les titres des caté
Script de téléchargement [ par The_Sniper ]
Bonjour je suis en trin de faire un script de téléchargement mais je suis bloquer a la place ou je doit ajouter dans mon champ id_cat de ma table télé
probleme pour création d'un caddie.. [ par bleyboyred1 ]
Bonjour , Ben voila ,enfet j ai créé un panier virtuel mais quand je me rend sur la page de se panier , il ne m'affiche pas d'erreurs ; le probleme c
Paginer une galerie [ par bricethenetman ]
Ci dessous se trouve un bout de code pour gérer une galerie (je l'ai fais avec l'aide d'anthomicro et des bout de codes trouvés par ci par là
Probleme avec mail() [ par chatainsim ]
Bonjour, j'ai un probléme avec la fonction mail() j'utilise ce code pour l'envoie de mail : require("../admin/config.php"); $sujet = "Des nouvelles
requetes sql [ par billy67000 ]
table1 categories cat_id cat_images parent_id 1 images1 1 2
Requète sur deux tables, problème de tri :s [ par SDK_akira ]
Bonjour tout le monde :) J'essaie de programmer une gallerie d'image, pour ce faire j'ai fait 3 tables : 1 table gall_cat_hxh : id (int) // id de l
Affichage d'une requête mysql par rapport à l'ID [ par Tilix ]
Bonjour, Je voudrais affichier une requete mysql par rapport à l'ID sans faire de répétition dans la page.Ex :if(isset($_GET['ID'])
Probleme d'affichage dans une liste déroulante [ par JohnInsane ]
Bonjour à tous, Voilà j'ai un problème, j'ai fais un script où l'on choisit une catégorie dans une liste déroulante qui est dans la table cat où j'a
Livres en rapport
|
Derniers Blogs
POUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDNPOUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDN par neodante
Quelle est le point commun entre : Microsoft il y a 10 ans et Apple aujourd'hui ? Réponse: avoir une politique de protocoles propriétaires et fermés :) Car pour rappel (si si je vous assure c'est important de le rappeler), la majorité des spécifications e...
Cliquez pour lire la suite de l'article par neodante JOYEUX ANNIVERSAIRE NIXJOYEUX ANNIVERSAIRE NIX par ebartsoft
Souhaitons un bon et joyeux anniversaire à notre hôte à tous, Nix.
Je ne le répéterais jamais assez mais sans lui rien ne serait possible. Il défit en permanence les lois de la gravité et comme il le dit si bien, si tu lui fais confiance ça devra...
Cliquez pour lire la suite de l'article par ebartsoft IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|