Ejemplo n.º 1
0
 function fetch_xml($url)
 {
     $xml_string =& fetch_file_via_socket($url);
     if ($xml_string === false or empty($xml_string['body'])) {
         // error returned
         if (VB_AREA == 'AdminCP') {
             trigger_error('Unable to fetch RSS Feed', E_USER_WARNING);
         }
     }
     $xml_string = $xml_string['body'];
     // There are some RSS feeds that embed (HTML) tags within the description without
     // CDATA. While this is actually invalid, try to workaround it by wrapping the
     // contents in CDATA if it contains a < and is not in CDATA already.
     // This must be done before parsing because our parser can't handle the output.
     if (preg_match_all('#(<description>)(.*)(</description>)#siU', $xml_string, $matches, PREG_SET_ORDER)) {
         foreach ($matches as $match) {
             if (strpos(strtoupper($match[2]), '<![CDATA[') === false and strpos($match[2], '<') !== false) {
                 // no CDATA tag, but we have an HTML tag
                 $output = $match[1] . '<![CDATA[' . vB_XML_Builder::escape_cdata($match[2]) . ']]>' . $match[3];
                 $xml_string = str_replace($match[0], $output, $xml_string);
             }
         }
     }
     $this->set_xml_string($xml_string);
     return true;
 }
Ejemplo n.º 2
0
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 83432 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
global $phrasegroups, $specialtemplates;
$phrasegroups = array();
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once dirname(__FILE__) . '/global.php';
require_once DIR . '/includes/class_rss_poster.php';
header('Content-Type: text/xml; charset=utf-8');
$licenseid = 'LD18132D6F';
$config = vB::getConfig();
if (isset($config['Misc']['licenseid'])) {
    $licenseid = $config['Misc']['licenseid'];
}
if ($result = fetch_file_via_socket('http://version.vbulletin.com/news.xml?v=' . SIMPLE_VERSION . "&id={$licenseid}", array('type' => ''))) {
    echo $result['body'];
} else {
    echo 'Error';
}
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 83432 $
|| #######################################################################
\*=========================================================================*/
Ejemplo n.º 3
0
|| #################################################################### ||
|| # vBulletin 4.2.2 Alpha 1 - Licence Number VBFSA2W3VC
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2013 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 32878 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/class_rss_poster.php';
header('Content-Type: text/xml; charset=utf-8');
if ($result = fetch_file_via_socket('http://version.vbulletin.com/news.xml?v=' . SIMPLE_VERSION . '&id=VBFSA2W3VC', array('type' => ''))) {
    echo $result['body'];
} else {
    echo 'Error';
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/
Ejemplo n.º 4
0
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 32878 $');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();

$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/class_rss_poster.php');

header('Content-Type: text/xml; charset=utf-8');

if ($result = fetch_file_via_socket('' . SIMPLE_VERSION . '&id=', array('type' => '')))
{	
	echo $result['body'];
}
else
{
	echo 'Error';
}


/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/