Exemplo n.º 1
0
 /**
  * get fabrikar.com rss feed
  * @return string
  */
 function getRSSFeed()
 {
     //  get RSS parsed object
     $options = array();
     $options['rssUrl'] = 'http://feeds.feedburner.com/fabrik';
     $options['cache_time'] = 86400;
     $rssDoc =& JFactory::getXMLparser('RSS', $options);
     if ($rssDoc == false) {
         $output = JText::_('Error: Feed not retrieved');
     } else {
         // channel header and link
         $title = $rssDoc->get_title();
         $link = $rssDoc->get_link();
         $output = '<table class="adminlist">';
         $output .= '<tr><th colspan="3"><a href="' . $link . '" target="_blank">' . JText::_($title) . '</th></tr>';
         $items = array_slice($rssDoc->get_items(), 0, 3);
         $numItems = count($items);
         if ($numItems == 0) {
             $output .= '<tr><th>' . JText::_('No news items found') . '</th></tr>';
         } else {
             $k = 0;
             for ($j = 0; $j < $numItems; $j++) {
                 $item = $items[$j];
                 $output .= '<tr><td class="row' . $k . '">';
                 $output .= '<a href="' . $item->get_link() . '" target="_blank">' . $item->get_title() . '</a>';
                 $output .= '<br />' . $item->get_date('Y-m-d');
                 if ($item->get_description()) {
                     $description = FabrikString::truncate($item->get_description(), array('wordcount' => 50));
                     $output .= '<br />' . $description;
                 }
                 $output .= '</td></tr>';
             }
         }
         $k = 1 - $k;
         $output .= '</table>';
     }
     return $output;
 }
Exemplo n.º 2
0
 /**
  * Get fabrikar.com rss feed
  *
  * @return string
  */
 public function getRSSFeed()
 {
     //  Get RSS parsed object - Turn off error reporting as SimplePie creates strict error notices.
     $origError = error_reporting();
     error_reporting(0);
     $version = new JVersion();
     if ($version->RELEASE == 2.5) {
         //  get RSS parsed object
         $options = array();
         $options['rssUrl'] = 'http://feeds.feedburner.com/fabrik';
         $options['cache_time'] = 86400;
         $rssDoc = JFactory::getXMLparser('RSS', $options);
     } else {
         $rssDoc = JSimplepieFactory::getFeedParser('http://feeds.feedburner.com/fabrik', 86400);
     }
     if ($rssDoc == false) {
         $output = FText::_('Error: Feed not retrieved');
     } else {
         // Channel header and link
         $title = $rssDoc->get_title();
         $link = $rssDoc->get_link();
         $output = '<table class="adminlist">';
         $output .= '<tr><th colspan="3"><a href="' . $link . '" target="_blank">' . FText::_($title) . '</th></tr>';
         $items = array_slice($rssDoc->get_items(), 0, 3);
         $numItems = count($items);
         if ($numItems == 0) {
             $output .= '<tr><th>' . FText::_('No news items found') . '</th></tr>';
         } else {
             $k = 0;
             for ($j = 0; $j < $numItems; $j++) {
                 $item = $items[$j];
                 $output .= '<tr><td class="row' . $k . '">';
                 $output .= '<a href="' . $item->get_link() . '" target="_blank">' . $item->get_title() . '</a>';
                 $output .= '<br />' . $item->get_date('Y-m-d');
                 if ($item->get_description()) {
                     $description = FabrikString::truncate($item->get_description(), array('wordcount' => 50));
                     $output .= '<br />' . $description;
                 }
                 $output .= '</td></tr>';
                 $k = 1 - $k;
             }
         }
         $output .= '</table>';
     }
     error_reporting($origError);
     return $output;
 }
Exemplo n.º 3
0
</td>
					<td><?php 
    echo $row->title;
    ?>
</td>
					<td><?php 
    echo $row->user;
    ?>
</td>
					<td  style="text-align:center">
					<a href="<?php 
    echo $row->view;
    ?>
">
					<a class="fabrikTip" opts="{position:'right'}" title="<?php 
    echo FabrikString::truncate($row->content, array('tip' => false, 'wordcount' => 200));
    ?>
" >
						<?php 
    echo FabrikHelperHTML::icon('icon-search');
    ?>
					</a></td>
					<td>
						<div class="btn-group">
							<a class="dropdown-toggle btn btn-mini" data-toggle="dropdown" href="#">
								<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li>
									<a class="approve" href="<?php 
    echo $url . 'approve';