本文整理匯總了PHP中DAO::readRSSfromURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAO::readRSSfromURL方法的具體用法?PHP DAO::readRSSfromURL怎麽用?PHP DAO::readRSSfromURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAO
的用法示例。
在下文中一共展示了DAO::readRSSfromURL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DAO
<?php
require_once "../model/DAO.class.php";
require_once "../model/RSS.class.php";
require_once "../model/Nouvelle.class.php";
$url = 'http://www.lemonde.fr/m-actu/rss_full.xml';
$dao = new DAO();
$rss = $dao->readRSSfromURL($url);
if ($rss == NULL) {
$rss = $dao->createRSS($url);
}
// Mise à jour du flux
$dao->updateRSS($rss);
$i_i = 0;
foreach ($rss->getNews() as $key => $value) {
$dao->createNouvelle($value, $dao->getRssId($rss));
$data['news'][$i_i] = $value;
$i_i++;
}
include_once "../view/afficher_flux.view.php";
?>
f
示例2: header
echo "utilisateur inconnu !";
}
}
}
} else {
if (isset($_GET['deconnexion'])) {
$_SESSION['pseudo'] = NULL;
header('Location: ' . $_SERVER['PHP_SELF']);
}
echo "<p>Bienvenue " . $_SESSION['pseudo'] . " !</p>";
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?deconnexion\">Se déconnecter</a>";
include_once '../view/ajout_flux.view.php';
$r = $dao->getRSSforUser($_SESSION['pseudo']);
foreach ($r as $key => $value) {
$data['url'] = $value->getUrl();
$data['id'] = $dao->getRssId($dao->readRSSfromURL($data['url']));
$data['name'] = $dao->getNameRSSforUser($_SESSION['pseudo'], $value);
$data['categorie'] = $dao->getCategorieRSS($_SESSION['pseudo'], $value);
include '../view/gestion_flux_view.php';
}
if (isset($_POST['rssURL']) && $_POST['rssURL'] != '') {
error_reporting(E_ERROR | E_PARSE);
try {
$content = file_get_contents($_POST['rssURL']);
$rss = new SimpleXmlElement($content);
header('Location: ' . $_SERVER['PHP_SELF']);
$dao->createRSS($_POST['rssURL']);
} catch (Exception $e) {
echo $_POST['rssURL'] . " n'est pas un flux RSS valide";
}
$dao->newSubforUser($_SESSION['pseudo'], $dao->getRssId($dao->readRSSfromURL($_POST['rssURL'])), $_POST['nom'], $_POST['categorie']);