|
From: <ara...@us...> - 2007-06-02 12:44:33
|
Revision: 174
http://svn.sourceforge.net/easybox-mod/?rev=174&view=rev
Author: aragornis
Date: 2007-06-02 05:44:30 -0700 (Sat, 02 Jun 2007)
Log Message:
-----------
Cette version de la d?\195?\169tection de la version de la fbx doit, enfin, etre fonctionnelle !
Modified Paths:
--------------
trunk/_framework/fonctions_partagees.inc.php
trunk/_framework/framework.php
trunk/module/telesites/index1.php
Modified: trunk/_framework/fonctions_partagees.inc.php
===================================================================
--- trunk/_framework/fonctions_partagees.inc.php 2007-06-02 09:44:51 UTC (rev 173)
+++ trunk/_framework/fonctions_partagees.inc.php 2007-06-02 12:44:30 UTC (rev 174)
@@ -1,6 +1,7 @@
<?php
function fbx_GetBoxUserAgent()
{
+global $HTTP_SERVER_VARS;
// Analyse le user_agent de la box
// Le firmware peut \xEAtre dans le format :
// freebox/1.0.0 (hw:5.0; sw:1.2.1) ifc:12345678901
@@ -10,26 +11,26 @@
if (isset($HTTP_SERVER_VARS['HTTP_X_BOX_USER_AGENT'])) $userboxagent =
$HTTP_SERVER_VARS['HTTP_X_BOX_USER_AGENT'];
- if (isset($HTTP_SERVER_VARS['HTTP_BOX_USER_AGENT'])) $userboxagent =
- $HTTP_SERVER_VARS['HTTP_BOX_USER_AGENT'];
-
+ if (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) $userboxagent =
+ $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
+
if (isset($userboxagent))
{
+
// Nouveau format de useragent
- if (preg_match('/(.*)\/(.*) \(hw:(.*); sw:(.*)\) ifc:(.*)/', $box_user_agent, $regs))
+ if (preg_match('/(.*)\/(.*) \(hw:(.*); sw:(.*)\) ifc:(.) canal_dep:(.)/', $userboxagent, $regs))
{
$boxinfo['name'] = $regs[1];
- $boxinfo['version'] = $regs[2];
- $boxinfo['firmware'] = $regs[3];
- $boxinfo['browser_version'] = $regs[4];
+ $boxinfo['version'] = intval($regs[3]);
+ $boxinfo['firmware'] = $regs[4];
+ $boxinfo['browser_version'] = $regs[2];
$boxinfo['ifc'] = $regs[5];
}
else
{
preg_match('/(.*)\/(.*)/', $box_user_agent, $regs);
-
$boxinfo['name'] = $regs[1];
- $boxinfo['version'] = "x.x";
+ $boxinfo['version'] = 3;
$boxinfo['firmware'] = $regs[2];
$boxinfo['browser_version'] = "#";
$boxinfo['ifc'] = "#";
Modified: trunk/_framework/framework.php
===================================================================
--- trunk/_framework/framework.php 2007-06-02 09:44:51 UTC (rev 173)
+++ trunk/_framework/framework.php 2007-06-02 12:44:30 UTC (rev 174)
@@ -53,9 +53,10 @@
$LOAD = $FRAMEWORK_REP.'fonctions_partagees.inc.php';
require_once($LOAD);
// version de freebox
- $info_fbx=fbx_GetBoxUserAgent();
- $vers_fbx =$info_fbx['version'];
+ $info_fbx = fbx_GetBoxUserAgent();
+ $vers_fbx = $info_fbx['version'];
$smarty->assign('vers_fbx',$vers_fbx);
+ file_put_contents($RACINE_REP.'log.txt',"\r\n".$HTTP_SERVER_VARS['HTTP_USER_AGENT']);
$EXPLORATEUR = $MODULE.'_explorateur/index1.php';
$smarty->assign('EXPLORATEUR',$EXPLORATEUR);
Modified: trunk/module/telesites/index1.php
===================================================================
--- trunk/module/telesites/index1.php 2007-06-02 09:44:51 UTC (rev 173)
+++ trunk/module/telesites/index1.php 2007-06-02 12:44:30 UTC (rev 174)
@@ -26,12 +26,21 @@
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)");
-$base = $sites[$_GET['siteid']]['url'];
+if(isset($_GET['url'])){
+ $base = urldecode($_GET['url']);
+}else{
+ $base = $sites[$_GET['siteid']]['url'];
+}
+
$contenu = file_get_contents($base);
-$contenu = str_replace('src="images/', 'src="'.$IMG2FBX.'?cache=1&img='.urlencode($base.'images/'), $contenu);
+$info_url = ParseURLplus($base);
+
+
+$contenu = preg_replace('/href="(.{1,300})"/se', "'href=\"index1.php?siteid={$_GET['siteid']}&url='.urlencode('http://{$info_url['host']}').stripslashes('$1').'\"';", $contenu);
+$contenu = preg_replace('/src="(.{1,300})"/se', "'src=\"{$IMG2FBX}?cache=1&img='.urlencode('http://{$info_url['host']}').'$1'.'\"';", $contenu);
$contenu = str_replace('</body>', '<script language="javascript" src="/fb2ie.js"></script></body>', $contenu);
-$ereg = '<contentInfo>(.{1,800})<\/contentInfo>';
+$ereg = '<source>(.{1,800})<\/source>';
preg_match("/$ereg/s", $contenu, $valeur);
$commandes = $valeur[1];
@@ -41,10 +50,14 @@
$xml = simplexml_load_string($commandes);
$xml2 = simplexml_load_string($commandes2);
-$res = $xml->xpath('/hj:imageInfo/source/url');
+if($res = @$xml->xpath('/url')){
+ play_fichier('type=20&temps=8000',$res[0],0,'photo');
+}
$res2 = $xml2->xpath('/backgroundContent/settings');
$forcerimage = $res2[0]['stopCurrentlyPlaying'];
+
+
echo $contenu;
}else{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|