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


PHP RSS::item方法代码示例

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


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

示例1: RSS

<?php

require 'includes/rss.class.php';
$rss = new RSS(TITLE, _u('fe'), DESCRIPTION);
$query = "SELECT *";
$query .= " FROM `%p_entries`";
$query .= " WHERE `status` = 'v'";
$query .= " ORDER BY `date` DESC, `id` DESC";
$query .= " LIMIT ";
$query .= P_LIMIT;
$sql = $DB->query($query);
// if(!$sql = mysql_query($query)) throw new Exception('mysql-no');
if (mysqli_num_rows($sql) != 0) {
    # Si hay entradas
    while ($row = mysqli_fetch_row($sql)) {
        $row[2] = htmlspecialchars($row[2]);
        $row[3] = format($row[3], 'e');
        $tmp = _u('e', $row[0], $row[1]);
        $rss->item($row[2], $tmp, $row[3], $row[4]);
    }
}
$rss->result();
开发者ID:sergioccrr,项目名称:GatuLog-PHP,代码行数:22,代码来源:feed-entries.php

示例2: htmlspecialchars

} 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();
}
开发者ID:sergioccrr,项目名称:GatuLog-PHP,代码行数:31,代码来源:feed-post.php

示例3: ALL

$query .= " INNER JOIN `%p_pages` p";
$query .= " ON c.`parenttype` = 'p' AND c.`parentid` = p.`id`";
$query .= " WHERE c.`status` <> 'h'";
$query .= " AND p.`comments` <> 'n'";
$query .= " AND p.`status` = 'v'";
$query .= ") UNION ALL (";
$query .= "SELECT c.`parentid`, c.`order`, c.`nick`, c.`content`, c.`date` AS sort, p.`slug`, p.`title`, c.`parenttype`";
$query .= " FROM `%p_comments` c";
$query .= " INNER JOIN `%p_entries` p";
$query .= " ON c.`parenttype` = 'e' AND c.`parentid` = p.`id`";
$query .= " WHERE c.`status` <> 'h'";
$query .= " AND p.`comments` <> 'n'";
$query .= " AND p.`status` = 'v'";
$query .= ")";
$query .= " ORDER BY `sort` DESC";
$query .= " LIMIT 10";
$sql = $DB->query($query);
//if (!$sql = mysql_query($query)) throw new Exception('mysql-no');
if (mysqli_num_rows($sql) != 0) {
    # Si hay comentarios
    while ($row = mysqli_fetch_row($sql)) {
        $row[2] = htmlspecialchars($row[2]);
        $row[6] = htmlspecialchars($row[6]);
        $tmp1 = sprintf('Comentario de %s en "%s"', $row[2], $row[6]);
        $row[3] = format($row[3], 'cf');
        $tmp2 = $row[7] == 'e' ? _u('e', $row[0], $row[5]) : _u('p', $row[5]);
        $tmp2 .= sprintf('#comment-%s', $row[1]);
        $rss->item($tmp1, $tmp2, $row[3], $row[4]);
    }
}
$rss->result();
开发者ID:sergioccrr,项目名称:GatuLog-PHP,代码行数:31,代码来源:feed-comments.php


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