Esempio n. 1
0
    private function getItems()
    {
        $itemsTable = PREFIX . "news";
        $query = "SELECT * FROM " . $itemsTable . "\n\tWHERE published<NOW()\n\tORDER BY published DESC, id DESC\n\tLIMIT 30;";
        $result = mysql_db_query(db_name, $query, LINK);
        $items = '';
        while ($row = mysql_fetch_array($result)) {
            $items .= '<item>
    <title>' . $row["headline"] . '</title>
    <link>' . news_get_link_url($row["id"]) . '</link>
    <guid>' . news_get_link_url($row["id"]) . '</guid>
	<pubDate>' . date(DATE_RSS, strtotime($row['published'])) . '</pubDate>
    <description><![CDATA[' . $row["text"] . ']]></description>
   </item>';
        }
        $items .= '</channel>
    </rss>';
        return $items;
    }
Esempio n. 2
0
echo sprintf(_("%s news"), SITE_NAME);
?>
</h2>
	<div class="col-md-4 latest-post">
		<?php 
news_show(1, "", 2);
?>
	</div>
	<div class="col-md-8 latest-stream">
		<?php 
news_show_latest_short(2, 80, 0, 3, 1, "", 2);
?>
	</div>
	<div class="col-lg-12 center">
		<p><a class="btn btn-default page-link form-control" href="<?php 
echo news_get_link_url();
?>
"><?php 
echo _("All news");
?>
</a></p>
	</div>
</div>
<div class="row">
	<div class="col-md-12">

		<div class="row">
			<div class="col-md-12">
				<h2><?php 
echo _("This is block two");
?>
Esempio n. 3
0
function comment_get_link($id, $link_id = NULL)
{
    if ($link_id === NULL) {
        $link_id = $id;
    }
    $sql = "SELECT id, comment_type, comment_on FROM " . PREFIX . "comment WHERE id=" . sql_safe($id) . ";";
    // echo "<br />DEBUG2055: $sql";
    if ($cc = mysql_query($sql)) {
        if ($c = mysql_fetch_array($cc)) {
            // echo "<br />DEBUG2056: ".$c['comment_type'];
            if (!strcmp($c['comment_type'], "comment")) {
                return comment_get_link($c['comment_on'], $id);
            } else {
                if (!strcmp($c['comment_type'], "feedback")) {
                    return SITE_URL . "?comment&amp;p=feedback&amp;id=" . $c['comment_on'] . "#anchor_comment_" . $link_id;
                } else {
                    if (!strcmp($c['comment_type'], "user")) {
                        // return SITE_URL."?comment&amp;p=user&amp;user="******"#anchor_comment_".$link_id;
                        return user_get_link_url($c['comment_on']) . "&amp;comment#anchor_comment_" . $link_id;
                    } else {
                        if (!strcmp($c['comment_type'], "news")) {
                            return news_get_link_url($c['comment_on']) . "#anchor_comment_" . $link_id;
                        } else {
                            if (!strcmp($c['comment_type'], "stable")) {
                                return stable_get_link_url($c['comment_on']) . "&amp;comment#anchor_comment_" . $link_id;
                            } else {
                                return SITE_URL . "?p=" . $c['comment_type'] . "&amp;" . $c['comment_type'] . "=" . $c['comment_on'] . "&amp;comment#anchor_comment_" . $link_id;
                            }
                        }
                    }
                }
            }
        }
    }
    return NULL;
}