From: <Mi...@us...> - 2006-10-04 01:49:38
|
Revision: 21 http://svn.sourceforge.net/easybox-mod/?rev=21&view=rev Author: Micht Date: 2006-10-02 04:58:08 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Ajout du module d'horoscope. Modified Paths: -------------- trunk/_utilisateur/modules.db trunk/module/_menu/menu.php Added Paths: ----------- trunk/module/horoscope/ trunk/module/horoscope/images/ trunk/module/horoscope/images/bleu_01.gif trunk/module/horoscope/images/bleu_02.gif trunk/module/horoscope/images/bleu_03.gif trunk/module/horoscope/images/bleu_04.gif trunk/module/horoscope/images/bleu_05.gif trunk/module/horoscope/images/bleu_06.gif trunk/module/horoscope/images/bleu_07.gif trunk/module/horoscope/images/bleu_08.gif trunk/module/horoscope/images/bleu_09.gif trunk/module/horoscope/images/bleu_10.gif trunk/module/horoscope/images/bleu_11.gif trunk/module/horoscope/images/bleu_12.gif trunk/module/horoscope/index1.php trunk/skin/simple/horoscope.tpl trunk/skin/simple/icones/Horoscope.gif Modified: trunk/_utilisateur/modules.db =================================================================== (Binary files differ) Modified: trunk/module/_menu/menu.php =================================================================== --- trunk/module/_menu/menu.php 2006-10-02 07:38:56 UTC (rev 20) +++ trunk/module/_menu/menu.php 2006-10-02 11:58:08 UTC (rev 21) @@ -3,21 +3,30 @@ require($RACINE_REP.'_framework/framework.php'); //Fonction renvoyant la liste des modules multim\xE9dias et des diff\xE9rentes cat\xE9gories de modules -function LOAD_MENU1(){ -global $xml, $LEVEL_ACTIF, $USER; - -$db = sqlite_open($USER.'modules.db', 0666); -$res = sqlite_query($db,'SELECT * FROM modules WHERE ((type="Module" AND categorie=1) OR (type="Cat\xE9gorie" AND nom!="Menu")) AND '.$LEVEL_ACTIF.'=1'); -$MENU=array(); - -while($resu = sqlite_fetch_array($res)){ - $MENU[]=array('name'=>$resu['nom'],'num'=>$resu['id'],'rep'=>$resu['repertoire'],'lien'=>$resu['lien'],'ico'=>str_replace(array('>',' !',' ','\xE9','\xEE','\xF4'),array('','','','e','i','o'),$resu['nom'])); +function LOAD_MENU1() +{ + global $xml, $LEVEL_ACTIF, $USER, $ini; + + $db = sqlite_open($USER.'modules.db', 0666); + if ($ini[explorateur][afficher_categories] == 'oui') + { + $query = 'SELECT * FROM modules WHERE ((type="Module" AND categorie=1) OR (type="Cat\xE9gorie" AND nom!="Menu")) AND '.$LEVEL_ACTIF.'=1'; + } else + { + $query = 'SELECT * FROM modules WHERE type="Module" AND categorie=1 AND '.$LEVEL_ACTIF.'=1'; + } + $res = sqlite_query($db, $query); + + $MENU = array(); + while($resu = sqlite_fetch_array($res)) + { + $MENU[]=array('name'=>$resu['nom'],'num'=>$resu['id'],'rep'=>$resu['repertoire'],'lien'=>$resu['lien'],'ico'=>str_replace(array('>',' !',' ','\xE9','\xEE','\xF4'),array('','','','e','i','o'),$resu['nom'])); + } + + sqlite_close($db); + RETURN($MENU); } -sqlite_close($db); -RETURN($MENU); -} - //Fonction renvoyant la liste des modules d'une cat\xE9gorie function LOAD_MENU2($categorie='0'){ global $xml, $LEVEL_ACTIF, $USER; Added: trunk/module/horoscope/images/bleu_01.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_01.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_02.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_02.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_03.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_03.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_04.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_04.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_05.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_05.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_06.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_06.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_07.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_07.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_08.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_08.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_09.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_09.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_10.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_10.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_11.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_11.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/images/bleu_12.gif =================================================================== (Binary files differ) Property changes on: trunk/module/horoscope/images/bleu_12.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/module/horoscope/index1.php =================================================================== --- trunk/module/horoscope/index1.php (rev 0) +++ trunk/module/horoscope/index1.php 2006-10-02 11:58:08 UTC (rev 21) @@ -0,0 +1,76 @@ +<?php + $RACINE_REP = "../../"; + require($RACINE_REP.'_framework/framework.php'); + + if (isset($_REQUEST['sign'])) + { + // 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'); + + if ($xml = file_get_contents('http://www.asiaflash.com/horoscope/'.$liens[$_REQUEST['sign']-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)) + { + 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>'; + } + */ + + // R\xE9cup de l'item + $posDeb = strpos($xml,"<item>")+6; + $posFin = strpos($xml,"</item>"); + $xml = substr($xml, $posDeb, $posFin-$posDeb); + + + // 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'; + } + + if (!isset($entete) || $entete == '') + { + // Affichage de la table de choix + $entete = 'Choisissez un signe'; + $description = ''; + + $LINK['red']= $MODULE.'_menu/menu.php?cat=18'; + } + + $smarty->assign('TITRE','Horoscope'); + $smarty->assign('entete',$entete); + $smarty->assign('description',$description); + $smarty->assign('CONTENT',$smarty->fetch('horoscope.tpl')); + $smarty->display('interface.tpl'); +?> Added: trunk/skin/simple/horoscope.tpl =================================================================== --- trunk/skin/simple/horoscope.tpl (rev 0) +++ trunk/skin/simple/horoscope.tpl 2006-10-02 11:58:08 UTC (rev 21) @@ -0,0 +1,31 @@ +<font size="3">{$entete}</font><br> +{if $description AND $description != ''} +{$description} +{else} + <br/> + <br/> + <br/> +<center> +<table border="0" cellspacing="0" cellpadding="0" align="center"> +<tr> + <td align="center" width="80"><img src="images/bleu_01.gif"><br><a href="index1.php?sign=1"><font size="1">B\xE9lier</font></a></td> + <td align="center" width="80"><img src="images/bleu_02.gif"><br><a href="index1.php?sign=2"><font size="1">Taureau</font></a></td> + <td align="center" width="80"><img src="images/bleu_03.gif"><br><a href="index1.php?sign=3"><font size="1">G\xE9meaux</font></a></td> + <td align="center" width="80"><img src="images/bleu_04.gif"><br><a href="index1.php?sign=4"><font size="1">Cancer</font></a></td> + <td align="center" width="80"><img src="images/bleu_05.gif"><br><a href="index1.php?sign=5"><font size="1">Lion</font></a></td> + <td align="center" width="80"><img src="images/bleu_06.gif"><br><a href="index1.php?sign=6"><font size="1">Vierge</font></a></td> +</tr> +<tr> + <td height="13" colspan="6"> + </td> +</tr> +<tr> + <td align="center" width="80"><img src="images/bleu_07.gif"><br><a href="index1.php?sign=7"><font size="1">Balance</font></a></td> + <td align="center" width="80"><img src="images/bleu_08.gif"><br><a href="index1.php?sign=8"><font size="1">Scorpion</font></a></td> + <td align="center" width="80"><img src="images/bleu_09.gif"><br><a href="index1.php?sign=9"><font size="1">Sagittaire</font></a></td> + <td align="center" width="80"><img src="images/bleu_10.gif"><br><a href="index1.php?sign=10"><font size="1">Capricorne</font></a></td> + <td align="center" width="80"><img src="images/bleu_11.gif"><br><a href="index1.php?sign=11"><font size="1">Verseau</font></a></td> + <td align="center" width="80"><img src="images/bleu_12.gif"><br><a href="index1.php?sign=12"><font size="1">Poissons</font></a></td> +</tr> +</table> +{/if} \ No newline at end of file Added: trunk/skin/simple/icones/Horoscope.gif =================================================================== (Binary files differ) Property changes on: trunk/skin/simple/icones/Horoscope.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |