本文整理汇总了PHP中PMF_Date::createRFC822Date方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Date::createRFC822Date方法的具体用法?PHP PMF_Date::createRFC822Date怎么用?PHP PMF_Date::createRFC822Date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Date
的用法示例。
在下文中一共展示了PMF_Date::createRFC822Date方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html_entity_decode
$rss->writeElement('title', $faqConfig->get('main.titleFAQ') . ' - ');
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
if (is_array($records)) {
foreach ($records as $item) {
$link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['record_link']);
if (PMF_RSS_USE_SEO) {
if (isset($item['record_title'])) {
$oLink = new PMF_Link($link, $faqConfig);
$oLink->itemTitle = $item['record_title'];
$link = $oLink->toString();
}
}
$rss->startElement('item');
$rss->writeElement('title', html_entity_decode($item['record_title'] . ' (' . $item['visits'] . ' ' . $PMF_LANG['msgViews'] . ')', ENT_COMPAT, 'UTF-8'));
$rss->startElement('description');
$rss->writeCdata($item['record_preview']);
$rss->endElement();
$rss->writeElement('link', $faqConfig->get('main.referenceURL') . $link);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['record_date'], true));
$rss->endElement();
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
$response = Response::create($rssData);
$response->headers->set('Content-Type', 'application/rss+xml');
$response->headers->set('Content-Length', strlen($rssData));
$response->send();
$faqConfig->getDb()->close();
示例2: html_entity_decode
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
$rss->startElementNS('atom', 'link', 'http://www.w3.org/2005/Atom');
$rss->writeAttribute('rel', 'self');
$rss->writeAttribute('type', 'application/rss+xml');
$rss->writeAttribute('href', $faqConfig->get('main.referenceURL') . 'feed/openquestions/rss.php');
$rss->endElement();
if ($num > 0) {
$counter = 0;
foreach ($rssData as $item) {
if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$counter++;
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['question'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['username'] . ")");
$rss->startElement('description');
$rss->writeCdata($item['question']);
$rss->endElement();
$rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']);
$rss->writeElement('guid', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['created'], true));
$rss->endElement();
}
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
$headers = array('Content-Type: application/rss+xml', 'Content-Length: ' . strlen($rssData));
$http = new PMF_Helper_Http();
$http->sendWithHeaders($rssData, $headers);
$faqConfig->getDb()->close();
示例3: html_entity_decode
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqconfig->get('main.titleFAQ') . ' - ' . $PMF_LANG['msgOpenQuestions']);
$rss->writeElement('description', html_entity_decode($faqconfig->get('main.metaDescription')));
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/openquestions/rss.php'));
if ($num > 0) {
$counter = 0;
foreach ($rssData as $item) {
if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$counter++;
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item->question), 8) . " (" . $item->username . ")");
$rss->startElement('description');
$rss->writeCdata($item->question);
$rss->endElement();
$rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $item->id);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item->date, true));
$rss->endElement();
}
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
header('Content-Type: application/rss+xml');
header('Content-Length: ' . strlen($rssData));
print $rssData;
$db->dbclose();
示例4: foreach
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php'));
if ($num > 0) {
$i = 0;
foreach ($rssData as $item) {
$i++;
// Get the url
$link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['url']);
if (PMF_RSS_USE_SEO) {
if (isset($item['thema'])) {
$oLink = new PMF_Link($link);
$oLink->itemTitle = html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8');
$link = html_entity_decode($oLink->toString(), ENT_COMPAT, 'UTF-8');
}
}
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")");
$rss->startElement('description');
$rss->writeCdata("[" . $i . ".] " . $item['thema'] . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")");
$rss->endElement();
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php') . $link);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['last_visit'], false));
$rss->endElement();
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
header('Content-Type: application/rss+xml');
header('Content-Length: ' . strlen($rssData));
print $rssData;
$db->dbclose();
示例5: foreach
foreach ($rssData as $item) {
// Get the url
$link = str_replace($_SERVER['PHP_SELF'], '/index.php', $item['url']);
if (PMF_RSS_USE_SEO) {
if (isset($item['thema'])) {
$oL = new PMF_Link($link);
$oL->itemTitle = $item['thema'];
$link = $oL->toString();
}
}
// Get the content
$content = $item['content'];
// Fix the content internal image references
$content = str_replace("<img src=\"/", "<img src=\"" . PMF_Link::getSystemUri('/feed/latest/rss.php') . "/", $content);
$rss->startElement('item');
$rss->writeElement('title', utf8_encode($item['thema']));
$rss->startElement('description');
$rss->writeCdata(utf8_encode($content));
$rss->endElement();
$rss->writeElement('link', utf8_encode(PMF_Link::getSystemUri('/feed/latest/rss.php') . $link));
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['datum'], false));
$rss->endElement();
}
}
$rss->endElement();
$rss->endElement();
$rssData = $rss->outputMemory();
header('Content-Type: application/rss+xml');
header('Content-Length: ' . strlen($rssData));
print $rssData;
$db->dbclose();