本文整理汇总了PHP中DAO::getRssId方法的典型用法代码示例。如果您正苦于以下问题:PHP DAO::getRssId方法的具体用法?PHP DAO::getRssId怎么用?PHP DAO::getRssId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAO
的用法示例。
在下文中一共展示了DAO::getRssId方法的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']);