Guest User

Code

a guest
Jan 15th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.02 KB | None | 0 0
  1. <?php
  2.  
  3. while($donnees = mysql_fetch_array($retour)){
  4.    
  5.     if($donnees['existe']=="non"){
  6.    
  7.         if($donnees['sexe']=="M"){
  8.             $sexe = "<font color='blue'>Garçon</font>";
  9.         } else {
  10.             $sexe = "<font color='deeppink'>Fille</font>";
  11.         }
  12.    
  13.     }
  14.    
  15.    
  16.     if(getNbPhoto($donnees['pseudo'])=="1"){
  17.     $phrase = "Voir sa photo";
  18.     } else {
  19.     $phrase = "Voir ses ".getNbPhoto($donnees['pseudo'])." photos";
  20.     }
  21.    
  22.    
  23.     $dom = new DomDocument;
  24.     $dom->load('http://forum.transformice.com/miceinfo.xml?n='.$donnees['pseudo'].'&l=fr');
  25.            
  26.         $micetitlelabel = $dom->getElementsByTagName('micetitlelabel');
  27.         foreach($micetitlelabel as $titre)
  28.             $affich_titre = UCWORDS($titre->firstChild->nodeValue);
  29.            
  30.         $tribe = $dom->getElementsByTagName('tribe');
  31.         foreach($tribe as $tribu)
  32.             $affich_tribu = UCWORDS($tribu->firstChild->nodeValue);
  33.            
  34.         $rounds = $dom->getElementsByTagName('rounds');
  35.         foreach($rounds as $parties)
  36.             $affich_parties = $parties->firstChild->nodeValue;
  37.            
  38.         $cheese = $dom->getElementsByTagName('cheese');
  39.         foreach($cheese as $fromage)
  40.             $affich_fromage = $fromage->firstChild->nodeValue;
  41.            
  42.         $chamansave = $dom->getElementsByTagName('chamansave');
  43.         foreach($chamansave as $sauver)
  44.             $affich_sauver = $sauver->firstChild->nodeValue;
  45.            
  46.         $first = $dom->getElementsByTagName('first');
  47.         foreach($first as $premier)
  48.             $affich_premier = $premier->firstChild->nodeValue;
  49.            
  50.         $micetitle = $dom->getElementsByTagName('micetitle');
  51.         foreach($micetitle as $nombre_titre)
  52.             $affich_nombre_titre = $nombre_titre->firstChild->nodeValue;
  53.            
  54.             $cent = '100';
  55.        
  56.             $calcul_first = $affich_premier / $affich_parties * $cent;
  57.             $pourcentage_first = number_format($calcul_first  , 2   );
  58.        
  59.             $calcul_fromage = $affich_fromage / $affich_parties * $cent;
  60.             $pourcentage_fromage = number_format($calcul_fromage  , 2   );
  61.            
  62. $tg = str_replace("é","é",$affich_tribu);
  63. $tg = str_replace("è","è",$tg);
  64. $tg = str_replace("Ã","à",$tg);
  65. $tg = str_replace("ô","ô",$tg);
  66. $tg = str_replace("â","a",$tg);
  67. $tg = str_replace("î","î",$tg);
  68. $tg = str_replace("à«","ë",$tg);
  69. $tg = str_replace("à‰","É",$tg);
  70. $tg = str_replace("àª","ê",$tg);
  71. $tg = str_replace("©","©",$tg);
  72.  
  73. if($tg == ""){
  74.     $titre_verif = "<font color='dimgray'><i>Aucune</i></font>";
  75. } else {
  76.     $titre_verif = $tg;
  77. }
  78.  
  79. $tb = str_replace("é","é",$affich_titre);
  80. $tb = str_replace("è","è",$tb);
  81. $tb = str_replace("Ã","à",$tb);
  82. $tb = str_replace("ô","ô",$tb);
  83. $tb = str_replace("â","a",$tb);
  84. $tb = str_replace("î","î",$tb);
  85. $tb = str_replace("à«","ë",$tb);
  86. $tb = str_replace("à‰","É",$tb);
  87. $tb = str_replace("àª","ê",$tb);
  88. $tb = str_replace("©","©",$tb);
  89.            
  90.        
  91.         if($donnees['existe']=="non"){
  92.         echo '  <tr>
  93.                     <td class="td-pseudo">
  94.                         <b>'.$donnees['pseudo'].'</b>
  95.                     </td>
  96.                    
  97.                     <td class="td-photo">
  98.                         '.getNbPhoto($donnees['pseudo']).'
  99.                     </td>
  100.                    
  101.                     <td class="td-pseudo">
  102.                         '.$affich_parties.'
  103.                     </td>
  104.                    
  105.                     <td class="td-photo">
  106.                         '.$affich_fromage.'
  107.                     </td>
  108.                    
  109.                     <td class="td-pseudo">
  110.                         '.$affich_premier.'
  111.                     </td>
  112.                    
  113.                     <td class="td-photo">
  114.                         '.$affich_sauver.'
  115.                     </td>
  116.                    
  117.                     <td class="td-pseudo">
  118.                         N°'.$affich_nombre_titre.'
  119.                     </td>
  120.                    
  121.                     <td class="td-photo">
  122.                         '.$tb.'
  123.                     </td>
  124.                    
  125.                     <td class="td-pseudo">
  126.                         '.$titre_verif.'
  127.                     </td>
  128.                    
  129.                     <td class="td-photo">
  130.                         '.$pourcentage_fromage.' %
  131.                     </td>
  132.                    
  133.                     <td class="td-pseudo">
  134.                         '.$pourcentage_first.' %
  135.                     </td>
  136.                    
  137.                     <td class="td-photo">
  138.                         <a href="./photo.php?pseudo='.$donnees['pseudo'].'">'.$phrase.'</a>
  139.                     </td>
  140.                    
  141.                     <td class="td-pseudo">
  142.                         '.$sexe.'
  143.                     </td>
  144.                    
  145.                    
  146.                 </tr>
  147.                    
  148.             ';
  149.         }
  150.        
  151.     }
  152.  
  153. ?>
Advertisement
Add Comment
Please, Sign In to add comment