jeudi 6 décembre 2012 à 00:24
Salut,
Pour une présentation personnalisée du bloc du module download
Changement ligne 54 et plus
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
// ---------------------------------------------------------------
// KwsPHP kOoGar Web System
// $Id: bloc.php 897 2010-02-26 12:01:10Z mike007.devpwsphp $
// ---------------------------------------------------------------
// Création : 07/10/07 par FouPouDave
// ---------------------------------------------------------------
-
/**
* Sécurité
*/
if (!(defined('__KWS__'))) {die ('Erreur d\'appel de fichier.');}
-
/**
* Transformation des paramètres du module en variables
*/
require './modules/download/parametres.php';
-
// ---------------------------------------------------------------
if (get_grade()>=GRD_VISIT and is_module('download'))
{
if (!isset($_REQUEST['critere']))
{
$_REQUEST['critere']='hit';
}
require './modules/download/trier.php';
-
$dl_nbr_min = 10;
$dl_nbr_max = 0;
-
$dl_liste_bloc = array();
foreach ($dl_liste_fichier as $dl_nom => $dl_fichier)
{
$dl_liste_bloc[$dl_nbr_max] = $dl_fichier;
$dl_nbr_max++;
}
-
if ($dl_nbr_min > $dl_nbr_max)
{
$dl_nbr_min = $dl_nbr_max;
}
-
$dl_nombre = $_POST['nbr_fichier'];
if (!is_numeric($dl_nombre)) $dl_nombre = $dl_nbr_min;
if ($dl_nombre<$dl_nbr_min) $dl_nombre = $dl_nbr_min;
if ($dl_nombre>$dl_nbr_max) $dl_nombre = $dl_nbr_max;
-
$dl_bloc = '<div style="text-align:center;"><b>Top '.$dl_nombre.'</b></div>
<hr />
<table width="100%" summary="download top">';
for($dl_i=0; $dl_i<$dl_nombre; $dl_i++)
{
$dl_fichier = $dl_liste_bloc[$dl_i];
if (file_exists($dl_fichier->image_miniature))
{
$dl_image = '<img src="'.$dl_fichier->image_miniature.'" alt="Puce" />';
}
else
{
$dl_image = '<img src="themes/'.$K_theme.'/images/menu/puce.png" alt="Puce" />';
}
$dl_bloc.= '<tr>
<td width="1" valign="top">'.$dl_image.'</td>
<td><a href="index.php?mod=download&ac=afficherid&id='.$dl_fichier->id.'">'.(!empty($dl_fichier->titre) ? $dl_fichier->titre : basename($dl_fichier->fichier)).'</a></td>
<td align="center" width="1" valign="top"><em>'.$dl_fichier->hit.'</em></td>
</tr>';
}
$dl_bloc.= '</table>
<hr />
<div style="text-align:center;">
<form method="post" action="index.php">
Afficher les
<select name="nbr_fichier" onchange="submit()">';
for ($dl_i=$dl_nbr_min; $dl_i<=$dl_nbr_max; $dl_i++)
{
$dl_bloc.= '<option value="'.$dl_i.'"'.($dl_nombre==$dl_i ? ' selected="selected"' : '').'>'.$dl_i.'</option>';
}
$dl_bloc.= '</select>
fichiers<br />
<select name="critere" onchange="submit()">
<option value="hit"'.($_POST['critere']=='hit' ? ' selected="selected"' : '').'>les + téléchargés</option>
<optgroup label="Récemment:">
<option value="date_hit"'.($_POST['critere']=='date_hit' ? ' selected="selected"' : '').'>Téléchargés</option>
<option value="date_modification"'.($_POST['critere']=='date_modification' ? ' selected="selected"' : '').'>Mis à jour</option>
<option value="date_creation"'.($_POST['critere']=='date_creation' ? ' selected="selected"' : '').'>Mis en ligne</option>
</optgroup>
</select>
</form>
<hr/>
<a href="index.php?mod=download">liste exhaustive</a>
</div>';
-
bloc($result_blocs->parametre1,$dl_bloc);
}
?>
David
Édité 2 fois - Dernière édition: 06/12/2012 à 00:26 Par foupoudave.
Indisponible pour raison professionnelle