Exemple #1
0
function tohtml($v)
{
    if (is_array($v)) {
        if (count($v) == 1) {
            $k = array_keys($v);
            return $k[0];
        }
        $s = '<ul>';
        foreach (array_keys($v) as $k) {
            $s .= '<li>' . eschtml($k);
        }
        $s .= '</ul>';
        return $s;
    } else {
        return $v;
    }
}
Exemple #2
0
      if($showtitledesc && ($showempty || (!$showempty && $desc != ""))) echo "<p class=\"feed-desc\">$titledescprefix$desc</p>\n";
   }
   
      
      
   $items = $doc->get_elements_by_tagname("item");
   
   foreach($items as $i => $item)
   {
      if($i == $limit) break;

      $title = $item->get_elements_by_tagname("title");
      $title = (count($title) > 0 ? eschtml($title[0]->get_content()) : "(No title)");
   
      $link = $item->get_elements_by_tagname("link");
      $link = (count($link) > 0 ? eschtml($link[0]->get_content()) : "");
      if($link != "") $title = "<a href=\"$link\" target=\"_top\">$title</a>";
   
      $desc = $item->get_elements_by_tagname("description");
      $desc = (count($desc) > 0 ? $desc[0]->get_content() : "");
      if($striphtml) $desc = remtags($desc);
      
   
      if($showempty || (!$showempty && $title != "")) echo "<h4 class=\"feed-item-title\">$itemtitleprefix$title</h4>\n";
      if(($detail > 0) && ($showempty || (!$showempty && $desc != "")))
      {
         $words = explode(" ", $desc);
         if(count($words) > $detail)
         {
            $words = array_slice($words, 0, $detail);
             $desc = implode(" ", $words)."...";