当前位置: 首页>>代码示例>>PHP>>正文


PHP FeedDate::rfc3339方法代码示例

本文整理汇总了PHP中FeedDate::rfc3339方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedDate::rfc3339方法的具体用法?PHP FeedDate::rfc3339怎么用?PHP FeedDate::rfc3339使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FeedDate的用法示例。


在下文中一共展示了FeedDate::rfc3339方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createFeed

 function createFeed()
 {
     $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n";
     $feed .= $this->_createGeneratorComment();
     $feed .= $this->_createStylesheetReferences();
     $feed .= "<feed xmlns=\"http://www.w3.org/2005/Atom\"";
     if ($this->format == 'TOOLBAR') {
         $feed .= " xmlns:gtb=\"http://toolbar.google.com/custombuttons/\"";
     }
     if ($this->language != "") {
         $feed .= " xml:lang=\"" . $this->language . "\"";
     }
     $feed .= ">\n";
     $feed .= "    <title>" . htmlspecialchars($this->title) . "</title>\n";
     $feed .= "    <subtitle>" . htmlspecialchars($this->description) . "</subtitle>\n";
     $feed .= "    <link rel=\"alternate\" type=\"text/html\" href=\"" . htmlspecialchars($this->link) . "\"/>\n";
     if ($this->syndicationURL != '') {
         $feed .= "    <link href=\"" . $this->syndicationURL . "\" rel=\"self\" type=\"" . $this->contentType . "\"/>\n";
     }
     $feed .= "    <id>" . htmlspecialchars($this->link) . "</id>\n";
     $now = new FeedDate();
     $feed .= "    <updated>" . htmlspecialchars($now->rfc3339()) . "</updated>\n";
     if ($this->editor != "") {
         $feed .= "    <author>\n";
         $feed .= "        <name>" . $this->editor . "</name>\n";
         if ($this->editorEmail != "") {
             $feed .= "        <email>" . $this->editorEmail . "</email>\n";
         }
         $feed .= "    </author>\n";
     }
     $feed .= "    <generator>" . FEEDCREATOR_VERSION . "</generator>\n";
     $feed .= $this->_createAdditionalElements($this->additionalElements, "    ");
     for ($i = 0; $i < count($this->items); $i++) {
         $feed .= "    <entry>\n";
         $feed .= "        <title>" . utf8_encode(htmlnumericentities(strip_tags($this->items[$i]->title))) . "</title>\n";
         $feed .= "        <link rel=\"alternate\" type=\"text/html\" href=\"" . htmlspecialchars($this->items[$i]->link) . "\"/>\n";
         if ($this->items[$i]->date == "") {
             $this->items[$i]->date = time();
         }
         $itemDate = new FeedDate($this->items[$i]->date);
         $feed .= "        <updated>" . htmlspecialchars($itemDate->rfc3339()) . "</updated>\n";
         $feed .= "        <published>" . htmlspecialchars($itemDate->rfc3339()) . "</published>\n";
         $feed .= "        <id>" . htmlspecialchars($this->items[$i]->link) . "</id>\n";
         $feed .= $this->_createAdditionalElements($this->items[$i]->additionalElements, "        ");
         if ($this->items[$i]->author != "") {
             $feed .= "        <author>\n";
             $feed .= "            <name>" . htmlnumericentities($this->items[$i]->author) . "</name>\n";
             $feed .= "        </author>\n";
         }
         if ($this->items[$i]->description != "") {
             $feed .= "        <summary>" . utf8_encode(htmlnumericentities($this->items[$i]->description)) . "</summary>\n";
         }
         if ($this->items[$i]->thumbdata) {
             $feed .= "        <gtb:icon mode=\"base64\" type=\"image/jpeg\">\n";
             $feed .= chunk_split(base64_encode($this->items[$i]->thumbdata)) . "\n";
             $feed .= "        </gtb:icon>\n";
         }
         $feed .= "    </entry>\n";
     }
     $feed .= "</feed>\n";
     return $feed;
 }
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:62,代码来源:feedcreator.class.php


注:本文中的FeedDate::rfc3339方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。