Re: [Forum] Ajouter un champ du profil - Localisation

J'ai essayé avec le code ci dessous mais rien ne se passe...
Ni en bien, ni en mal...:hein:
Si vous pouviez m'aider svp
J'ai collé le code en entier pour qu'il n'y ait pas d'ambiguïté
Merci

[hide=t]
Citation :

Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
  1. <?php
  2. // $Id: bloc.php 889 2010-01-25 Calfou $
  3.  
  4. if (!(defined('__KWS__'))) {die ('Erreur d\'appel de fichier.');}
  5.  
  6. //*************************
  7. //* ICONES ESPACE MEMBRES *
  8. //*************************
  9. // Affichage de la structure de l'espace membres
  10. function admin_bloc ($titre, $image, $lien, $x)
  11. {
  12.     if (empty($image) or !file_exists($image))
  13.     {
  14.         $image = './themes/'.$GLOBALS['theme'].'/images/modules/koi.png';
  15.     }
  16.  
  17.     echo '<td style="width: 25%; text-align: center">
  18.         <p style="text-align:center;">
  19.             <a href="'.$lien.'"><img src="'.$image.'" alt="Image" style="border:none" /><br />'.$titre.'</a>
  20.         </p>
  21.     </td>';
  22.     if ($x == 4)
  23.     {
  24.         echo '</tr>
  25.         <tr>
  26.             <td>&nbsp;</td>
  27.         </tr>
  28.         <tr>' ;
  29.         $x = 0;
  30.     }
  31.     return $x;
  32. }
  33.  
  34. //*********
  35. //* BLOCS *
  36. //*********
  37. // Blocs principaux (Menu, intro)
  38. function bloc ($titre, $contenu)
  39. {
  40.     global $result_bloc;
  41.  
  42.     if (file_exists('./themes/'.$GLOBALS['theme'].'/images/blocs/'.$result_bloc[module].'.png'))
  43.     {
  44.         $class_bloc = $result_bloc[module];
  45.     }
  46.     else
  47.     {
  48.         $class_bloc = 'vide';
  49.     }
  50.  
  51. /*
  52.     echo '<div class="bloc_titre" style="background-image:url(\'./themes/aquarelle/images/blocs/'.$class_bloc.'.png\'); "  >'.($class_bloc == 'vide' ? ''.$titre : '').'</div>
  53.     <div class="bloc_contenu">'.$contenu.'</div>
  54.     <div class="bloc_footer"></div>';
  55. */
  56.  
  57.     echo '<table style="width:100%; border:none" cellpadding="0" cellspacing="0" summary="bloc">
  58.         <tr>
  59.             <td><div class="imgbloc_01">&nbsp;</div></td>
  60.             <td style="text-align:center" class="imgbloc_02" nowrap="nowrap">'.(empty($titre) ? '&nbsp;' : $titre).'</td>
  61.             <td><div class="imgbloc_03">&nbsp;</div></td>
  62.         </tr>
  63.         <tr>
  64.             <td class="bloc_left">&nbsp;</td>
  65.             <td>'.(empty($contenu) ? '&nbsp;' : $contenu).'</td>
  66.             <td class="bloc_right">&nbsp;</td>
  67.         </tr>
  68.         <tr>
  69.             <td class="bloc_footer_01">&nbsp;</td>
  70.             <td class="bloc_footer_02">&nbsp;</td>
  71.             <td class="bloc_footer_03">&nbsp;</td>
  72.         </tr>
  73.     </table>';
  74. }
  75.  
  76. // Les blocs avec un titre
  77. function bloc_head ($titre)
  78. {
  79.     echo '<table style="width:100%; border:none" cellpadding="0" cellspacing="0" summary="bloc_head">
  80.         <tr>
  81.             <td><div class="imgbloc_01">&nbsp;</div></td>
  82.             <td style="text-align:center" class="imgbloc_02" nowrap="nowrap">'.(empty($titre) ? '&nbsp;' : $titre).'</td>
  83.             <td><div class="imgbloc_03">&nbsp;</div></td>
  84.         </tr>
  85.         <tr>
  86.             <td class="bloc_left">&nbsp;</td>
  87.             <td class="blocline">';
  88. }
  89.  
  90. // Les blocs sans titre
  91. function open_table ()
  92. {
  93.     echo '<table style="width:100%; border:none" cellpadding="0" cellspacing="0" summary="open_table">
  94.         <tr>
  95.             <td><div class="bloc_vide_01">&nbsp;</div></td>
  96.             <td style="text-align:center" class="bloc_vide_02" >&nbsp;</td>
  97.             <td><div class="bloc_vide_03">&nbsp;</div></td>
  98.         </tr>
  99.         <tr>
  100.             <td class="bloc_left">&nbsp;</td>
  101.             <td style="width: 100%">';
  102. }
  103.  
  104. // Fin des blocs
  105. function close_table ()
  106. {
  107.             echo '</td>
  108.             <td class="bloc_right">&nbsp;</td>
  109.         </tr>
  110.         <tr>
  111.             <td class="bloc_footer_01">&nbsp;</td>
  112.             <td class="bloc_footer_02">&nbsp;</td>
  113.             <td class="bloc_footer_03">&nbsp;</td>
  114.         </tr>
  115.     </table>';
  116. }
  117.  
  118. //********
  119. //* NEWS *
  120. //********
  121. function bloc_news ($titre, $date, $auteur, $image, $contenu, $hit, $id_comment, $id_auteur, $nbcomm, $avatar)
  122. {
  123.     global $grade;
  124.  
  125.     if ($grade >= GRD_MODOG)
  126.     {
  127.         $editer = '<br />
  128.         <br />
  129.         <a href="index.php?mod=news&amp;ac=gestion&amp;faire=edit&amp;id='.$id_comment.'">Editer</a>&nbsp;&nbsp;';
  130.     }
  131.  
  132.     $hits = $hit.' lecture'.($hit>1 ? 's' : '');
  133.  
  134.     $date = kws_date('d/m/Y H:i',$date).' par <a href="index.php?mod=espace_membre&amp;ac=profil&amp;id='.$id_auteur.'">'.$auteur.'</a>';
  135.  
  136.     if ($GLOBALS['ac'] != 'commentaires')
  137.     {
  138.         if ($nbcomm==0)
  139.         {
  140.             $commentaire = '<br />
  141.             <img src="themes/'.$GLOBALS['theme'].'/images/news/ajout_commentaire.png" alt="ajout commentaire" border="0" />&nbsp;<a href="index.php?mod=news&amp;ac=commentaires&amp;id='.$id_comment.'">Ajouter un commentaire</a>';
  142.         }
  143.         elseif ($nbcomm==1)
  144.         {
  145.             $commentaire = '<br />
  146.             <img src="themes/'.$GLOBALS['theme'].'/images/news/commentaire.png" alt="1 commentaire" border="0" />&nbsp;<a href="index.php?mod=news&amp;ac=commentaires&amp;id='.$id_comment.'">1 commentaire</a>';
  147.         }
  148.         else
  149.         {
  150.             $commentaire = '<br />
  151.             <img src="themes/'.$GLOBALS['theme'].'/images/news/commentaire.png" alt="+ commentaires" border="0" />&nbsp;<a href="index.php?mod=news&amp;ac=commentaires&amp;id='.$id_comment.'">'.$nbcomm.' commentaires</a>' ;  
  152.         }
  153.     }
  154.  
  155.     // Affichage des news
  156.     echo '<table style="width:100%; border:none" cellpadding="0" cellspacing="0" class="bodyline" summary="'.$mod.'">
  157.         <tr>
  158.             <td><div class="imgbloc_01">&nbsp;</div></td>
  159.             <td style="text-align:center" class="news" nowrap="nowrap"><a class="cattitle" href="index.php?mod=news&amp;ac=commentaires&amp;id='.$id_comment.'">'.$titre.' ['.$hits.']</a>&nbsp;</td>
  160.             <td><div class="imgbloc_03">&nbsp;</div></td>
  161.         </tr>
  162.         <tr>
  163.             <td class="bloc_left">&nbsp;</td>
  164.             <td class="contenu_news">
  165.                 <span class="date">'.$date.'&nbsp;</span>
  166.                 <hr />
  167.                 <img  class="img_news" src="'.$image.'" alt="'.$image.'" border="0"  />
  168.                 <div align="justify" >'.$contenu.'</div>
  169.                 '.$commentaire.'<span>'.$editer.'&nbsp;</span>
  170.             </td>
  171.             <td class="bloc_right">&nbsp;</td>
  172.         </tr>
  173.         <tr>
  174.             <td class="bloc_footer_01">&nbsp;</td>
  175.             <td class="bloc_footer_02">&nbsp;</td>
  176.             <td class="bloc_footer_03">&nbsp;</td>
  177.         </tr>
  178.     </table>';
  179. }
  180.  
  181. //************
  182. //* ARTICLES *
  183. //************
  184. # Les Articles
  185. function bloc_article_cat ($id, $titre, $image, $contenu)
  186. {
  187.     if (!empty($image))
  188.     {
  189.         $image = '<a href="index.php?mod=articles&amp;ref='.$id.'"><img class="img_news" src="'.$image.'" style="float:right; border:0" alt="'.$image.'" /></a>';
  190.     }
  191.     //affichage
  192.     echo '<table cellspacing="0" cellpadding="0" summary="'.$mod.'">
  193.         <tr>
  194.             <td><div class="imgbloc_01">&nbsp;</div></td>
  195.             <td class="imgbloc_02"><a class="cattitle" href="index.php?mod=articles&amp;ref='.$id.'">'.$titre.'</a></td>
  196.             <td><div class="imgbloc_03">&nbsp;</div></td>
  197.         </tr>
  198.         <tr>
  199.             <td class="bloc_left">&nbsp;</td>
  200.             <td style="text-align:left;">'.$image.$contenu.'</td>
  201.             <td class="bloc_right_article">&nbsp;</td>
  202.         </tr>
  203.         <tr>
  204.             <td class="bloc_footer_01">&nbsp;</td>
  205.             <td class="bloc_footer_02">&nbsp;</td>
  206.             <td class="bloc_footer_03">&nbsp;</td>
  207.         </tr>
  208.     </table>';
  209. }
  210.  
  211. function bloc_rubrique_cat ($id, $titre, $image, $contenu)
  212. {
  213.     global $mod;
  214.     if (!empty($image))
  215.     {
  216.         $image = '<a href="index.php?mod='.$mod.'&amp;action='.$mod.'&amp;ref='.$id.'">    <img src="'.$image.'" align="left" border="0" alt="'.$image.'" /></a><br />' ;
  217.     }
  218.  
  219.     echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cadre" summary="'.$mod.'">';
  220.         if($titre)
  221.         {
  222.             echo'<tr>
  223.                 <td align="left" valign="middle" class="titre_blocs">
  224.                     <a href="index.php?mod='.$mod.'&amp;action='.$mod.'&amp;ref='.$id.'"><span class="cattitle">&nbsp;&nbsp;'.$titre.'</span></a>
  225.                 </td>
  226.             </tr>';
  227.         }
  228.         echo'<tr>
  229.             <td align="left" valign="top">'.$image.'&nbsp;'.$contenu.'</td>
  230.         </tr>
  231.     </table>
  232.     <br />';
  233. }
  234.  
  235. //************
  236. //* LE FORUM *
  237. //************
  238. function forum_rep_head()
  239. {
  240.     bloc_head('');
  241.     echo '<!--  Entêtes des posts du forum (forum_rep_head) -->
  242.     <table style="width:100%; border:0;" cellspacing="0" cellpadding="0" summary="Contenu des posts forum">';
  243. }
  244.  
  245. function forum_rep_mid ($auteur, $message, $signature, $date, $type, $id, $contact=null)
  246. {
  247.     echo '<!--  Contenu des posts du forum (forum_rep_mid)  -->
  248.     <tr>
  249.         <td style="width:100%;">
  250.             <div style="text-align:left;">';
  251.                 open_table();
  252.                 echo '<table style="width:100%; border:0;" cellspacing="0" cellpadding="0" summary="Post">
  253.                     <tr>
  254.                         <td style="width:20%; vertical-align:top; text-align:center;">'.$auteur.''.(!empty($TabInfoProfil['localisation']) ? '<br />Localisation : '.$TabInfoProfil['localisation'].'' : '').'</td>
  255.                         <td style="width:75%; vertical-align:top">
  256.                             <span class="forum_date">'.$date.'</span>
  257.                             <hr />
  258.                             <p>'.$message.'</p>';
  259.                             if (!empty($signature))
  260.                             {
  261.                                 echo '<hr />
  262.                                 <p>'.$signature.'</p>';
  263.                             }
  264.                             if (!empty($contact))
  265.                             {
  266.                                 echo '<hr />
  267.                                 <p>'.$contact.'</p>';
  268.                             }
  269.                             echo '<div style="text-align:right"><a href="./index.php?'.ax($_SERVER['QUERY_STRING']).'#">Remonter</a></div>
  270.                         </td>
  271.                     </tr>
  272.                 </table>
  273.                 <br />' ;
  274.                 close_table();
  275.             echo '</div>
  276.         </td>
  277.     </tr>';
  278. }
  279.  
  280. function forum_rep_sep ()
  281. {
  282.     echo '<!--  Séparateur des posts du forum (forum_rep_sep)-->
  283.     <tr style="height:5px;">
  284.         <td>&nbsp;</td>
  285.     </tr>';
  286. }
  287.  
  288. function forum_rep_close ()
  289. {
  290.     echo '<!--  Fermeture des posts du forum (forum_rep_close)  -->
  291.     </table>';
  292.     close_table();
  293. }
  294.  
  295. # Entetes du forum
  296. function forum_head ()
  297. {
  298.     echo '<!--  Sujets du forum  entêtes (forum_head)  -->';
  299.     open_table();
  300.     echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="Sujets du forum">
  301.         <tr>
  302.             <td class="forum_titre_left">&nbsp;</td>
  303.             <td class="forum_titre" colspan="1">&nbsp;&nbsp;Sujets&nbsp;&nbsp;</td>
  304.             <td class="forum_titre" style="text-align:center;">&nbsp;&nbsp;R&eacute;ponses&nbsp;&nbsp;</td>
  305.             <td class="forum_titre" style="text-align:center;">&nbsp;&nbsp;Auteur&nbsp;&nbsp;</td>
  306.             <td class="forum_titre" style="text-align:center;">&nbsp;&nbsp;Vus</td>
  307.             <td class="forum_titre" style="text-align:center;">&nbsp;&nbsp;Derniers&nbsp;&nbsp;</td>
  308.             <td class="forum_titre_right">&nbsp;</td>
  309.         </tr>';
  310. }
  311.  
  312. function forum_mid ($image, $titre, $rep, $auteur, $hits, $dernier)
  313. {
  314.     echo '<!--  Contenu des sujets du forum (forum_mid)  -->
  315.     <tr align="left" onmouseover="this.className = \'onmouse_over_forum\';" onmouseout="this.className = \'onmouse_out_forum\';">
  316.         <td style="text-align:center;"><img src="'.$image.'" style="border:none" /></td>
  317.         <td style="text-align:left; width:70%;">&nbsp;&nbsp;&nbsp;'.$titre.'</td>
  318.         <td style="text-align:center; width:5%;">'.$rep.'</td>
  319.         <td style="text-align:center; width:10%;">'.$auteur.'</td>
  320.         <td style="text-align:center; width:5%;">'.$hits.'</td>
  321.         <td style="text-align:center;  width:10%;">'.$dernier.'</td>
  322.     </tr>';
  323. }
  324.  
  325. function forum_close ()
  326. {
  327.     echo '<!--  Fermeture des sujets du forum (forum_close) -->
  328.     </table>' ;
  329.     close_table();
  330. }
  331.  
  332. # Les Catégories du forum
  333. function forum_cat_head ()
  334. {
  335.     open_table();
  336.     echo '<!--  Entêtes des catégories de forum (forum_cat_head)  -->
  337.     <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="Catégories du forum">
  338.         <tr>
  339.             <td class="forum_titre_left"></td>
  340.             <td class="forum_titre" colspan="1">Forum</td>
  341.             <td class="forum_titre">Sujets</td>
  342.             <td class="forum_titre">R&eacute;ponses</td>
  343.             <td class="forum_titre" style="text-align:center; width:20%;">Dernier post</td>
  344.             <td class="forum_titre_right">&nbsp;</td>
  345.         </tr>';
  346. }
  347.  
  348. function forum_cat_mid ($image, $titre, $desc, $nb_sujet, $nb_rep, $dernier, $id)
  349. {
  350.     echo '<!--  Contenu des catégories (forum_cat_mid)  -->
  351.     <tr onmouseover="this.className = \'onmouse_over_forum\';" onmouseout="this.className = \'onmouse_out_forum\';">
  352.         <td width="45" align="left" valign="top"><img src="'.$image.'" /></td>
  353.         <td class="forum_cat_mid" >
  354.             '.$titre.'<br />
  355.             '.$desc.'
  356.         </td>
  357.         <td style="text-align:center; width:10%;">'.$nb_sujet.'</td>
  358.         <td style="text-align:center; width:10%;">'.$nb_rep.'</td>
  359.         <td style="text-align:left; width:20%;">'.$dernier.'</td>
  360.     </tr>';
  361. }
  362.  
  363. # Les Séparations
  364. function forum_cat_sep ($titre)
  365. {
  366.     echo '<!--  Séparateurs de catégories  -->
  367.     <tr>
  368.         <td class="forum_titre_left"></td>
  369.         <td class="forum_separ" colspan="4" ><span>&nbsp;'.$titre.'</span></td>
  370.         <td class="forum_titre_right"></td>
  371.     </tr>';
  372. }
  373.  
  374. function forum_cat_close ()
  375. {
  376.     forum_close();
  377. }
  378. ?>


[/hide]


Sujet écrit par lboubou le jeudi 4 mars 2010 à 00:50

[ Imprimer ] - [ Fermer la fenêtre ]