Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[Résolu]Le retour de ma balise qui liste les fichiers d'un dossier
#18
Pour cette ligne : $dir = $config['root_path']."\uploads\telechargements\\".$params['name'];
C'est pas plutôt comme ça : $dir = $config['root_path']."/uploads/telechargements//".$params['name'];

Mon code marchait plutôt bien (même s'il a des défauts comme tu me le montres et merci de le faire).

du coup en changeant cette ligne quand je fais {get_template_vars} : j'obtiens
Code :
[== Indéfini ==]
ex3 = LAPPUI72
fichier = <ul style="line-height:0px;"><div align="center" style="text-align:left; margin-left:50px;"><li style="list-style-type:none;"><a href="/uploads/telechargements/LAPPUI72/présence u19.xlsx"><img src="uploads/telechargements/icones/Excel.png" title="présence u19.xlsx"></a>
<a href="/uploads/telechargements/LAPPUI72/présence u19.xlsx" title="présence u19">présence u19</a></li><br/></div>

donc il récupère bien mon fichier.

Maintenant je voudrais faire comme les news, si pas de fichier dans le dossier je n'affiche rien (pour le moment j'ai un logo download tout le temps).

Code :
[== Indéfini ==]
{* Affiche les fichiers a telecharger *}
{page_attr key="extra3" assign="ex3"}
{capture assign='fichier'}
{telechargements name= $ex3}
{/capture}
{if $ex3 != "" && $ex2 !=""}
{*if (file_exists($fichier))*}
{if (file_exists($smarty.capture.fichier))}
<div align="center" style="background-image: url(./uploads/telechargements/icones/download.png); background-position: 15px -10px; background-repeat: no-repeat; font-size: smaller; width:270px ; margin-left: 0px; padding:2px ; border-left:1px; border-right:1px; border-bottom:1px; border-top:1px; height:72px; margin-top:-78px;">
{$fichier}
</div>
{/if}
{else}
{*if (file_exists($fichier))*}
{if (file_exists($smarty.capture.fichier))}
<div align="center" style="background-image: url(./uploads/telechargements/icones/download.png); background-position: 15px -10px; background-repeat: no-repeat; font-size: smaller; width:270px ; margin-left: 160px; padding:2px ; border-left:1px; border-right:1px; border-bottom:1px; border-top:1px; height:72px; margin-top:-10px;">
{$fichier}
</div>
{/if}
{/if}
{*Fin telechargement*}

Mon soucis doit venir d'ici non ?
Cool


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)