From: <ara...@us...> - 2007-02-22 17:07:07
|
Revision: 79 http://svn.sourceforge.net/easybox-mod/?rev=79&view=rev Author: aragornis Date: 2007-02-22 09:07:00 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Remise en ?\195?\169tat des raccourcis par les touches num?\195?\169rot?\195?\169es de la t?\195?\169l?\195?\169commande Module "modules" largement remis en ?\195?\169tat (pr?\195?\169view des modules, description...) Correction d'un bug sur la lib ini Nouvelle interface de lecture avec options incluses directement Modified Paths: -------------- trunk/_framework/bouton/bouton_general.php trunk/_framework/favoris_touches.php trunk/_framework/fonctions_partagees.inc.php trunk/_framework/framework.php trunk/_framework/lib/img_cr.php trunk/_framework/lib/ini.php trunk/_utilisateur/modules.db trunk/configuration/general.php trunk/configuration/skin.php trunk/http-vlc/lecteur/modif-config.html trunk/lecteur/options.php trunk/module/films/fichefilm.php trunk/module/films/films.tpl trunk/module/films/info.php trunk/module/films/lecture.php trunk/module/films/play.php trunk/module/films/playba.php trunk/module/horloge/index1.php trunk/module/meteo/f2-france-512x384-j0pm.jpg trunk/module/modules/index1.php trunk/module/modules/modules.tpl trunk/skin/simple/interface/delete.gif trunk/skin/simple/option.tpl trunk/skin/simplegreen/interface/delete.gif trunk/skin/simplegreen/interface.tpl Added Paths: ----------- trunk/module/pendu/screen.gif trunk/skin/simple/interface/aide.gif trunk/skin/simple/interface/information.gif trunk/skin/simple/interface/valider.gif trunk/skin/simplegreen/interface/aide.gif trunk/skin/simplegreen/interface/information.gif trunk/skin/simplegreen/interface/valider.gif Removed Paths: ------------- trunk/skin/simplegreen/background.jpg Modified: trunk/_framework/bouton/bouton_general.php =================================================================== --- trunk/_framework/bouton/bouton_general.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/bouton/bouton_general.php 2007-02-22 17:07:00 UTC (rev 79) @@ -6,8 +6,8 @@ $n='0'; $trouve ='0'; while ($n <= '9'){ if ($ini['favoris']['touche'.$n]!=".") { $trouve = '1'; } $n++; } //-- On active les touches si trouve = 1 - if ($trouve == '1' AND $TOUCHE_FAVORIS!="NON" AND $LEVEL=="5") { - $META['nochannel_page']=$FRAMEWORK_REP.'favoris_touches.php?page='.urlencode($_SERVER['REQUEST_URI']).'&favoris_touche=%d'; + if ($trouve == '1' AND $TOUCHE_FAVORIS!="NON") { + $META['nochannel_page']=$FRAMEWORK_REP.'favoris_touches.php?favoris_touche=%d'; } $LINK['help']=$FRAMEWORK_REP.'aide/help.php?page='.urlencode($_SERVER["SCRIPT_NAME"]); Modified: trunk/_framework/favoris_touches.php =================================================================== --- trunk/_framework/favoris_touches.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/favoris_touches.php 2007-02-22 17:07:00 UTC (rev 79) @@ -4,28 +4,29 @@ $touche = 'touche'.$_GET['favoris_touche']; if ($touche == "touche0" AND $ini['screensaver']['scr_actif']=='oui') { - $redir = $MODULE."screensaver/index1.php"; - $texte1= "SCREENSAVER<br />"; -}else{ + /*$redir = $MODULE."screensaver/index1.php"; + $texte1= "SCREENSAVER<br />";*/ +}else{ if (($ini['favoris'][$touche] != "." AND $ini['favoris'][$touche]!="") AND $_GET['favoris_touche']) { if (@is_dir($ini['favoris'][$touche]) == TRUE) { $redir = $RACINE_REP."module/films/index1.php?directory=".$ini['favoris'][$touche]; - }else{ - $redir = $RACINE_REP."module/".$ini['favoris'][$touche]."index1.php"; - if ($ini['favoris'][$touche] == "mp3/") { - $redir = $RACINE_REP."module/".$ini['favoris'][$touche]."lecteuraudio.php"; - } + $texte1 = 'Redirection vers le dossier demand\xE9.'; + }else{ + $redir = $RACINE_REP."module/".$ini['favoris'][$touche]; + $texte1 = 'Redirection vers le module demand\xE9'; } }else{ - $redir = "..".urldecode($_GET['page']); - $redir = "back"; - $texte1 = 'Cette touche n\'est pas programm\xE9e<br />'; + $redir = 'back'; + $texte1 = "Cette touche n'est pas programm\xE9e. Retour \xE0 la page pr\xE9c\xE9dente."; } } $LINK['red']= '../module/_menu/menu.php'; -$META['refresh']= '1;url='.$redir; -$CONTENT = $texte1.'<br>Redirection en cours...'; +$META['refresh']= '0;url='.$redir; + +$TITRE = $texte1.'<br>Redirection en cours...'; + +$smarty->assign('TITRE','Redirection en cours...'); $smarty->assign('AVERTISSEMENT',$CONTENT); $smarty->display('avertissement.tpl'); Modified: trunk/_framework/fonctions_partagees.inc.php =================================================================== --- trunk/_framework/fonctions_partagees.inc.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/fonctions_partagees.inc.php 2007-02-22 17:07:00 UTC (rev 79) @@ -369,7 +369,7 @@ } function get_installed_modules(){ -global $USER; +global $USER,$INTERFACE_REP,$MODULE; if($a<=1){ $db = sqlite_open($USER.'modules.db', 0666); @@ -377,7 +377,12 @@ $MODULES = array(); while($element = sqlite_fetch_object($res)){ - $MODULES[] = array('nom'=>$element->nom,'version'=>$element->version,'description'=>$element->description,'id'=>$element->id); + if(file_exists($MODULE.$element->repertoire.'screen.gif')){ + $img = $MODULE.$element->repertoire.'screen.gif'; + }else{ + $img = $INTERFACE_REP.'noimage.gif'; + } + $MODULES[] = array('nom'=>$element->nom,'version'=>$element->version,'description'=>$element->description,'id'=>$element->id, 'img'=>$img); } sqlite_close($db); } @@ -386,15 +391,20 @@ } function get_installed_skins(){ -global $USER; +global $USER,$RACINE_REP,$INTERFACE_REP,$ini; if($a<=1){ $db = sqlite_open($USER.'modules.db', 0666); - $res = sqlite_query($db,'SELECT * FROM modules WHERE dependance="Alone" AND type="Skin"'); + $res = sqlite_query($db,'SELECT * FROM modules WHERE type="Skin"'); $MODULES = array(); while($element = sqlite_fetch_object($res)){ - $MODULES[] = array('nom'=>$element->nom,'version'=>$element->version,'description'=>$element->description,'id'=>$element->id); + if(file_exists($RACINE_REP.'skin/'.$element->repertoire.'vuedensemble.gif')){ + $img = $RACINE_REP.'skin/'.$element->repertoire.'vuedensemble.gif'; + }else{ + $img = $INTERFACE_REP.'noimage.gif'; + } + $MODULES[] = array('nom'=>$element->nom,'version'=>$element->version,'description'=>$element->description,'id'=>$element->id, 'img'=>$img, 'current'=>$element->nom==$ini['skin']['skin']); } sqlite_close($db); } @@ -593,16 +603,21 @@ $SKINS = array(); while($element = sqlite_fetch_object($res)){ - $SKINS[] = array('nom'=>$element->nom,'repertoire'=>$element->repertoire,'description'=>$element->description,'version'=>$element->version); + $SKINS[] = array('id'=>$element->id,'nom'=>$element->nom,'repertoire'=>$element->repertoire,'description'=>$element->description,'version'=>$element->version); } sqlite_close($db); return $SKINS; } -function change_skin($tpl){ -global $RACINE_REP; +function change_skin($id){ +global $RACINE_REP,$USER,$SKIN_REP; + $db = sqlite_open($USER.'modules.db', 0666); + $res = sqlite_query($db,'SELECT * FROM modules WHERE type="Skin" AND id="'.$id.'"'); + $val = sqlite_fetch_array($res); + $tpl = $val['nom']; + function ClearDirectory($path){ if($dir_handle = opendir($path)){ while($file = readdir($dir_handle)){ Modified: trunk/_framework/framework.php =================================================================== --- trunk/_framework/framework.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/framework.php 2007-02-22 17:07:00 UTC (rev 79) @@ -11,7 +11,7 @@ $LIBRARIES_REP = $FRAMEWORK_REP."lib/"; //--Chargement de Smarty - require($LIBRARIES_REP.'/Smarty.class.php'); + require_once($LIBRARIES_REP.'/Smarty.class.php'); $smarty = new Smarty(); $smarty->assign('FRAMEWORK_REP',$FRAMEWORK_REP); @@ -47,7 +47,7 @@ $IMG2FBX = $FRAMEWORK_REP.'img2fbx.php?sURL='; $smarty->assign('IMG2FBX',$IMG2FBX); $LOAD = $FRAMEWORK_REP.'fonctions_partagees.inc.php'; - include($LOAD); + require_once($LOAD); $EXPLORATEUR = $MODULE.'_explorateur/index1.php'; $smarty->assign('EXPLORATEUR',$EXPLORATEUR); @@ -87,7 +87,7 @@ $smarty->assign('THEME_REP',$THEME_REP); //-- Framework du skin - require($SKIN_REP."framework_skin.php"); + require_once($SKIN_REP."framework_skin.php"); //-- Chargement des couleurs $smarty->template_dir = realpath($SKIN_REP); @@ -101,7 +101,7 @@ $smarty->assign('OS',PHP_OS); $smarty->register_modifier('cleanaff','supprime_accents'); - require($FRAMEWORK_REP."cartouche.php"); + require_once($FRAMEWORK_REP."cartouche.php"); //Extraction des donn\xE9es de vlc $signetsav=explode("|",$contenu_html); @@ -137,7 +137,7 @@ //-- Chargement des Boutons. Possibilit\xE9 de le d\xE9sactiver pour la cr\xE9ation d'images avec header (cf annuaire freebox) if(!isset($nobouton)){ - require($BOUTON."bouton_general.php"); + require_once($BOUTON."bouton_general.php"); } /* Modified: trunk/_framework/lib/img_cr.php =================================================================== --- trunk/_framework/lib/img_cr.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/lib/img_cr.php 2007-02-22 17:07:00 UTC (rev 79) @@ -7,7 +7,7 @@ if ($_GET['local']){ $img = urldecode($_GET['img']); }else{ - $img ='../'.urldecode($_GET['img']); + $img ='../../'.urldecode($_GET['img']); } }else exit; if (isset($_GET['h'])) Modified: trunk/_framework/lib/ini.php =================================================================== --- trunk/_framework/lib/ini.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/_framework/lib/ini.php 2007-02-22 17:07:00 UTC (rev 79) @@ -25,7 +25,7 @@ function del($cat, $cle){ global $ini; - $ini[$cat][$cle] = null; + unset($ini[$cat][$cle]); } function set($cat, $cle, $val){ Modified: trunk/_utilisateur/modules.db =================================================================== (Binary files differ) Modified: trunk/configuration/general.php =================================================================== --- trunk/configuration/general.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/configuration/general.php 2007-02-22 17:07:00 UTC (rev 79) @@ -181,7 +181,7 @@ $affichepage[$numero_id].='>Pas Utilis\xE9</option>'; foreach($MOD as $module){ - $affichepage[$numero_id].= '<option value="'.$module['repertoire'].'"'; + $affichepage[$numero_id].= '<option value="'.$module['repertoire'].$module['lien'].'"'; if($entry==$module['repertoire']) { $affichepage[$numero_id].='selected'; } $affichepage[$numero_id].= '>'.$module['nom'].'</option>'; } Modified: trunk/configuration/skin.php =================================================================== --- trunk/configuration/skin.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/configuration/skin.php 2007-02-22 17:07:00 UTC (rev 79) @@ -30,7 +30,7 @@ <td colspan="2" align="right"><table width="100%" border="0" cellspacing="3" cellpadding="1"> <tr> <td width="85%"><font><b> - <input type="radio" name="choiskin" value="<?= $skin['nom']; ?>" <?php if(strtolower($skincfg)==strtolower($skin['nom'])) {echo' checked="checked" '; } ?>> + <input type="radio" name="choiskin" value="<?= $skin['id']; ?>" <?php if(strtolower($skincfg)==strtolower($skin['nom'])) {echo' checked="checked" '; } ?>> Skin : <?= $skin['nom'] ?> </b></font></td> </tr> Modified: trunk/http-vlc/lecteur/modif-config.html =================================================================== --- trunk/http-vlc/lecteur/modif-config.html 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/http-vlc/lecteur/modif-config.html 2007-02-22 17:07:00 UTC (rev 79) @@ -19,7 +19,7 @@ <vlc id="if" param1="type2 value 1 =" /> <vlc id="rpn" param1="'valeur' value 'audio-es' 'VLC_OBJECT_INPUT' vlc_var_set" /> <vlc id="end" /> - <!-- CHANGE DE SOUS-TITRES - Type2 = 2 --> + <!-- CHANGE LES OPTIONS SOUS-TITRES - Type2 = 2 --> <vlc id="if" param1="type2 value 2 =" /> <vlc id="rpn" param1="sub_margin 'sub_margin' url_extract store" /> @@ -38,10 +38,14 @@ <vlc id="end" /> <vlc id="rpn" param1="vlc_config_save" /> - + + <vlc id="end" /> + + <!-- CHANGE DE CHAPITRE - Type2 = 4 --> + <vlc id="if" param1="type2 value 4 =" /> <vlc id="rpn" param1="'valeur' value 'spu-es' 'VLC_OBJECT_INPUT' vlc_var_set" /> <vlc id="end" /> - + <!-- CHANGE DE CHAPITRE - Type2 = 3 --> <vlc id="if" param1="type2 value 3 =" /> <vlc id="rpn" param1="'valeur' value 'chapter' 'VLC_OBJECT_INPUT' vlc_var_set" /> Modified: trunk/lecteur/options.php =================================================================== --- trunk/lecteur/options.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/lecteur/options.php 2007-02-22 17:07:00 UTC (rev 79) @@ -2,37 +2,15 @@ $RACINE_REP = "../"; require($RACINE_REP.'_framework/framework.php'); -if (isset($_GET['module'])){ - $module=$_GET['module']; -}else{ - $module='infos'; -} +$module=$_GET['module']; + $LINK['red']=$RACINE_REP.'module/films/info.php'; $LINK['options']=$RACINE_REP.'module/films/info.php'; $smarty->assign('module',$module); -if (isset($_GET['end'])){ - $i=1; - $xml = simplexml_load_file($USER."modules.xml"); - for($y=0; $y < 4 ; $y++){ - foreach($xml->channel->categorie[$y]->module as $modu){ - if ($i<=$_GET['end']){ - if (isset($_GET[$i])){ - $valeur=$_GET[$i]; - }else{ - $valeur='0'; - } - $modu->actif=$valeur; - $i++; - } - } - } - file_put_contents($USER."modules.xml", $xml ->asxml()); -} - if (isset($_GET['video'])){ @readfile('http://localhost:8081/lecteur/modif-config.html?type=3&video='.$_GET['video'].'&pp='.$_GET['pp']); } Modified: trunk/module/films/fichefilm.php =================================================================== --- trunk/module/films/fichefilm.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/fichefilm.php 2007-02-22 17:07:00 UTC (rev 79) @@ -121,7 +121,7 @@ if ($disable) { - $smarty->assign('more','... <a href="options.php?getmoreinfo=1">Suite</a>'); + $smarty->assign('more','... <a href="info.php?getmoreinfo=1">Suite</a>'); } else { $smarty->assign('more','... <a href="fichefilm.php?getmoreinfo=1&film='.urlencode($film).'&fichier='.urlencode($fichier).'">Suite</a>'); @@ -141,7 +141,7 @@ { $CONTENT .= '<font size=4>R\xE9sum\xE9 pour '.$film.'</font><br> <br> <br>'; $CONTENT .= strip_tags($info['synopsis']); - $CONTENT .= '<br> <br><a href="options.php">Retour</a>'; + $CONTENT .= '<br> <br><a href="info.php">Retour</a>'; $contenant = $CONTENT; } else { Modified: trunk/module/films/films.tpl =================================================================== --- trunk/module/films/films.tpl 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/films.tpl 2007-02-22 17:07:00 UTC (rev 79) @@ -7,17 +7,123 @@ <body background="ts://127.0.0.1" text="{#COULEUR_LECTEUR_TEXT#}" link="{#COULEUR_LECTEUR_LINK#}" alink="{#COULEUR_LECTEUR_ALINK#}" vlink="{#COULEUR_LECTEUR_VLINK#}"> <center> <table width="645" height="510" border="0" cellpadding="0" cellspacing="0"><tr> -<td height="400" align="center" valign="top"> -</td> -</tr> -<tr> -<td height="110" align="center"><center> -<table width="571" height="106" border="0" cellpadding="0" cellspacing="0" background="{$SKIN_REP}interface/player.gif"><tr> -<td height="20"> </td> -</tr> -<tr> -<td height="20"> + <td height="370" align="left" cellpadding="3" cellspacing="0" valign="top"{if $module!=''} bgcolor="{#COULEUR_FOND2#}"{/if}> + + {math equation="x/y+1" x="640" y=7 assign=width} + <table width="640" height="25" border="0" align="center" cellpadding="0" cellspacing="0"> + <tr> + <td width="{$width}" align=center><a href="info.php?module=infos" {if $module=='infos'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Infos</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php?module=video" {if $module=='video'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Video</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php?module=audio" {if $module=='audio'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Audio</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php?module=sstitre" {if $module=='sstitre'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Sous-titres</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php?module=navigation" {if $module=='navigation'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Chapitres</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php?module=signets" {if $module=='signets'}focused{/if}><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Signets</td></tr></table></a></td> + <td width="{$width}" align=center><a href="info.php"><table width="{$width}" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND2#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="25"><td width="{$width}" align=center height="25">Fermer</td></tr></table></a></td> + </tr> + </table> + + +{if $module=='infos'} +{$content} +{elseif $module=='video'} +<font size="3"><u>Options vid\xE9o</u></font><br> + <form action="info.php" method="get"> + <input type=hidden name=module value=video><input type=hidden name=var value="video-es"><br> + {foreach from=$video item=pistev key=key name=video} + <input type=radio name=video bgcolor="{#COULEUR_FOND_RADIO#}" value="{$key}" {if $pistev.1} checked{/if}>{$pistev.0}<br> + {/foreach} + <br>Post-traitement + <input type="hslider" bgcolor="{#COULEUR_FOND_RADIO#}" name="pp" min="0" max="6" grad="1" /> + Augmenter la qualit\xE9 du traitement de l'image (de 0 vers 6) demande plus de puissance CPU. + <br> + +<table width="250" align="left"> +<tr><td width="130">4/3 Letterbox</td><td><input type=radio bgcolor="{#COULEUR_FOND_RADIO#}" name=display_aspect_ratio_conversion value=letterbox></td></tr> +<tr><td width="130">4/3 Combined</td><td><input type=radio bgcolor="{#COULEUR_FOND_RADIO#}" name=display_aspect_ratio_conversion value=combined></td></tr> +<tr><td width="130">4/3 Pan Scan</td><td><input type=radio bgcolor="{#COULEUR_FOND_RADIO#}" name=display_aspect_ratio_conversion value=panscan></td></tr> +<tr><td width="130">16/9</td><td><input type=radio bgcolor="{#COULEUR_FOND_RADIO#}" name=display_aspect_ratio_conversion value=ignore></td></tr> +</table> + +<table width="250" align="left"> +<tr><td width="90">Lumi\xE9re</td><td width="5">:</td><td><input bgcolor="{#COULEUR_FOND_RADIO#}" type=hslider name=denc_brightness min=0 max=255 grad=16></td></tr> +<tr><td width="90">Contraste</td><td width="5">:</td><td><input bgcolor="{#COULEUR_FOND_RADIO#}" type=hslider name=denc_contrast min='-128' max=127 grad=16></td></tr> +<tr><td width="90">Couleur</td><td width="5">:</td><td><input bgcolor="{#COULEUR_FOND_RADIO#}" type=hslider name=denc_saturation min=0 max=255 grad=16></td></tr> +<tr><td width="90">Zoom</td><td width="5">:</td><td><input bgcolor="{#COULEUR_FOND_RADIO#}" type=hslider name=video_output_scale min=25 max=100 grad=5></td></tr> +</table> + + <input bgcolor="{#COULEUR_TEXTBOX#}" type=submit value="Valider les modifications"> +</form> + +{elseif $module=='audio'} +<font size="3"><u>Options audio</u></font><br> + <form action="info.php" method="get"><input type=hidden name=module value=audio><input type=hidden name=var value="audio-es"><br> + {foreach from=$audio item=pistea key=key name=audio} + <input type=radio name=audio bgcolor="{#COULEUR_FOND_RADIO#}" value="{$key}" {if $pistea.1} checked{/if}>{$pistea.0}<br> + {/foreach} + <br><form action="none"> + <input type="radio" name="aud" value="69(en,mp2)" bgcolor="{#COULEUR_FOND_RADIO#}"> Son st\xE9r\xE9o<br> + <input type="radio" name="aud" value="69(en,ac3)" bgcolor="{#COULEUR_FOND_RADIO#}"> Dolby Digital (S/PDIF)<br> + <br><input bgcolor="{#COULEUR_TEXTBOX#}" type=submit value="Valider les modifications"></form> + +{elseif $module=='sstitre'} +<font size="3"><u>Sous-titres</u></font><br> + <form action="info.php" method="get"><input type=hidden name=module value=sstitre><br> + {foreach from=$sstitre item=pistess key=key name=sstitre} + <input type=radio name=sstitre bgcolor="{#COULEUR_FOND_RADIO#}" value="{$key}"{if $pistess.1} checked{/if}>{$pistess.0}<br> + {/foreach} + + Les param\xE8tres suivants ne seront pris en compte qu'apr\xE8s le red\xE9marage du films. Ils seront sauvegard\xE9s dans Easybox pour les prochaines utilisations de easybox<br /> + <font size="3"><u>Position</u></font> : + <input type=text bgcolor="{#COULEUR_FOND_RADIO#}" name="sub_margin" size=3 maxlength=3 value="{$sub_margin}"><br> <br> + <font size="3"><u>Couleur</u></font> : + <table cellpadding="1" cellspacing="0" align="left" width="200"><tr> + <td width="40"><a href="info.php?module={$module}&fontcolor=16777215"><table width="30" height="20" border=1 bgcolor="#FFFFFF3F" bordercolor="#0000003F" cellpadding=0 cellspacing=0><tr><td align="center">{if $fontcolor=='16777215'}<img src="{$INTERFACE_REP}finished.gif" width="14" height="14" border="0">{else}<img src="" width="1" height="1">{/if}</td></tr></table></a></td> + <td width="40"><a href="info.php?module={$module}&fontcolor=16776960"><table width="30" height="20" border=1 bgcolor="#FFFF003F" bordercolor="#FFFFFF3F" cellpadding=0 cellspacing=0><tr><td align="center">{if $fontcolor=='16776960'}<img src="{$INTERFACE_REP}finished.gif" width="14" height="14" border="0">{else}<img src="" width="1" height="1">{/if}</td></tr></table></a></td> + <td width="40"><a href="info.php?module={$module}&fontcolor=65535"><table width="30" height="20" border=1 bgcolor="#00CCFF3F" bordercolor="#FFFFFF3F" cellpadding=0 cellspacing=0><tr><td align="center">{if $fontcolor=='65535'}<img src="{$INTERFACE_REP}finished.gif" width="14" height="14" border="0">{else}<img src="" width="1" height="1">{/if}</td></tr></table></a></td> + <td width="40"><a href="info.php?module={$module}&fontcolor=16711680"><table width="30" height="20" border=1 bgcolor="#FF00003F" bordercolor="#FFFFFF3F" cellpadding=0 cellspacing=0><tr><td align="center">{if $fontcolor=='16711680'}<img src="{$INTERFACE_REP}finished.gif" width="14" height="14" border="0">{else}<img src="" width="1" height="1">{/if}</td></tr></table></a></td> + <td width="40"><a href="info.php?module={$module}&fontcolor=32768"><table width="30" height="20" border=1 bgcolor="#00FF003F" bordercolor="#FFFFFF3F" cellpadding=0 cellspacing=0><tr><td align="center">{if $fontcolor=='32768'}<img src="{$INTERFACE_REP}finished.gif" width="14" height="14" border="0">{else}<img src="" width="1" height="1">{/if}</td></tr></table></a></td> + </tr></table><br> <br> <br> + <font size="3"><u>Taille</u></font> : <br> <br>- <input type="hslider" bgcolor="{#COULEUR_FOND_RADIO#}" name="fontsize" min="0" max="4" grad="1" value="{$ffontsize}"> + <br> <br> + <input bgcolor="{#COULEUR_TEXTBOX#}" type=submit value="Valider les modifications"></form> + +{elseif $module=='navigation'} +<font size="3"><u>Chapitres</u></font><br> + <table><tr><td> +{assign var=keyb value=1} + {foreach from=$chapitre item=chap key=key name=chap} + <a href="info.php?module=navigation&chap={$key}">{if $chap.1}<font family="Symbol">T</font>{/if}<font size="1">{$chap.0}</font></a><br> + {assign var=keyb value=$keyb+1} + {if $keyb is div by 17}</td><td>{/if} + {/foreach} + </td></tr></table> +{elseif $module=='signets'} +<font size="3"><u>Signets</u></font><br> +{/if} + + + + + + + + + + + + + + + + + </td> +</tr><tr height="10"><td><img src="" width="1" height="1"></td></tr><tr> + <td height="110" align="center"><center> + <table width="571" height="106" border="0" cellpadding="0" cellspacing="0" background="{$SKIN_REP}interface/player.gif"><tr> + <td height="20"> </td> + </tr><tr> + <td height="20"> + {assign var=stream_1 value="`$VLC.pourcentage_courant/100*529`"|round} {assign var=stream_2 value="`$stream_1*-1`"} {assign var=stream_3 value="`$stream_1/5+1`"|floor} Modified: trunk/module/films/info.php =================================================================== --- trunk/module/films/info.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/info.php 2007-02-22 17:07:00 UTC (rev 79) @@ -2,8 +2,15 @@ $RACINE_REP = "../../"; require($RACINE_REP.'_framework/framework.php'); +//-- Traitement des options + $module=$_GET['module']; + $smarty->assign('module',$module); + + if(($VLC['duree_restante']-1)<=30 AND $VLC['type_current']!='webtv'){ $META['refresh'] = $VLC['duree_restante'].';url=lecture.php?control=stop&signet=noload&theend=1'; +}elseif($module!=''){ + unset($META['refresh']); }else{ $META['refresh']= '30;url=lecture.php'; } @@ -35,6 +42,102 @@ $file1 = file_get_contents("http://127.0.0.1:8081/lecteur/action.html?control=seek&seek_value=$value"); } +function convert_size($size){ +$assoc[0] = '12'; +$assoc[1] = '24'; +$assoc[2] = '32'; +$assoc[3] = '36'; +$assoc[4] = '40'; + +$assoc[12] = '0'; +$assoc[24] = '1'; +$assoc[32] = '2'; +$assoc[36] = '3'; +$assoc[40] = '4'; + +RETURN($assoc[$size]); +} + + // Changement des options vid\xE9o + if (isset($_GET['video'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=3&video='.$_GET['video'].'&pp='.$_GET['pp']); + } + // Changement des options audio + if (isset($_GET['audio'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=2&type2=1&var=audio-es&value='.$_GET['audio']); + } + // Changement des options de sous-titre + if (isset($_GET['sstitre'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=2&type2=4&var=spu-es&value='.$_GET['sstitre']); + }elseif(isset($_GET['fontcolor'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=2&type2=2&color='.$_GET['fontcolor']); + }elseif(isset($_GET['sub_margin'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=2&type2=2&size='.convert_size($_GET['fontsize']).'&sub_margin='.$_GET['sub_margin']); + } + // Changement de chapitre + if (isset($_GET['chap'])){ + @readfile('http://localhost:8081/lecteur/modif-config.html?type=2&type2=3&var=chapter&value='.$_GET['chap']); + } + + //-- R\xE9cuperation des donn\xE9es de VLC + $contenu_html = @file_get_contents('http://localhost:8081/lecteur/options_vlc.html'); + eval($contenu_html); + + //-- Affichage de la fiche film + if($module=='infos'){ + $disable=1; + $nomcourant = str_replace("\\", "/", $VLC['name_current']); + $pos = strrpos($nomcourant,"/"); + $pos++; + $nomcourant = substr($nomcourant,$pos); + $nomcourant = trim(substr($nomcourant,0,strrpos($nomcourant,'.'))); + $fichier = $VLC['url_current']; + $film=$nomcourant; + include($MODULE.'films/fichefilm.php'); + $smarty->assign('content',$contenant); + } + + //-- Choix du format Video + if($module=='video'){ + $smarty->assign('video',$video); + $smarty->assign('pp_video',$pp_video); + } + + //Choix de la piste audio + if($module=='audio'){ + $smarty->assign('audio',$audio); + } + + //Choix du fichier de sous-titre + if($module=='sstitre'){ + foreach($sub_margin as $key => $value){ + $_sub_margin = $key; + } + foreach($fontcolor as $key => $value){ + $_fontcolor = $key; + } + foreach($ffontsize as $key => $value){ + $_ffontsize = $key; + } + if($_fontcolor =="" OR $_fontcolor == "0"){ + $_fontcolor = '16777215'; + } + if($_ffontsize==""){ + $_ffontzise = '32'; + } + $smarty->assign('ffontsize',convert_size($_ffontsize)); + $smarty->assign('fontcolor',$_fontcolor); + $smarty->assign('sub_margin',$_sub_margin); + $smarty->assign('sstitre',$sstitre); + } + + //Choix du chapitre + if($module=='navigation'){ + $smarty->assign('chapitre',$chapitre); + } +//--Fin des options + +// Synth\xE8se du nom du fichier if ($VLC['name_current'] == "current_node_name") { $nomcourant = "Aucun fichier en lecture"; }else{ @@ -45,16 +148,16 @@ $nomcourant = trim(substr($nomcourant,0,strrpos($nomcourant,'.'))); } -$temps_affich=calcul_hours($VLC['duree_courante']).' / '.calcul_hours($VLC['duree_totale']).' ('.$VLC['pourcentage_courant'].'%)'; + $temps_affich=calcul_hours($VLC['duree_courante']).' / '.calcul_hours($VLC['duree_totale']).' ('.$VLC['pourcentage_courant'].'%)'; $LINK['stop']=$MODULE.'films/lecture.php?control=stop'; $LINK['play']=$MODULE.'films/lecture.php?control=pause'; $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; $LINK['info']=$MODULE.'films/lecture.php'; - $LINK['options']=$RACINE_REP.'lecteur/options.php?module=video'; + $LINK['options']=$MODULE.'films/lecture.php'; $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; - $LINK['yellow']=$RACINE_REP.'lecteur/options.php?module=infos'; + $LINK['info']=$MODULE.'films/info.php?module=infos'; if(in_array($VLC['type_current'],array('cd','audio','photo'))){ $META['refresh']= '2;url='.page_retour_film(); Modified: trunk/module/films/lecture.php =================================================================== --- trunk/module/films/lecture.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/lecture.php 2007-02-22 17:07:00 UTC (rev 79) @@ -229,10 +229,10 @@ $LINK['play']=$MODULE.'films/lecture.php?control=play'; $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; $LINK['info']=$MODULE.'films/info.php'; -$LINK['options']=$RACINE_REP.'lecteur/options.php?module=video'; +$LINK['options']=$MODULE.'films/info.php'; $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; -$LINK['yellow']=$RACINE_REP.'lecteur/options.php?module=infos'; +$LINK['yellow']=$MODULE.'films/info.php?module=infos'; $LINK['up']=$MODULE.'films/lecture.php?seek_value=plus'; $LINK['down']=$MODULE.'films/lecture.php?seek_value=moins'; Modified: trunk/module/films/play.php =================================================================== --- trunk/module/films/play.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/play.php 2007-02-22 17:07:00 UTC (rev 79) @@ -112,13 +112,22 @@ play_multiple_fichier($basename, $play, $add); } - $LINK['stop']=$MODULE.'films/lecture.php?control=stop'; - $LINK['play']=$MODULE.'films/lecture.php?control=pause'; - $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; - $LINK['options']=$RACINE_REP.'lecteur/options.php?module=video'; - $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; - $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; - $LINK['yellow']=$RACINE_REP.'lecteur/options.php?module=infos'; + $LINK['stop']=$MODULE.'films/lecture.php?control=stop'; + $LINK['play']=$MODULE.'films/lecture.php?control=play'; + $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; + $LINK['info']=$MODULE.'films/info.php'; + $LINK['options']=$MODULE.'films/info.php'; + $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; + $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; + $LINK['yellow']=$MODULE.'films/info.php?module=infos'; + $LINK['up']=$MODULE.'films/lecture.php?seek_value=plus'; + $LINK['down']=$MODULE.'films/lecture.php?seek_value=moins'; + + // BDE - RequestID 1588902 + $LINK['next']=$MODULE.'films/lecture.php?control=next'; + $LINK['prev']=$MODULE.'films/lecture.php?control=previous'; + $LINK['rev']=$MODULE.'films/lecture.php?seek_value=moins'; + $LINK['fwd']=$MODULE.'films/lecture.php?seek_value=plus'; $db = sqlite_open($USER.'utilisateur.db', 0666); Modified: trunk/module/films/playba.php =================================================================== --- trunk/module/films/playba.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/films/playba.php 2007-02-22 17:07:00 UTC (rev 79) @@ -18,13 +18,22 @@ play_fichier('type=40',str_replace(' ','%20',$basename),0,'ba',$_REQUEST['titre']); - $LINK['stop']=$MODULE.'films/lecture.php?control=stop'; - $LINK['play']=$MODULE.'films/lecture.php?control=pause'; - $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; - $LINK['options']=$RACINE_REP.'lecteur/options.php?module=video'; - $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; - $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; - $LINK['yellow']=$RACINE_REP.'lecteur/options.php?module=infos'; + $LINK['stop']=$MODULE.'films/lecture.php?control=stop'; + $LINK['play']=$MODULE.'films/lecture.php?control=play'; + $LINK['pause']=$MODULE.'films/lecture.php?control=pause'; + $LINK['info']=$MODULE.'films/info.php'; + $LINK['options']=$MODULE.'films/info.php'; + $LINK['blue']=$MODULE.'films/lecture.php?savesignet=1'; + $LINK['red']=$MODULE.'films/lecture.php?next_ss=1'; + $LINK['yellow']=$MODULE.'films/info.php?module=infos'; + $LINK['up']=$MODULE.'films/lecture.php?seek_value=plus'; + $LINK['down']=$MODULE.'films/lecture.php?seek_value=moins'; + + // BDE - RequestID 1588902 + $LINK['next']=$MODULE.'films/lecture.php?control=next'; + $LINK['prev']=$MODULE.'films/lecture.php?control=previous'; + $LINK['rev']=$MODULE.'films/lecture.php?seek_value=moins'; + $LINK['fwd']=$MODULE.'films/lecture.php?seek_value=plus'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> Modified: trunk/module/horloge/index1.php =================================================================== --- trunk/module/horloge/index1.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/horloge/index1.php 2007-02-22 17:07:00 UTC (rev 79) @@ -1,14 +1,571 @@ -<?php -$RACINE_REP = "../../"; -require($RACINE_REP.'_framework/framework.php'); - -$LINK['red']= page_retour_menu(); - - $META['refresh']='30;url=index1.php'; - - $smarty->assign('TITRE','Here is the current time (lol)'); - - $smarty->assign('CONTENT',$smarty->fetch('horloge.tpl')); - $smarty->display('interface.tpl'); - -?> +<?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'; + + //------------------- + // 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) + { + // 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; + } + + return array($valc1,$valc2); + } + + + if($tour!=0 && $fini!=true) + { + if($tour==1) + { + /*--------*/ + /* TOUR 1 */ + /*--------*/ + + // si le joueur a jou\xE9 au centre alors on joue dans un coin + if($tab[2][2] == 'b' && $joue != true) + { + $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 + + + /*-------------------------------------*/ + /* PHASE 4 : PERDU, GAGNE, MATCH NUL ? */ + /*-------------------------------------*/ + + // 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; + } + + // sinon on incr\xE9mente le compteur tour + // (jusqu'\xE0 ce que sa valeur soit 5) + else + { + $tour++; + } + + /*----------------*/ + /* 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/meteo/f2-france-512x384-j0pm.jpg =================================================================== (Binary files differ) Modified: trunk/module/modules/index1.php =================================================================== --- trunk/module/modules/index1.php 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/modules/index1.php 2007-02-22 17:07:00 UTC (rev 79) @@ -2,14 +2,34 @@ $RACINE_REP = "../../"; require($RACINE_REP.'_framework/framework.php'); +if(isset($_GET['setskinid']) and $_GET['valide']==1){ + change_skin($_GET['setskinid']); + $smarty->assign('TITRE','La skin va changer'); + $META['refresh']= '1;url=index1.php?skinchanged=1&action='.$_GET['action']; + $smarty->assign('AVERTISSEMENT','Chargement de la nouvelle skin... Veuillez patienter quelques instants...'); + $smarty->display('avertissement.tpl'); +}elseif(isset($_GET['setskinid'])){ + $smarty->assign('TITRE','Voulez-vous vraiment changer de skin ?'); + $smarty->assign('AVERTISSEMENT','<a href="index1.php?action='.$_GET['action'].'&setskinid='.$_GET['setskinid'].'&valide=1">Oui</a> - <a href="index1.php?action='.$_GET['action'].'">Non</a>'); + $smarty->display('avertissement.tpl'); +}else{ + +if(isset($_GET['skinchanged'])){ + get_module_list(); + list_templates(); +} + $LINK['red']= page_retour_menu(); $MENU_ALT=array(array('lien'=>'index1.php?action=mod', 'nom'=>'Modules install\xE9s', 'selected'=>$_GET['action']=='mod'), - array('lien'=>'index1.php?action=newmod', 'nom'=>'Nouveaux modules', 'selected'=>$_GET['action']=='newmod'), + array('lien'=>'index1.php?action=newmod', 'nom'=>'Nouv. modules', 'selected'=>$_GET['action']=='newmod'), array('lien'=>'index1.php?action=skin', 'nom'=>'Skins install\xE9es', 'selected'=>$_GET['action']=='skin'), - array('lien'=>'index1.php?action=newskin', 'nom'=>'Nouvelles skins', 'selected'=>$_GET['action']=='newskin'), + array('lien'=>'index1.php?action=newskin', 'nom'=>'Nouv. skins', 'selected'=>$_GET['action']=='newskin'), array('lien'=>'index1.php?action=options', 'nom'=>'Option', 'selected'=>$_GET['action']=='options')); +(isset($_GET['min'])?$min=$_GET['min']:$min=0); +$smarty->assign('MIN',$min); + if(!isset($_GET['action'])){ $_GET['action'] = 'mod'; } @@ -67,7 +87,7 @@ foreach($xml3->element as $elem){ 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)); + $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),'img'=>'http://www.easybox-mod.org/modules/addon/screen/'.utf8_decode($elem->screen)); } } @@ -85,7 +105,7 @@ foreach($xml3->element as $element){ 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)); + $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),'img'=>'http://www.easybox-mod.org/modules/addon/screen/'.utf8_decode($elem->screen)); } } @@ -104,8 +124,8 @@ $smarty->assign('CONTENT',$smarty->fetch('modules.tpl')); $smarty->display('interface.tpl'); +} - ?> Modified: trunk/module/modules/modules.tpl =================================================================== --- trunk/module/modules/modules.tpl 2007-02-21 16:37:43 UTC (rev 78) +++ trunk/module/modules/modules.tpl 2007-02-22 17:07:00 UTC (rev 79) @@ -1,24 +1,30 @@ {if $action=="mod" OR $action=="skin"} - {section name=mod loop=$MOD} + {section name=mod loop=$MOD start=$MIN max=4} {if $smarty.section.mod.first} - <table width="500" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td><font size=2><b>Nom</b></font></td> - <td><font size=2><b>Version</b></font></td> - <td><font size=2><b>Description</b></font></td> - <td><font size=2><b>Sup.</b></font></td> - </tr> + {if $MIN!=0} + {assign var=temp value=$MIN-4} + {attribbouton touche="green" lien="index1.php?action=$action&min=$temp"} + <a href="index1.php?action={$action}&min={$temp}"><img src="{$INTERFACE_REP}btn_vert.gif" border="0"> Pr\xE9c\xE9dent</a> {/if} - {cycle name=color assign=COLOR print=false values="`$smarty.config.COULEUR_INTERFACE1`,`$smarty.config.COULEUR_INTERFACE2`"} + <table width="500" border="0" cellspacing="0" cellpadding="2" align="left" valign="top"> + {/if} + <tr> - <td>{$MOD[mod].nom}</td> - <td>{$MOD[mod].version}</td> - <td>{$MOD[mod].description}</td> - <td width="20" bgcolor="{$COLOR}"><a href="index1.php?delid={$MOD[mod].id}&action={$action}"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="{$COLOR}" abgcolor="{#COULEUR_ALINK#}"><tr height="20"><td align=center width="20" height="20" align="center" valign="middle"><img src="{$INTERFACE_REP}delete.gif" border="0" width="20" height="20"></td></tr></table></a></td> + <td align="left" valign="top"><img width="120" height="90" src="{$IMG2FBX}{$MOD[mod].img|realpath|urlencode}&new_width=120&new_height=90&cache=1"></td> + <td align="left" valign="top"><b><u>{$MOD[mod].nom}{if $action=="skin" AND $MOD[mod].current} - Skin actif{/if}</u></b><br> + <b>Version</b> : {$MOD[mod].version}<br> + <b>Description</b> : {$MOD[mod].description}</td> + {if $action=="skin"}{if NOT $MOD[mod].current}<td width="20"><a href="index1.php?setskinid={$MOD[mod].id}&action={$action}"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#COULEUR_FOND1#" abgcolor="{#COULEUR_ALINK#}"><tr height="20"><td align=center width="20" height="20" align="center" valign="middle"><img src="{$INTERFACE_REP}valider.gif" border="0" width="20" height="20"></td></tr></table></a></td>{else}<td> </td>{/if}{/if} + <td width="20"><a href="index1.php?delid={$MOD[mod].id}&action={$action}"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#COULEUR_FOND1#" abgcolor="{#COULEUR_ALINK#}"><tr height="20"><td align=center width="20" height="20" align="center" valign="middle"><img src="{$INTERFACE_REP}delete.gif" border="0" width="20" height="20"></td></tr></table></a></td> </tr> - {if $smarty.section.mod.last}</table>{/if} - - + {if $smarty.section.mod.last} + </table> + {if $MIN+$smarty.section.mod.total < count($MOD)} + {assign var=temp value=$MIN+4} + {attribbouton touche="blue" lien="index1.php?action=$action&min=$temp"} + <a href="index1.php?action={$action}&min={$temp}"><img src="{$INTERFACE_REP}btn_bleu.gif" border="0"> Suivant</a> + {/if} + {/if} {sectionelse} {if $action=="skin"} Aucune skin suppl\xE9mentaire n'est install\xE9e. Pour en installer, rendez-vous dans la partie "Nouvelles skins". @@ -28,25 +34,31 @@ {/section} {elseif $action=="newmod" OR $action=="newskin"} {section name=mod loop=$MOD} + ... [truncated message content] |