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


PHP FabrikWorker::getPodcastMimeType方法代码示例

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


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

示例1: display


//.........这里部分代码省略.........
     // If they are there don't put them in the desc but put them in as a separate item param
     $rssTags = array('<georss:point>' => 'xmlns:georss="http://www.georss.org/georss"');
     foreach ($rows as $group) {
         foreach ($group as $row) {
             // Get the content
             $str2 = '';
             $str = '';
             $tStart = '<table style="margin-top:10px;padding-top:10px;">';
             $title = '';
             $item = new JFabrikFeedItem();
             $enclosures = array();
             foreach ($aTableHeadings as $heading => $dbColName) {
                 if ($dbColName['enclosure']) {
                     // $$$ hugh - diddling around trying to add enclosures
                     $colName = $dbColName['colName'] . '_raw';
                     $enclosureUrl = $row->{$colName};
                     if (!empty($enclosureUrl)) {
                         $remoteFile = false;
                         // Element value should either be a full path, or relative to J! base
                         if (strstr($enclosureUrl, 'http://') && !strstr($enclosureUrl, COM_FABRIK_LIVESITE)) {
                             $enclosureFile = $enclosureUrl;
                             $remoteFile = true;
                         } elseif (strstr($enclosureUrl, COM_FABRIK_LIVESITE)) {
                             $enclosureFile = str_replace(COM_FABRIK_LIVESITE, COM_FABRIK_BASE, $enclosureUrl);
                         } elseif (preg_match('#^' . COM_FABRIK_BASE . "#", $enclosureUrl)) {
                             $enclosureFile = $enclosureUrl;
                             $enclosureUrl = str_replace(COM_FABRIK_BASE, '', $enclosureUrl);
                         } else {
                             $enclosureFile = COM_FABRIK_BASE . $enclosureUrl;
                             $enclosureUrl = COM_FABRIK_LIVESITE . str_replace('\\', '/', $enclosureUrl);
                         }
                         if ($remoteFile || file_exists($enclosureFile) && !is_dir($enclosureFile)) {
                             $enclosureType = '';
                             if ($enclosureType = FabrikWorker::getPodcastMimeType($enclosureFile)) {
                                 $enclosure_size = $this->get_filesize($enclosureFile, $remoteFile);
                                 $enclosures[] = array('url' => $enclosureUrl, 'length' => $enclosure_size, 'type' => $enclosureType);
                                 /**
                                  * No need to insert the URL in the description, as feed readers should
                                  * automagically show 'media' when they see an 'enclosure', so just move on ..
                                  */
                                 continue;
                             }
                         }
                     }
                 }
                 if ($title == '') {
                     // Set a default title
                     $title = $row->{$dbColName}['colName'];
                 }
                 // Rob - was stripping tags - but aren't they valid in the content?
                 $rssContent = $row->{$dbColName}['colName'];
                 $found = false;
                 foreach ($rssTags as $rssTag => $namespace) {
                     if (strstr($rssContent, $rssTag)) {
                         $found = true;
                         $rssTag = JString::substr($rssTag, 1, JString::strlen($rssTag) - 2);
                         if (!strstr($this->doc->_namespace, $namespace)) {
                             $this->doc->_itemTags[] = $rssTag;
                             $this->doc->_namespace .= $namespace . " ";
                         }
                         break;
                     }
                 }
                 if ($found) {
                     $item->{$rssTag} = $rssContent;
                 } else {
开发者ID:glauberm,项目名称:cinevi,代码行数:67,代码来源:view.fabrikfeed.php

示例2: display


//.........这里部分代码省略.........
             $str = '';
             $tstart = '<table style="margin-top:10px;padding-top:10px;">';
             //used for content not in dl
             //ok for feed gator you cant have the same item title so we'll take the first value from the table (asume its the pk and use that to append to the item title)'
             $title = '';
             $item = new JFabrikFeedItem();
             $enclosures = array();
             foreach ($aTableHeadings as $heading => $dbcolname) {
                 if ($dbcolname['enclosure']) {
                     // $$$ hugh - diddling aorund trying to add enclosures
                     $colName = $dbcolname['colName'] . '_raw';
                     $enclosure_url = $row->{$colName};
                     if (!empty($enclosure_url)) {
                         $remote_file = false;
                         // Element value should either be a full path, or relative to J! base
                         if (strstr($enclosure_url, 'http://') && !strstr($enclosure_url, COM_FABRIK_LIVESITE)) {
                             $enclosure_file = $enclosure_url;
                             $remote_file = true;
                         } else {
                             if (strstr($enclosure_url, COM_FABRIK_LIVESITE)) {
                                 $enclosure_file = str_replace(COM_FABRIK_LIVESITE, COM_FABRIK_BASE, $enclosure_url);
                             } else {
                                 if (preg_match('#^' . COM_FABRIK_BASE . "#", $enclosure_url)) {
                                     $enclosure_file = $enclosure_url;
                                     $enclosure_url = str_replace(COM_FABRIK_BASE, '', $enclosure_url);
                                 } else {
                                     $enclosure_file = COM_FABRIK_BASE . $enclosure_url;
                                     $enclosure_url = COM_FABRIK_LIVESITE . str_replace('\\', '/', $enclosure_url);
                                 }
                             }
                         }
                         if ($remote_file || file_exists($enclosure_file) && !is_dir($enclosure_file)) {
                             $enclosure_type = '';
                             if ($enclosure_type = FabrikWorker::getPodcastMimeType($enclosure_file)) {
                                 $enclosure_size = $this->get_filesize($enclosure_file, $remote_file);
                                 $enclosures[] = array('url' => $enclosure_url, 'length' => $enclosure_size, 'type' => $enclosure_type);
                                 // no need to insert the URL in the description, as feed readers should
                                 // automagically show 'media' when they see an 'enclosure', so just move on ..
                                 continue;
                             }
                         }
                     }
                 }
                 if ($title == '') {
                     //set a default title
                     $title = $row->{$dbcolname}['colName'];
                 }
                 $rsscontent = strip_tags($row->{$dbcolname}['colName']);
                 $found = false;
                 foreach ($rsstags as $rsstag => $namespace) {
                     if (strstr($rsscontent, $rsstag)) {
                         $found = true;
                         $rsstag = substr($rsstag, 1, strlen($rsstag) - 2);
                         if (!strstr($document->_namespace, $namespace)) {
                             $document->_itemTags[] = $rsstag;
                             $document->_namespace .= $namespace . " ";
                         }
                         break;
                     }
                 }
                 if ($found) {
                     $item->{$rsstag} = $rsscontent;
                 } else {
                     if ($dbcolname['label'] == '') {
                         $str2 .= $rsscontent . "<br />\n";
                     } else {
开发者ID:romuland,项目名称:khparts,代码行数:67,代码来源:view.fabrikfeed.php


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