Example #1
0
 public function __construct(array &$values)
 {
     $this->ID = $values['ID'] + 0;
     if (empty($values['CATEGORY_ID'])) {
         $this->categoryID = 0;
     } else {
         $this->categoryID = $values['CATEGORY_ID'] + 0;
     }
     $this->values = array();
     foreach ($values as $key => $value) {
         if ($key != 'ID' && $key != 'CATEGORY_ID' && !empty($value)) {
             $this->values[xml_utf8_encode($key)] = xml_utf8_encode($value);
         }
     }
 }
Example #2
0
            $title .= ' > ';
        }
        $title .= $path[$i]['TITLE'];
    }
    if (!ENABLE_REWRITE) {
        $url = 'index.php?c=' . $id;
    }
    $tpl->assign('title', xml_utf8_encode($title));
    $tpl->assign('description', xml_utf8_encode($path[count($path)]['DESCRIPTION']));
}
$tpl->assign('url', htmlspecialchars('http://' . $_SERVER['SERVER_NAME'] . DOC_ROOT . '/' . $url));
if ($limit > 0) {
    $rs = $db->SelectLimit($sql, $limit);
    $links = $rs->GetRows();
} else {
    $links = $db->GetAll($sql);
}
$n = count($links);
for ($i = 0; $i < $n; $i++) {
    $links[$i]['TITLE'] = xml_utf8_encode($links[$i]['TITLE']);
    $links[$i]['DESCRIPTION'] = xml_utf8_encode($links[$i]['DESCRIPTION']);
    $links[$i]['URL'] = xml_utf8_encode($links[$i]['URL']);
    $links[$i]['RECPR_URL'] = xml_utf8_encode($links[$i]['RECPR_URL']);
    $links[$i]['OWNER_NAME'] = xml_utf8_encode($links[$i]['OWNER_NAME']);
    $links[$i]['OWNER_EMAIL'] = xml_utf8_encode($links[$i]['OWNER_EMAIL']);
}
if ($n > 0) {
    $tpl->assign('links', $links);
}
@header('Content-type: application/xml');
echo $tpl->fetch('rss2.tpl');