Evolution download

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
  1. <?php
  2. // ---------------------------------------------------------------
  3. // KwsPHP kOoGar Web System
  4. // $Id: bloc.php 897 2010-02-26 12:01:10Z mike007.devpwsphp $
  5. // ---------------------------------------------------------------
  6. // Création : 07/10/07 par FouPouDave
  7. // ---------------------------------------------------------------
  8.  
  9. /**
  10. *    Sécurité
  11. */
  12. if (!(defined('__KWS__'))) {die ('Erreur d\'appel de fichier.');}
  13.  
  14. /** 
  15. *    Transformation des paramètres du module en variables
  16. */
  17. require './modules/download/parametres.php';
  18.  
  19. // ---------------------------------------------------------------
  20. if (get_grade()>=GRD_VISIT and is_module('download'))
  21. {
  22.     if (!isset($_REQUEST['critere']))
  23.     {
  24.         $_REQUEST['critere']='hit';
  25.     }
  26.     require './modules/download/trier.php';
  27.  
  28.     $dl_nbr_min = 10;
  29.     $dl_nbr_max = 0;
  30.  
  31.     $dl_liste_bloc = array();
  32.     foreach ($dl_liste_fichier as $dl_nom => $dl_fichier)
  33.     {
  34.         $dl_liste_bloc[$dl_nbr_max] = $dl_fichier;
  35.         $dl_nbr_max++;
  36.     }
  37.  
  38.     if ($dl_nbr_min > $dl_nbr_max)
  39.     {
  40.         $dl_nbr_min = $dl_nbr_max;
  41.     }
  42.  
  43.     $dl_nombre = $_POST['nbr_fichier'];
  44.     if (!is_numeric($dl_nombre))    $dl_nombre = $dl_nbr_min;
  45.     if ($dl_nombre<$dl_nbr_min)        $dl_nombre = $dl_nbr_min;
  46.     if ($dl_nombre>$dl_nbr_max)        $dl_nombre = $dl_nbr_max;
  47.  
  48.     $dl_bloc = '<div style="text-align:center;"><b>Top '.$dl_nombre.'</b></div>
  49.     <hr />
  50.     <table width="100%" summary="download top">';
  51.     for($dl_i=0; $dl_i<$dl_nombre; $dl_i++)
  52.     {
  53.         $dl_fichier = $dl_liste_bloc[$dl_i];
  54.         if (file_exists($dl_fichier->image_miniature))
  55.         {
  56.             $dl_image = '<img src="'.$dl_fichier->image_miniature.'" alt="Puce" />';
  57.         }
  58.         else
  59.         {
  60.             $dl_image = '<img src="themes/'.$K_theme.'/images/menu/puce.png" alt="Puce" />';
  61.         }
  62.         $dl_bloc.= '<tr>
  63.             <td width="1" valign="top">'.$dl_image.'</td>
  64.             <td><a href="index.php?mod=download&amp;ac=afficherid&amp;id='.$dl_fichier->id.'">'.(!empty($dl_fichier->titre) ? $dl_fichier->titre : basename($dl_fichier->fichier)).'</a></td>
  65.             <td align="center" width="1" valign="top"><em>'.$dl_fichier->hit.'</em></td>
  66.         </tr>';
  67.     }
  68.     $dl_bloc.= '</table>
  69.     <hr />
  70.     <div style="text-align:center;">
  71.         <form method="post" action="index.php">
  72.             Afficher les
  73.             <select name="nbr_fichier" onchange="submit()">';
  74.                 for ($dl_i=$dl_nbr_min; $dl_i<=$dl_nbr_max; $dl_i++)
  75.                 {
  76.                     $dl_bloc.= '<option value="'.$dl_i.'"'.($dl_nombre==$dl_i ? ' selected="selected"' : '').'>'.$dl_i.'</option>';
  77.                 }
  78.             $dl_bloc.= '</select>
  79.             fichiers<br />
  80.             <select name="critere" onchange="submit()">
  81.                 <option value="hit"'.($_POST['critere']=='hit' ? ' selected="selected"' : '').'>les + t&eacute;l&eacute;charg&eacute;s</option>
  82.                 <optgroup label="R&eacute;cemment:">
  83.                 <option value="date_hit"'.($_POST['critere']=='date_hit' ? ' selected="selected"' : '').'>T&eacute;l&eacute;charg&eacute;s</option>
  84.                 <option value="date_modification"'.($_POST['critere']=='date_modification' ? ' selected="selected"' : '').'>Mis &agrave; jour</option>
  85.                 <option value="date_creation"'.($_POST['critere']=='date_creation' ? ' selected="selected"' : '').'>Mis en ligne</option>
  86.                 </optgroup>
  87.             </select>
  88.         </form>
  89.         <hr/>
  90.         <a href="index.php?mod=download">liste exhaustive</a>
  91.     </div>';
  92.  
  93.     bloc($result_blocs->parametre1,$dl_bloc);
  94. }
  95. ?>


David


Sujet écrit par foupoudave le jeudi 6 décembre 2012 à 00:24

[ Imprimer ] - [ Fermer la fenêtre ]