From: <ara...@us...> - 2007-06-01 04:45:02
|
Revision: 169 http://svn.sourceforge.net/easybox-mod/?rev=169&view=rev Author: aragornis Date: 2007-05-31 21:44:56 -0700 (Thu, 31 May 2007) Log Message: ----------- Avanc?\195?\169es sur le telesite Modified Paths: -------------- trunk/_framework/fonctions_partagees.inc.php trunk/_framework/lib/lib_photo.php trunk/_utilisateur/modules.db trunk/module/telesites/index1.php trunk/module/telesites/telesite.tpl trunk/skin/ETI/menu.tpl Modified: trunk/_framework/fonctions_partagees.inc.php =================================================================== --- trunk/_framework/fonctions_partagees.inc.php 2007-05-31 04:53:08 UTC (rev 168) +++ trunk/_framework/fonctions_partagees.inc.php 2007-06-01 04:44:56 UTC (rev 169) @@ -856,14 +856,19 @@ } // T\xE9l\xE9charge une page internet et la met en cache ou r\xE9cup\xE8re directement son contenu mis en cache -function file_get_contents_cache($adresse, $heures=1){ +function file_get_contents_cache($adresse, $heures=1, $use_include_path=null, $context=null, $offset=null, $maxlen=null){ global $USER, $CACHE_IMAGE; $db = sqlite_open($USER.'cache.db', 0666); $fichier = md5($adresse); clean_cache(); $res = sqlite_query($db,'SELECT * FROM cache WHERE fichier="'.$fichier.'"'); if(sqlite_num_rows($res)>0 AND file_exists($CACHE_IMAGE.$fichier)){ + if(isset($use_include_path)){ + $retour = file_get_contents($CACHE_IMAGE.$fichier,$use_include_path,$context,$offset,$maxlen); + }else{ $retour = file_get_contents($CACHE_IMAGE.$fichier); + } + }else{ $retour = file_get_contents($adresse); file_put_contents($CACHE_IMAGE.$fichier, $retour); Modified: trunk/_framework/lib/lib_photo.php =================================================================== --- trunk/_framework/lib/lib_photo.php 2007-05-31 04:53:08 UTC (rev 168) +++ trunk/_framework/lib/lib_photo.php 2007-06-01 04:44:56 UTC (rev 169) @@ -45,7 +45,10 @@ // Path du fichier en cache var $name_cache; -function __construct($url, $r_width, $r_height, $angle, $cache, $quality){ +var $transparence; + + +function __construct($url, $r_width, $r_height, $angle, $cache, $quality, $transparence=false){ global $_SERVER, $CACHE_IMAGE; $this->url = $url; $this->cache = $cache; @@ -55,7 +58,8 @@ $this->cache = $cache; $this->quality = $quality; $this->hash = md5($this->url.$this->r_height.$this->r_width.$this->angle); - + $this->transparence = $transparence; + define("IMAGE_FLIP_HORIZONTAL", 1); define("IMAGE_FLIP_VERTICAL", 2); define("IMAGE_FLIP_BOTH", 3); @@ -130,27 +134,27 @@ $trans = imagecolortransparent($this->img); if($trans!=-1){ - $trans = imagecolorsforindex($this->img,imagecolortransparent($this->img)); + $this->couleur_fond = imagecolorsforindex($this->img,$trans); } // Tourner $this->tourner(); - + // Redimensionner if($this->r_width!=0 AND $this->r_height!=0){ $this->redimensionner(); } - if($trans!=-1){ - imagecolortransparent($this->img,imagecolorallocate($this->img, $trans['red'], $trans['green'], $trans['blue'])); + if($this->transparence){ + imagetruecolortopalette($this->img, false, 128); + imagecolortransparent($this->img, imagecolorat($this->img, 0, 0)); } - // Mettre en cache if($this->cache){ $this->generer_fichier(); } - + // Renvoyer $this->afficher_image(); @@ -180,12 +184,13 @@ if($pourcent<1){ $redimx = floor($this->width*$pourcent); $redimy = floor($this->height*$pourcent); - $image1 = imagecreatetruecolor($redimx, $redimy); + + $image1 = imagecreatetruecolor($redimx, $redimy); imagesavealpha($image1, true); $trans_colour = imagecolorallocatealpha($image1, 0, 0, 0, 127); imagefill($image1, 0, 0, $trans_colour); imagealphablending($image1, false); - + if($this->quality=='max'){ ImageCopyresampled($image1,$this->img,0,0,0,0,$redimx,$redimy,$this->width,$this->height); }else{ @@ -276,6 +281,6 @@ } -$img = new image(urldecode($_GET['img']), $_GET['width'], $_GET['height'], $_GET['angle'], $_GET['cache'], $_GET['quality']); +$img = new image(urldecode($_GET['img']), $_GET['width'], $_GET['height'], $_GET['angle'], $_GET['cache'], $_GET['quality'], $_GET['transparence']); $img->process(); ?> Modified: trunk/_utilisateur/modules.db =================================================================== (Binary files differ) Modified: trunk/module/telesites/index1.php =================================================================== --- trunk/module/telesites/index1.php 2007-05-31 04:53:08 UTC (rev 168) +++ trunk/module/telesites/index1.php 2007-06-01 04:44:56 UTC (rev 169) @@ -2,10 +2,20 @@ $RACINE_REP = "../../"; require($RACINE_REP.'_framework/framework.php'); +function ParseURLplus($url){ +$URLpcs = (parse_url($url)); +$PathPcs = explode("/",$URLpcs['path']); +$URLpcs['file'] = end($PathPcs); +unset($PathPcs[key($PathPcs)]); +$URLpcs['dir'] = implode("/",$PathPcs); +return ($URLpcs); +} + function parse_sites($xml){ $RES = array(); + $i=0; foreach($xml->xpath('/ts-freebox/telesite') as $telesite){ - $RES[] = array('nom'=>$telesite->name,'url'=>$telesite->url,'weburl'=>$telesite->weburl,'category'=>$telesite->category,'screenshot'=>$telesite->screenshot); + $RES[] = array('id'=>$i++,'nom'=>utf8_decode($telesite->name),'url'=>utf8_decode($telesite->url),'weburl'=>utf8_decode($telesite->weburl),'category'=>utf8_decode($telesite->category),'screenshot'=>utf8_decode($telesite->screenshot)); } return $RES; } @@ -13,15 +23,32 @@ $xml = simplexml_load_file_cache('http://www.freeplayer.org/telesite.xml',24); $sites = parse_sites($xml); +if(isset($_GET['siteid'])){ +ini_set('user_agent', "EasyBox 4.1.2\r\nX-Box-User-Agent: freebox/1.0.0 (hw:4.0; sw:1.8.0)"); -if(isset($_GET['siteid'])){ $base = $sites[$_GET['siteid']]['url']; -$contenu = file_get_contents_cache($base.'index.php?'.$_SERVER['QUERY_STRING'],24); +$contenu = file_get_contents($base); $contenu = str_replace('src="images/', 'src="'.$IMG2FBX.'?cache=1&img='.urlencode($base.'images/'), $contenu); +$contenu = str_replace('</body>', '<script language="javascript" src="/fb2ie.js"></script></body>', $contenu); +$ereg = '<contentInfo>(.{1,800})<\/contentInfo>'; +preg_match("/$ereg/s", $contenu, $valeur); +$commandes = $valeur[1]; + +$ereg = '<backgroundContent>(.{1,800})<\/backgroundContent>'; +preg_match("/$ereg/s", $contenu, $valeur); +$commandes2 = $valeur[0]; + +$xml = simplexml_load_string($commandes); +$xml2 = simplexml_load_string($commandes2); +$res = $xml->xpath('/hj:imageInfo/source/url'); +$res2 = $xml2->xpath('/backgroundContent/settings'); +$forcerimage = $res2[0]['stopCurrentlyPlaying']; + echo $contenu; + }else{ -$smarty->assign('xml',$xml); +$smarty->assign('SITES',$sites); $smarty->assign('CONTENT',$smarty->fetch('telesite.tpl')); $smarty->display('interface.tpl'); } Modified: trunk/module/telesites/telesite.tpl =================================================================== --- trunk/module/telesites/telesite.tpl 2007-05-31 04:53:08 UTC (rev 168) +++ trunk/module/telesites/telesite.tpl 2007-06-01 04:44:56 UTC (rev 169) @@ -1,71 +1,36 @@ -{if $FLUX==''} - {section name=liste loop=$RSS max=3 start=$MIN} - {if $smarty.section.liste.first} - {if $MIN!=0} - {assign var=temp value=$MIN-3} - {attribbouton touche="green" lien="index1.php?cat=$cat&min=$temp"} - <a href="index1.php?cat={$cat}&min={$temp}"><img src="{$INTERFACE_REP}btn_vert.gif" border="0"> Pr\xE9c\xE9dent</a> +{assign var=NUM_ROW_AFFICH value=15} +{section name=site loop=$SITES max=$NUM_ROW_AFFICH start=$START} +{cycle name=place assign=place print=false values="4,3,2,1,0"} + {if $smarty.section.site.first} + <table border="0" cellpadding="0" cellspacing="0" width="500" align="center"><tr> + {if !$_multipage.is_first_page} + <td colspan="5" align=center>{precedent}</td></tr><tr> + {/if} {/if} - <table width="500" border="0" cellspacing="5" cellpadding="5" align="left" valign="top"> - {/if} - - <tr><td><a href="index1.php?cat={$cat}&feed={$RSS[liste].id}"> - <table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND1#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"> - <tr> - <td align="left" valign="top" width="120"><img width="120" height="90" src="{$IMG2FBX}?img={$RSS[liste].img|urlencode}&width=120&height=90&cache=1"></td> - <td align="left" valign="top" width="380"><b><u>{$RSS[liste].name|truncate:30}</u></b><br>{$RSS[liste].description|truncate:100}</td> - </tr> - </table> - </a></td></tr> + + <td width="100" height="150"><a href="index1.php?siteid={$SITES[site].id}"><table border="0" cellpadding="0" cellspacing="0" width="100" height="120" bgcolor="{#COULEUR_FOND1#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"><tr height="80"><td width="100" height="80" valign="middle" align="center"><img width="83" height="60" border="0" src="{$IMG2FBX}?img={$SITES[site].screenshot|urlencode}&width=83&height=60&cache=1"></td></tr><tr height="70"><td width="100" height="70" valign="middle" align=center><font size="1">{$SITES[site].nom|truncate:30:"":true|wordwrap:15:"<br>":true}</font></td></tr></table></a></td> - {if $smarty.section.liste.last} - </table> - {if $MIN+$smarty.section.liste.total < count($RSS)} - {assign var=temp value=$MIN+3} - {attribbouton touche="blue" lien="index1.php?cat=$cat&min=$temp"} - <a href="index1.php?cat={$cat}&min={$temp}"><img src="{$INTERFACE_REP}btn_bleu.gif" border="0"> Suivant</a> - {/if} - {/if} - - {sectionelse} - Cette cat\xE9gorie ne contient aucun flux. Vous pouvez en ajouter depuis l'interface de configuration d'Easybox. - {/section} - -{else} - {section name=liste loop=$FLUX max=5 start=$MIN} - {if $smarty.section.liste.first} - {if $MIN!=0} - {assign var=temp value=$MIN-5} - {assign var=temp2 value=$cat.id} - {assign var=temp3 value=$feed.id} - {attribbouton touche="green" lien="index1.php?cat=$temp2&feed=$temp3&min=$temp"} - <a href="index1.php?cat={$cat.id}&feed={$feed.id}&min={$temp}"><img src="{$INTERFACE_REP}btn_vert.gif" border="0"> Pr\xE9c\xE9dent</a> - {/if} - <table width="500" border="0" cellspacing="7" cellpadding="7" align="left" valign="top"> - {/if} - - - <tr><td>{if $FLUX[liste].description!=''}<a href="index1.php?cat={$cat.id}&feed={$feed.id}&post={$FLUX[liste].id}">{/if} - <table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="{#COULEUR_FOND1#}" abgcolor="{#COULEUR_TABLE_SELECTED#}"> - <tr> - <td align="left" valign="top"><b><u>{$FLUX[liste].titre}</u></b>{if $FLUX[liste].description!=''} : {$FLUX[liste].description|truncate:50}{/if}</td> + {if $smarty.section.site.iteration is div by 5 AND NOT $smarty.section.files.last} + </tr><tr> + {/if} + + {if $smarty.section.site.last} + {if $place >= 4}<td> </td>{/if} + {if $place >= 3}<td> </td>{/if} + {if $place >= 2}<td> </td>{/if} + {if $place >= 1}<td> </td>{/if} </tr> - </table> - {if $FLUX[liste].description!=''}</a>{/if}</td></tr> - - {if $smarty.section.liste.last} - </table><br> - {if $MIN+$smarty.section.liste.total < count($FLUX)} - {assign var=temp value=$MIN+5} - {assign var=temp2 value=$cat.id} - {assign var=temp3 value=$feed.id} - {attribbouton touche="blue" lien="index1.php?cat=$temp2&feed=$temp3&min=$temp"} - <a href="index1.php?cat={$cat.id}&feed={$feed.id}&min={$temp}"><img src="{$INTERFACE_REP}btn_bleu.gif" border="0"> Suivant</a> - {/if} + <tr><td colspan="5" align="center" height="25" valign="bottom">{if !$_multipage.is_last_page}{suivant} - {/if}{pagination}</td></tr> + </table> {/if} +{sectionelse} + Veuillez entrer votre recherche ci-dessous. +{/section} - {sectionelse} - Ce flux ne contient aucun \xE9l\xE9ment. - {/section} - +{if $SHOW=='rec'} +<br>Recherche<br> <br><form name="form1" method="get" action="index1.php"> +<input name="show" type="hidden" value="rec"> +<input name="string" bgcolor="{#COULEUR_TEXTBOX#}" type="text" charset="digit|alpha|caps" value="" size="20"> +</form><br> +La touche {literal}#{/literal} permet de changer entre les minuscules/majuscules et les chiffres. {/if} Modified: trunk/skin/ETI/menu.tpl =================================================================== --- trunk/skin/ETI/menu.tpl 2007-05-31 04:53:08 UTC (rev 168) +++ trunk/skin/ETI/menu.tpl 2007-06-01 04:44:56 UTC (rev 169) @@ -33,7 +33,7 @@ {if $MENU[menu].name!='Web' AND $MENU[menu].name!='Multim\xE9dia' AND $MENU[menu].name!='Pratique'} <tr><td><table border="0" cellpadding="0" cellspacing="0" href="{$MODULE}{$MENU[menu].rep}{$MENU[menu].lien}" background="{$RACINE_REP}{$SKIN_REP}images/selection/selection_2.gif" once rollover><tr> <td width="40"> - <img width="35" height="35" src="{if $MENU[menu].dependance=='Alone'}{$IMG2FBX}?cache=1&width=40&height=40&img={$RES_ICO|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{else}{$IMG2FBX}?cache=1&width=35&height=35&img={$SKIN_REP|cat:"images/icons/"|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{/if}" border="0" /> + <img width="40" height="40" src="{if $MENU[menu].dependance=='Alone'}{$IMG2FBX}?cache=1&width=40&height=40&transparence=1&img={$RES_ICO|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{else}{$IMG2FBX}?cache=1&width=40&height=40&transparence=1&img={$SKIN_REP|cat:"images/icons/"|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{/if}" border="0" /> </td> <td width="150"> <font size="2" color="{#white#}"><b>{$MENU[menu].name}</b></font> @@ -45,7 +45,7 @@ {if $MENU[menu].name=="Films"} <tr><td><table border="0" cellpadding="0" cellspacing="0" href="{$MODULE}{$MENU[menu].rep}catalogue.php" background="{$RACINE_REP}{$SKIN_REP}images/selection/selection_2.gif" once rollover><tr> <td width="40"> - <img src="{if $MENU[menu].dependance=='Alone'}{$IMG2FBX}?cache=1&width=40&height=40&img={$RES_ICO|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{else}{$IMG2FBX}?cache=1&width=40&height=40&img={$SKIN_REP|cat:"images/icons/"|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{/if}" border="0" width="40" height="40"> + <img src="{if $MENU[menu].dependance=='Alone'}{$IMG2FBX}?cache=1&width=40&height=40&transparence=1&img={$RES_ICO|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{else}{$IMG2FBX}?cache=1&width=40&height=40&transparence=1&img={$SKIN_REP|cat:"images/icons/"|cat:$MENU[menu].ico|cat:".gif"|realpath|urlencode}{/if}" border="0" width="40" height="40"> </td> <td width="150"> <font size="2" color="{#white#}"><b>Catalogue</b></font> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |