From: <ara...@us...> - 2006-11-27 19:24:25
|
Revision: 53 http://svn.sourceforge.net/easybox-mod/?rev=53&view=rev Author: aragornis Date: 2006-11-27 11:23:32 -0800 (Mon, 27 Nov 2006) Log Message: ----------- Modified Paths: -------------- trunk/_framework/fonctions_partagees.inc.php trunk/_utilisateur/modules.db trunk/configuration/skin.php trunk/module/horoscope/index1.php trunk/module/modules/index1.php trunk/module/modules/modules.tpl Modified: trunk/_framework/fonctions_partagees.inc.php =================================================================== --- trunk/_framework/fonctions_partagees.inc.php 2006-11-26 19:40:53 UTC (rev 52) +++ trunk/_framework/fonctions_partagees.inc.php 2006-11-27 19:23:32 UTC (rev 53) @@ -553,7 +553,7 @@ } -function change_template($tpl){ +function change_skin($tpl){ global $RACINE_REP; function ClearDirectory($path){ @@ -588,6 +588,7 @@ $reini .=$subkey2.' = "'.$ini1[$key2][$subkey2]."\"\n"; } } + $handle = fopen($RACINE_REP.'_utilisateur/configuration.ini', "w"); fwrite($handle, $reini); fclose($handle); Modified: trunk/_utilisateur/modules.db =================================================================== (Binary files differ) Modified: trunk/configuration/skin.php =================================================================== --- trunk/configuration/skin.php 2006-11-26 19:40:53 UTC (rev 52) +++ trunk/configuration/skin.php 2006-11-27 19:23:32 UTC (rev 53) @@ -5,7 +5,7 @@ $RACINE_REP = "../"; if (isset($_GET['choiskin'])){ - change_template($_GET['choiskin']); + change_skin($_GET['choiskin']); } $skins = list_skin(); Modified: trunk/module/horoscope/index1.php =================================================================== --- trunk/module/horoscope/index1.php 2006-11-26 19:40:53 UTC (rev 52) +++ trunk/module/horoscope/index1.php 2006-11-27 19:23:32 UTC (rev 53) @@ -1,76 +1,571 @@ <?php - $RACINE_REP = "../../"; - require($RACINE_REP.'_framework/framework.php'); +$RACINE_REP = "../../"; +require($RACINE_REP.'_framework/framework.php'); + +$LINK['red']= $MODULE.'_menu/menu.php?cat=9'; + +global $affichage,$level, $nb_joueurs, $nb_win, $fini; + +if ($_GET['rep']) { + $level = $_GET['level']; +}else{ + $level=1; +} + + +$MENU_ALT=array( + array('lien'=>'index1.php?level=1', 'nom'=>'LEVEL 1', 'selected'=>$level=='1'), + array('lien'=>'index1.php?level=2', 'nom'=>'LEVEL 2', 'selected'=>$level=='2'), + array('lien'=>'index1.php?level=3', 'nom'=>'LEVEL 3', 'selected'=>$level=='3') + ); + + +$affichage=""; + +$nb_joueurs1=0; +$nb_joueurs2=0; +$nb_joueurs3=0; + + if(isset($_GET['level'])){ $level=$_GET['level']; } elseif(isset($_GET['level'])){ $level=$_GET['level']; } + if(!isset($_GET['tour'])) { $tour=0; } else { $tour=$_GET['tour']; } + if(isset($_GET['fini'])){ $fini = $_GET['fini']; } else { $fini=0; } + $joue=0; + $jouer_1=0; + $jouer_2=0; + $jouer_3=0; + + if(!isset($_GET['t11'])) { $tab[1][1]='-'; } elseif(isset($_GET['st11'])){ $tab[1][1] = 'b'; } else { $tab[1][1] = $_GET['t11']; } + if(!isset($_GET['t12'])) { $tab[1][2]='-'; } elseif(isset($_GET['st12'])){ $tab[1][2] = 'b'; } else { $tab[1][2] = $_GET['t12']; } + if(!isset($_GET['t13'])) { $tab[1][3]='-'; } elseif(isset($_GET['st13'])){ $tab[1][3] = 'b'; } else { $tab[1][3] = $_GET['t13']; } + if(!isset($_GET['t21'])) { $tab[2][1]='-'; } elseif(isset($_GET['st21'])){ $tab[2][1] = 'b'; } else { $tab[2][1] = $_GET['t21']; } + if(!isset($_GET['t22'])) { $tab[2][2]='-'; } elseif(isset($_GET['st22'])){ $tab[2][2] = 'b'; } else { $tab[2][2] = $_GET['t22']; } + if(!isset($_GET['t23'])) { $tab[2][3]='-'; } elseif(isset($_GET['st23'])){ $tab[2][3] = 'b'; } else { $tab[2][3] = $_GET['t23']; } + if(!isset($_GET['t31'])) { $tab[3][1]='-'; } elseif(isset($_GET['st31'])){ $tab[3][1] = 'b'; } else { $tab[3][1] = $_GET['t31']; } + if(!isset($_GET['t32'])) { $tab[3][2]='-'; } elseif(isset($_GET['st32'])){ $tab[3][2] = 'b'; } else { $tab[3][2] = $_GET['t32']; } + if(!isset($_GET['t33'])) { $tab[3][3]='-'; } elseif(isset($_GET['st33'])){ $tab[3][3] = 'b'; } else { $tab[3][3] = $_GET['t33']; } + + // on d\xE9finit les lignes qui seront test\xE9es lors du jeu + $row1 = $tab[1][1] . $tab[1][2] . $tab[1][3]; + $row2 = $tab[2][1] . $tab[2][2] . $tab[2][3]; + $row3 = $tab[3][1] . $tab[3][2] . $tab[3][3]; + $row4 = $tab[1][1] . $tab[2][2] . $tab[3][3]; + $row5 = $tab[3][1] . $tab[2][2] . $tab[1][3]; + $row6 = $tab[1][1] . $tab[2][1] . $tab[3][1]; + $row7 = $tab[1][2] . $tab[2][2] . $tab[3][2]; + $row8 = $tab[1][3] . $tab[2][3] . $tab[3][3]; + + // ces valeurs ne sont utiles que lors du d\xE9veloppement/ d\xE9buggage + $ligne[1][1] = '1-1'; + $ligne[1][2] = '1-2'; + $ligne[1][3] = '1-3'; + $ligne[2][1] = '2-1'; + $ligne[2][2] = '2-2'; + $ligne[2][3] = '2-3'; + $ligne[3][1] = '3-1'; + $ligne[3][2] = '3-2'; + $ligne[3][3] = '3-3'; + $ligne[4][1] = '1-1'; + $ligne[4][2] = '2-2'; + $ligne[4][3] = '3-3'; + $ligne[5][1] = '3-1'; + $ligne[5][2] = '2-2'; + $ligne[5][3] = '1-3'; + $ligne[6][1] = '1-1'; + $ligne[6][2] = '2-1'; + $ligne[6][3] = '3-1'; + $ligne[7][1] = '1-2'; + $ligne[7][2] = '2-2'; + $ligne[7][3] = '3-2'; + $ligne[8][1] = '1-3'; + $ligne[8][2] = '2-3'; + $ligne[8][3] = '3-3'; - if (isset($_REQUEST['sign'])) + //------------------- + // Fonction de conversion des lignes de type $tab[x][y] + // pour ressortir la coordonn\xE9e des cases (comprise entre 1 et 3) + //------------------- + + function cv($i, $j) { - // On a choisit un signe, afficher l'horoscope - - $liens = array('rss_horojour_belier.xml', 'rss_horojour_taureau.xml', 'rss_horojour_gemeaux.xml', 'rss_horojour_cancer.xml', 'rss_horojour_lion.xml', 'rss_horojour_vierge.xml', 'rss_horojour_balance.xml', 'rss_horojour_scorpion.xml', 'rss_horojour_sagittaire.xml', 'rss_horojour_capricorne.xml', 'rss_horojour_verseau.xml', 'rss_horojour_poissons.xml'); + // si $tab[6][2] alors val1C=2 val2c=1 + if($i>3) + { + if($i==4 && $j==1) { $valc1=1; $valc2=1; } + if($i==4 && $j==2) { $valc1=2; $valc2=2; } + if($i==4 && $j==3) { $valc1=3; $valc2=3; } + if($i==5 && $j==1) { $valc1=3; $valc2=1; } + if($i==5 && $j==2) { $valc1=2; $valc2=2; } + if($i==5 && $j==3) { $valc1=1; $valc2=3; } + if($i==8 && $j==1) { $valc1=1; $valc2=3; } + if($i==6 && $j==1) { $valc1=1; $valc2=1; } + if($i==6 && $j==2) { $valc1=2; $valc2=1; } + if($i==6 && $j==3) { $valc1=3; $valc2=1; } + if($i==7 && $j==1) { $valc1=1; $valc2=2; } + if($i==7 && $j==2) { $valc1=2; $valc2=2; } + if($i==7 && $j==3) { $valc1=3; $valc2=2; } + if($i==8 && $j==1) { $valc1=1; $valc2=3; } + if($i==8 && $j==2) { $valc1=2; $valc2=3; } + if($i==8 && $j==3) { $valc1=3; $valc2=3; } + } + else + { + $valc1=$i; + $valc2=$j; + } - if ($xml = file_get_contents('http://www.asiaflash.com/horoscope/'.$liens[$_REQUEST['sign']-1])) + return array($valc1,$valc2); + } + + + if($tour!=0 && $fini!=true) + { + if($tour==1) { - /* - * Je voulais faire ca en parsant le XML - * mais j'ai des probl\xE8mes de caract\xE8res accentu\xE9s :'( - * - if ($xml_table = simplexml_load_string($xml)) + /*--------*/ + /* TOUR 1 */ + /*--------*/ + + // si le joueur a jou\xE9 au centre alors on joue dans un coin + if($tab[2][2] == 'b' && $joue != true) { - echo '<html><body>'; - echo '<center>'.htmlspecialchars_decode($xml_table->channel[0]->item[0]->title).'</center>'; - echo '<br>'; - echo html_entity_decode($xml_table->channel[0]->item[0]->description); - echo '</body></html>'; + $valr1 = ((rand(1,2)*2)-1); + $valr2 = ((rand(1,2)*2)-1); + $tab[$valr1][$valr2] = 'a'; + $joue = true; } - */ + + // si le joueur a jou\xE9 dans un coin alors on joue au centre + if(($tab[1][1] == 'b' | $tab[1][3] == 'b' | $tab[3][1] == 'b' | $tab[3][3] == 'b') && $joue != true) + { + $tab[2][2] = 'a'; + $joue = true; + } + + // si le joueur a jou\xE9 au milieu d'une ligne alors on joue au centre + if(($tab[1][2] == 'b' | $tab[2][1] == 'b' | $tab[2][3] == 'b' | $tab[3][2] == 'b') && $joue != true) + { + $tab[2][2] = 'a'; + $joue = true; + } + } + + elseif($tour>1 | !$tour) + { + if($level==3) + { + /*----------------------------*/ + /* PHASE 1 : PEUT ON GAGNER ? */ + /*----------------------------*/ + + // Au d\xE9but de chaque tour, on regarde si il est possible de gagner + for($i=1;$i<9;$i++) + { + $var = 'row'.$i; + $combi = $$var; + + if($combi=='a-a' && $joue!=true) + { + $j=2; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + if($combi=='aa-' && $joue!=true) + { + $j=3; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + if($combi=='-aa' && $joue!=true) + { + $j=1; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + } + + /*--------------------------------------*/ + /* PHASE 2 : LE JOUEUR PEUT IL GAGNER ? */ + /*--------------------------------------*/ + + // Au d\xE9but de chaque tour, on regarde si le joueur adverse peut gagner (b-b ou bb- ou -bb) + + for($i=1;$i<9;$i++) + { + $var = 'row'.$i; + $combi = $$var; + + if($combi=='b-b' && $joue!=true) + { + $j=2; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + if($combi=='bb-' && $joue!=true) + { + $j=3; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + if($combi=='-bb' && $joue!=true) + { + $j=1; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + } + + /*-------------------------------------------*/ + /* PHASE 3 : OU JOUER SI LA VOIE EST LIBRE ? */ + /*-------------------------------------------*/ + + // Si on ne peut pas gagner et que le joueur ne peut pas non plus gagner ce tour, alors on joue + // Mais attention, on joue "intelligemment". + + if($joue!=true) + { + for($i=1;$i<9;$i++) + { + $var = 'row'.$i; + $combi = $$var; + + if($tour==2 && $joue!=true && ($row4=='bab' | $row5=='bab')) + { + $tab[1][2] = 'a'; + $joue=true; + } + + // teste le cas o\xF9 on doit jouer coin \xE0 cot\xE9 des deux croix pour ne pas perdre + elseif($tour==2 && $joue!=true && ($row2=='ba-' | $row7=='-ab')) + { + $tab[3][1] = 'a'; + $joue=true; + } + elseif($tour==2 && $joue!=true && ($row2=='-ab' | $row7=='-ab')) + { + $tab[3][3] = 'a'; + $joue=true; + } + elseif($tour==2 && $joue!=true && ($row2=='ba-' | $row7=='ba-')) + { + $tab[1][1] = 'a'; + $joue=true; + } + elseif($tour==2 && $joue!=true && ($row2=='-ab' | $row7=='ba-')) + { + $tab[1][3] = 'a'; + $joue=true; + } + + $aab=0; + $baa=0; + + if($i<4) + { + // aab, donc il faut jouer coin haut-droite ou bas-droite + // baa, donc il faut jouer coin haut-gauche ou bas-gauche + if($tour==3 && $aab!=0 && $joue!=true) + { + $j = 3; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + if($tour==3 && $baa!=0 && $joue!=true) + { + $j=1; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + if($combi=='aab') + { + $aab++; + } + if($combi=='baa') + { + $baa++; + } + } + + if($combi=='-a-' && $tab[2][2]=='a' && $i==2 && $joue!=true) + { + if($tab[1][1]=='b') + { + $tab[3][1] = 'a'; + $joue=true; + } + elseif($tab[1][3]=='b') + { + $tab[3][3] = 'a'; + $joue=true; + } + elseif($tab[3][1]=='b') + { + $tab[1][1] = 'a'; + $joue=true; + } + elseif($tab[3][3]=='b') + { + $tab[1][3] = 'a'; + $joue=true; + } + } + + elseif($combi=='-a-' && $tab[2][2]=='a' && $i==7 && $joue!=true) + { + if($tab[1][1]=='b') + { + $tab[1][3] = 'a'; + $joue=true; + } + elseif($tab[1][3]=='b') + { + $tab[1][1] = 'a'; + $joue=true; + } + elseif($tab[3][1]=='b') + { + $tab[3][3] = 'a'; + $joue=true; + } + elseif($tab[3][3]=='b') + { + $tab[3][1] = 'a'; + $joue=true; + } + } + + elseif($combi=='--a' && $joue!=true) + { + $j=1; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + // on regarde les cases vides pour jouer al\xE9atoirement si on a rien de mieux a faire + if($joue!=true) + { + + // peut-on jouer en case 1 ? Si oui on enregistre la case possible + if($combi=='-bb' | $combi=='-aa' | $combi=='-ab' | $combi=='-ba' | $combi=='---' | $combi=='--a' | $combi=='--b' | $combi=='-b-' | $combi=='-a-') + { + $jouer_1=true; + $val_1=$i; + } + + // peut-on jouer en case 2 ? Si oui on enregistre la case possible + if($combi=='b-b' | $combi=='a-a' | $combi=='a-b' | $combi=='b-a' | $combi=='---' | $combi=='--a' | $combi=='--b' | $combi=='b--' | $combi=='a--') + { + $jouer_2=true; + $val_2=$i; + } + + // peut-on jouer en case 3 ? Si oui on enregistre la case possible + if($combi=='bb-' | $combi=='aa-' | $combi=='ab-' | $combi=='ba-' | $combi=='---' | $combi=='-a-' | $combi=='-b-' | $combi=='b--' | $combi=='a--') + { + $jouer_3=true; + $val_3=$i; + } + + } + + } // for($i=1;$i<9;$i++) + + // si l'on a pas r\xE9ussi a jouer avec tous les tests pr\xE9c\xE9dents + // alors on joue al\xE9atoirement dans une case vide + // c'est la meilleure - et seule - solution ! + if($joue!=true) + { + // on joue case 1 si on a pas jou\xE9 + if($jouer_1==true && $joue!=true) + { + $j=1; + $i=$val_1; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + // on joue case 2 si on a pas jou\xE9 + if($jouer_2==true && $joue!=true) + { + $j=2; + $i=$val_2; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + + // on joue case 3 si on a pas jou\xE9 + if($jouer_3==true && $joue!=true) + { + $j=3; + $i=$val_3; + list($val1, $val2) = cv($i, $j); + $tab[$val1][$val2] = 'a'; + $joue=true; + } + } // if $joue!=true + } // if($joue!=true) + } // if($level==3) + // si $level==2 n'est pas inhumain + // alors on joue l\xE0 ou on peut, sans r\xE9fl\xE9chir. + else + { + for($i=1;$i<4;$i++) + { + if($joue!=true) + { + for($j=1;$j<4;$j++) + { + if($tab[$i][$j]=='-' && $joue!=true) + { + $tab[$i][$j] = 'a'; + $joue=true; + } + } + } + } + } // else (if - // R\xE9cup de l'item - $posDeb = strpos($xml,"<item>")+6; - $posFin = strpos($xml,"</item>"); - $xml = substr($xml, $posDeb, $posFin-$posDeb); + + /*-------------------------------------*/ + /* PHASE 4 : PERDU, GAGNE, MATCH NUL ? */ + /*-------------------------------------*/ - - // R\xE9cup du titre - $posDeb = strpos($xml,"<title>")+7; - $posFin = strpos($xml,"</title>"); - $entete = substr($xml, $posDeb, $posFin-$posDeb); - $entete = html_entity_decode($entete); - - // R\xE9cup du texte principal - $posDeb = strpos($xml,"<description>")+13; - //$posFin = strpos($xml,"</description>"); - $posFin = strpos($xml,'<center><font size="-1">Consultez sur le site AsiaFlash.com'); - $description = substr($xml, $posDeb, $posFin-$posDeb); - $description = html_entity_decode($description); - - $description = str_replace('http://www.asiaflash.com/anh/bleu_', 'images/bleu_', $description); - $description = str_replace('<b>', '<u>', $description); - $description = str_replace('</b>', '</u>', $description); - $description = str_replace('<br><br>', '<br> <br>', $description); - /* - echo '<html><body>'; - echo '<center>'.$titre.'</center>'; - echo '<br>'; - echo $description; - echo '</body></html>'; - */ - } - - $LINK['red']= 'index1.php'; + // on red\xE9finit les lignes apr\xE8s le traitement + // du jeu du computer pour tester la victoire + + $row1 = $tab[1][1] . $tab[1][2] . $tab[1][3]; + $row2 = $tab[2][1] . $tab[2][2] . $tab[2][3]; + $row3 = $tab[3][1] . $tab[3][2] . $tab[3][3]; + $row4 = $tab[1][1] . $tab[2][2] . $tab[3][3]; + $row5 = $tab[3][1] . $tab[2][2] . $tab[1][3]; + $row6 = $tab[1][1] . $tab[2][1] . $tab[3][1]; + $row7 = $tab[1][2] . $tab[2][2] . $tab[3][2]; + $row8 = $tab[1][3] . $tab[2][3] . $tab[3][3]; + + if($fini!=true) + { + for($i=1;$i<9;$i++) + { + $var = 'row'.$i; + $combi = $$var; + if($combi == 'aaa') + { + $affichage.="<h2>PERDU !</h2>"; + $fini=true; + } + if($combi == 'bbb' && $fini!=true) + { + $affichage.="<h2>GAGNE !</H2>"; + $fini=true; + } + } + } // if fini!=true + } // if $tour>1 | !$tour + } // if($tour!=0 && $fini!=true) + + + // si on est au cinqui\xE8me tour et qu'il + // n'y a pas de vainqueur, alors match nul + if($tour==5 && $fini!=true) + { + $affichage.="<h2>MATCH NUL !</h2>"; + $fini=true; } - if (!isset($entete) || $entete == '') + // sinon on incr\xE9mente le compteur tour + // (jusqu'\xE0 ce que sa valeur soit 5) + else { - // Affichage de la table de choix - $entete = 'Choisissez un signe'; - $description = ''; - - $LINK['red']= $MODULE.'_menu/menu.php?cat=18'; + $tour++; } - - $smarty->assign('TITRE','Horoscope'); - $smarty->assign('entete',$entete); - $smarty->assign('description',$description); - $smarty->assign('CONTENT',$smarty->fetch('horoscope.tpl')); - $smarty->display('interface.tpl'); + + /*----------------*/ + /* AFFICHAGE HTML */ + /*----------------*/ + + $t11 = $tab[1][1]; + $t12 = $tab[1][2]; + $t13 = $tab[1][3]; + $t21 = $tab[2][1]; + $t22 = $tab[2][2]; + $t23 = $tab[2][3]; + $t31 = $tab[3][1]; + $t32 = $tab[3][2]; + $t33 = $tab[3][3]; + + $affichage.="<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#FFFFFF22\" align=\"center\">"; + $affichage.="<tr>"; + + $affichage.="<tr>\n\r"; + + $query="level=$level"; + $query.="&tour=$tour"; + $query.="&fini=$fini"; + $query.="&t11=$t11"; + $query.="&t12=$t12"; + $query.="&t13=$t13"; + $query.="&t21=$t21"; + $query.="&t22=$t22"; + $query.="&t23=$t23"; + $query.="&t31=$t31"; + $query.="&t32=$t32"; + $query.="&t33=$t33"; + + if($t11=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st11=b&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t11.gif\" width=\"50\" height=\"54\">\n"; } + + if($t12=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st12=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t12.gif\" width=\"50\" height=\"54\"></td>\n"; } + + if($t13=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st13=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t13.gif\" width=\"50\" height=\"54\"></td>\n"; } + + $affichage.="</tr>\n<tr>\n"; + if($t21=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st21=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t21.gif\" width=\"50\" height=\"54\"></td>\n"; } + + if($t22=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st22=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t22.gif\" width=\"50\" height=\"54\"></td>\n"; } + + if($t23=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st23=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t23.gif\" width=\"50\" height=\"54\"></td>\n"; } + + $affichage.="</tr>\n<tr>\n"; + if($t31=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st31=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t31.gif\" width=\"50\" height=\"54\"></td>\n"; } + + if($t32=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st32=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t32.gif\" width=\"50\" height=\"54\"></td>\n"; } + + if($t33=='-') { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><a href=\"index1.php?st33=1&$query\">X</a></td>\n"; } + else { $affichage.="<td align=\"center\" width=\"52\" height=\"56\"><img src=\"$t33.gif\" width=\"50\" height=\"54\"></td>\n"; } + + $affichage.="</tr>\n</table> + <br> + <br><font size=\"1\"> + Jeu du Morpion adapt\xE9 pour EasyBox par InPhoVid (06/2006)<br> + Jeu du Morpion imbattable d\xE9velopp\xE9 en php. License GPL. Auteur : Matthieu Aubry + </font> + </center> + "; + +$smarty->assign('TITRE','MORPION'); +$smarty->assign('affichage',$affichage); +$smarty->assign('CONTENT',$smarty->fetch('generique.tpl')); +$smarty->display('interface.tpl'); ?> Modified: trunk/module/modules/index1.php =================================================================== --- trunk/module/modules/index1.php 2006-11-26 19:40:53 UTC (rev 52) +++ trunk/module/modules/index1.php 2006-11-27 19:23:32 UTC (rev 53) @@ -19,14 +19,15 @@ $xml_file = $ini['download']['xml'].'?cat=AllModule'; $xml3 = simplexml_load_file($xml_file); $MOD = array(); - + foreach($xml3->element as $element){ - if($element->nom==$_GET['installnewmod']){ - download_file($ini['download']['patch'].$element->fichier, $RACINE_REP.'module/'.$element->nom.'/'); - add_module($element->nom, $element->nom.'/', 'index1.php', '1', '1', '1', '1', '1', $element->version, $element->description, 'Module', 'Alone', get_id_of_categorie($element->cat)); + if(utf8_decode($element->nom)==urldecode($_GET['installnewmod'])){ + download_file($ini['download']['patch'].utf8_decode($element->fichier), $RACINE_REP.'module/'.utf8_decode($element->nom).'/'); + add_module(utf8_decode($element->nom), utf8_decode($element->nom).'/', 'index1.php', '1', '1', '1', '1', '1', utf8_decode($element->version), utf8_decode($element->description), 'Module', 'Alone', get_id_of_categorie(utf8_decode($element->cat))); } //-- R\xE9initialise la liste des modules get_module_list(); + list_templates(); } } @@ -42,12 +43,13 @@ $MOD = array(); foreach($xml3->element as $element){ - if($element->nom==$_GET['installnewskin']){ - download_file($ini['download']['patch'].$element->fichier, $RACINE_REP.'skin/'.$element->nom.'/'); + if(utf8_decode($element->nom)==$_GET['installnewskin']){ + download_file($ini['download']['patch'].utf8_decode($element->fichier), $RACINE_REP.'skin/'.utf8_decode($element->nom).'/'); add_module(utf8_decode($element->nom), utf8_decode($element->nom).'/', '', '', '', '', '', '', utf8_decode($element->version), utf8_decode($element->description), 'Skin', 'Alone', ''); } //-- R\xE9initialise la liste des modules get_module_list(); + list_templates(); } } @@ -62,7 +64,7 @@ $MOD = array(); foreach($xml3->element as $elem){ - if(!module_exists($elem->nom) and $elem->categorie=='Module'){ + if(!module_exists(utf8_decode($elem->nom)) and utf8_decode($elem->categorie)=='Module'){ $MOD[] = array('nom'=> utf8_decode($elem->nom),'version'=> utf8_decode($elem->version),'description'=> utf8_decode($elem->description),'auteur'=> utf8_decode($elem->auteur),'fichier'=> utf8_decode($elem->fichier)); } } @@ -80,7 +82,7 @@ $MOD = array(); foreach($xml3->element as $element){ - if(!module_exists($element->nom) and $element->categorie=='Skin'){ + if(!module_exists(utf8_decode($element->nom)) and utf8_decode($element->categorie)=='Skin'){ $MOD[] = array('nom'=>utf8_decode($element->nom),'version'=>utf8_decode($element->version),'description'=>utf8_decode($element->description),'auteur'=>utf8_decode($element->auteur),'fichier'=>utf8_decode($element->fichier)); } } Modified: trunk/module/modules/modules.tpl =================================================================== --- trunk/module/modules/modules.tpl 2006-11-26 19:40:53 UTC (rev 52) +++ trunk/module/modules/modules.tpl 2006-11-27 19:23:32 UTC (rev 53) @@ -44,7 +44,7 @@ <td>{$MOD[mod].version}</td> <td>{$MOD[mod].auteur}</td> <td>{$MOD[mod].description}</td> - <td><a href="index1.php?install{$action}={$MOD[mod].nom}&action={$action}">Installer</a></td> + <td><a href="index1.php?install{$action}={$MOD[mod].nom|urlencode}&action={$action}">Installer</a></td> </tr> {if $smarty.section.mod.last}</table>{/if} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |