Esempio n. 1
0
} else {
    # Si existe
    require 'includes/rss.class.php';
    $tmp = mysqli_fetch_row($sql);
    $pid = $tmp[0];
    $title = $tmp[1];
    $title = htmlspecialchars($title);
    $tmp1 = sprintf('Comentarios en "%s" de %s', $title, TITLE);
    $tmp2 = $_GET['type'] == 'e' ? _u('ce', $id, $slug) : _u('cp', $p);
    $rss = new RSS($tmp1, $tmp2, DESCRIPTION);
    $queryC = "SELECT `order`,`nick`,`content`,`date`";
    $queryC .= " FROM `%p_comments`";
    $queryC .= " WHERE `parenttype` = '%s'";
    $queryC .= " AND `parentid` = '%s'";
    $queryC .= " AND `status` <> 'h'";
    $queryC .= " ORDER BY `order` DESC";
    $sqlC = $DB->query($queryC, $_GET['type'], $pid);
    //if (!$sqlC = mysql_query($queryC)) throw new Exception('mysql-no');
    if (mysqli_num_rows($sqlC) != 0) {
        # Si hay comentarios
        while ($row = mysqli_fetch_row($sqlC)) {
            $row[1] = htmlspecialchars($row[1]);
            $row[2] = format($row[2], 'cf');
            $tmp1 = sprintf('Comentario de %s', $row[1]);
            $tmp2 = $_GET['type'] == 'e' ? _u('e', $id, $slug) : _u('p', $p);
            $tmp2 .= sprintf('#comment-%s', $row[0]);
            $rss->item($tmp1, $tmp2, $row[2], $row[3]);
        }
    }
    $rss->result();
}