Example #1
0
    $title = _('Nótame') . ': ' . _('notas');
}
do_header($title);
$post = new Post();
if ($sql) {
    $posts = $db->get_col($sql);
}
if ($posts) {
    foreach ($posts as $post_id) {
        $post = Post::from_db($post_id);
        if (!$post) {
            continue;
        }
        $title = text_to_summary($post->clean_content(), 40);
        $title = $post->username . ': ' . htmlentities2unicodeentities($title);
        $content = htmlentities2unicodeentities(put_smileys($post->to_html($post->clean_content())));
        echo "\t<item>\n";
        echo "\t\t<title>{$title}</title>\n";
        echo "\t\t<link>http://" . get_server_name() . post_get_base_url($post->username) . '/' . $post->id . "</link>\n";
        echo "\t\t<pubDate>" . date("r", $post->date) . "</pubDate>\n";
        echo "\t\t<dc:creator>{$post->username}</dc:creator>\n";
        echo "\t\t<guid>http://" . get_server_name() . post_get_base_url($post->username) . '/' . $post->id . "</guid>\n";
        // Insert GEO
        if ($latlng = geo_latlng('user', $post->author)) {
            echo "\t\t<georss:point>{$latlng->lat} {$latlng->lng}</georss:point>\n";
        }
        echo "\t\t<description><![CDATA[{$content}";
        echo '</p><p>&#187;&nbsp;' . _('autor') . ': <strong>' . $post->username . '</strong></p>';
        echo "]]></description>\n";
        echo "\t</item>\n\n";
    }
Example #2
0
 	$permalink = $link->get_permalink();
 } else {
 	$permalink = $link->get_short_permalink();
 }
 */
 echo "\t<item>\n";
 // Meneame own namespace
 echo "\t\t<meneame:link_id>{$link->id}</meneame:link_id>\n";
 echo "\t\t<meneame:user>{$link->username}</meneame:user>\n";
 echo "\t\t<meneame:votes>" . intval($link->votes + $link->anonymous) . "</meneame:votes>\n";
 echo "\t\t<meneame:negatives>{$link->negatives}</meneame:negatives>\n";
 echo "\t\t<meneame:karma>" . intval($link->karma) . "</meneame:karma>\n";
 echo "\t\t<meneame:comments>{$link->comments}</meneame:comments>\n";
 echo "\t\t<meneame:url>" . htmlspecialchars($link->url) . "</meneame:url>\n";
 // Title must not carry htmlentities
 echo "\t\t<title>" . htmlentities2unicodeentities($link->title) . "</title>\n";
 echo "\t\t<link>{$permalink}</link>\n";
 echo "\t\t<comments>{$permalink}</comments>\n";
 if (!empty($link_date)) {
     echo "\t\t<pubDate>" . date("r", $link->{$link_date}) . "</pubDate>\n";
 } else {
     echo "      <pubDate>" . date("r", $link->date) . "</pubDate>\n";
 }
 echo "\t\t<dc:creator>{$link->username}</dc:creator>\n";
 echo "\t\t<category><![CDATA[{$category_name}]]></category>\n";
 // Add tags as categories
 if (!empty($link->tags)) {
     $tags_array = explode(",", $link->tags);
     foreach ($tags_array as $tag_item) {
         $tag_item = trim($tag_item);
         echo "\t\t<category><![CDATA[" . $tag_item . "]]></category>\n";
Example #3
0
        }
        if ($comment->user_level == 'disabled') {
            $content = '[' . _('Usuario deshabilitado') . ']';
        } else {
            $content = htmlentities2unicodeentities($comment->to_html($comment->content));
        }
        echo "\t<item>\n";
        echo "\t\t<meneame:comment_id>{$comment->id}</meneame:comment_id>\n";
        echo "\t\t<meneame:link_id>{$comment->link}</meneame:link_id>\n";
        echo "\t\t<meneame:order>{$comment->order}</meneame:order>\n";
        echo "\t\t<meneame:user>{$comment->username}</meneame:user>\n";
        echo "\t\t<meneame:votes>" . intval($comment->votes) . "</meneame:votes>\n";
        echo "\t\t<meneame:karma>" . intval($comment->karma) . "</meneame:karma>\n";
        echo "\t\t<meneame:url>" . $comment->link_permalink . "</meneame:url>\n";
        // Title must not carry htmlentities
        echo "\t\t<title>#{$comment->order} " . htmlentities2unicodeentities($link->title) . "</title>\n";
        echo "\t\t<link>{$comment->link_permalink}/c0{$comment->order}#c-{$comment->order}</link>\n";
        echo "\t\t<pubDate>" . date("r", $comment->date) . "</pubDate>\n";
        echo "\t\t<dc:creator>{$comment->username}</dc:creator>\n";
        echo "\t\t<guid>{$comment->link_permalink}/c0{$comment->order}#c-{$comment->order}</guid>\n";
        echo "\t\t<description><![CDATA[<p>{$content}";
        echo '</p><p>&#187;&nbsp;' . _('autor') . ': <strong>' . $comment->username . '</strong></p>';
        echo "]]></description>\n";
        echo "\t</item>\n\n";
    }
}
do_footer();
function do_header($title)
{
    global $if_modified, $last_modified, $dblang, $globals;
    if (!$last_modified > 0) {
Example #4
0
}
$last_modified = $db->get_var("SELECT UNIX_TIMESTAMP(comment_date) FROM comments ORDER BY comment_date DESC LIMIT 1");
$entries = $db->get_results("select rss.blog_id, rss.user_id, unix_timestamp(rss.date_parsed) as date, title, url, user_login, user_avatar, blogs.blog_url, blogs.blog_title from rss, users, blogs where {$from_time} rss.blog_id = blogs.blog_id and rss.user_id = users.user_id order by rss.date_parsed desc limit {$rows}");
$title = _('Menéame') . ': ' . _('blogs');
if (!$entries && $if_modified) {
    header('HTTP/1.1 304 Not Modified');
    exit;
}
do_header($title);
if ($entries) {
    foreach ($entries as $entry) {
        echo "\t<item>\n";
        echo "\t\t<meneame:user>{$entry->user_login}</meneame:user>\n";
        echo "\t\t<meneame:url>" . 'http://' . get_server_name() . $globals['base_url'] . 'rsss.php' . "</meneame:url>\n";
        // Title must not carry htmlentities
        echo "\t\t<title>" . htmlentities2unicodeentities(strip_tags($entry->title)) . "</title>\n";
        echo "\t\t<link>" . $entry->url . "</link>\n";
        echo "\t\t<pubDate>" . date("r", $entry->date) . "</pubDate>\n";
        echo "\t\t<dc:creator>{$entry->user_login}</dc:creator>\n";
        echo "\t\t<guid>" . $entry->url . "</guid>\n";
        echo "\t\t<description></description>\n";
        echo "\t</item>\n\n";
    }
}
do_footer();
function do_header($title)
{
    global $if_modified, $last_modified, $dblang, $globals;
    if (!$last_modified > 0) {
        if ($if_modified > 0) {
            $last_modified = $if_modified;
Example #5
0
     $tags_array = explode(",", $link->tags);
     foreach ($tags_array as $tag_item) {
         $tag_item = trim($tag_item);
         echo "\t\t<category><![CDATA[" . $tag_item . "]]></category>\n";
     }
 }
 echo "\t\t<guid>{$permalink}</guid>\n";
 // Insert GEO
 if ($latlng = geo_latlng('link', $link->id)) {
     echo "\t\t<georss:point>{$latlng->lat} {$latlng->lng}</georss:point>\n";
 }
 if (isset($_REQUEST['nohtml'])) {
     $content = htmlentities2unicodeentities(strip_tags($link->content));
     echo "\t\t<description>{$content}</description>\n";
 } else {
     $content = htmlentities2unicodeentities($link->to_html($link->content));
     echo '		<description><![CDATA[';
     // In case of meta, only sends votes and karma
     // developed for alianzo.com
     if ($thumb = $link->has_thumb()) {
         echo "<img src='{$thumb}' width='{$link->thumb_x}' height='{$link->thumb_y}' alt='' class='thumbnail' style='float:right;margin-left: 3px' align='right' hspace='3'/>";
     }
     echo '<p>' . $content . '</p>';
     echo '<p><strong>' . _('etiquetas') . '</strong>: ' . preg_replace('/,([^ ])/', ', $1', $link->tags) . '</p>';
     if ($link->status != 'published') {
         $rel = 'rel="nofollow"';
     } else {
         $rel = '';
     }
     echo '<p>&#187;&nbsp;<a href="http://' . get_server_name() . $globals['base_url'] . 'go?id=' . $link->id . '"';
     echo " {$rel}>" . _('noticia original') . "</a> (" . parse_url($link->url, 1) . ")</p>";
Example #6
0
    //
    $id = 0;
    $sql = "SELECT post_id FROM posts WHERE {$from_time} ORDER BY post_date DESC LIMIT {$rows}";
    $last_modified = $db->get_var("SELECT UNIX_TIMESTAMP(post_date) FROM posts ORDER BY post_date DESC LIMIT 1");
    $title = _('Nótame: notas');
}
do_header($title);
$post = new Post();
$posts = $db->get_col($sql);
if ($posts) {
    foreach ($posts as $post_id) {
        $post->id = $post_id;
        $post->read();
        $title = strip_tags(text_to_summary($post->content, 40));
        $title = $post->username . ': ' . htmlentities2unicodeentities($title);
        $content = htmlentities2unicodeentities(put_smileys(save_text_to_html($post->content)));
        echo "\t<item>\n";
        echo "\t\t<title>{$title}</title>\n";
        echo "\t\t<link>http://" . get_server_name() . post_get_base_url($post->username) . '/' . $post->id . "</link>\n";
        echo "\t\t<pubDate>" . date("r", $post->date) . "</pubDate>\n";
        echo "\t\t<dc:creator>{$post->username}</dc:creator>\n";
        echo "\t\t<guid>http://" . get_server_name() . post_get_base_url($post->username) . '/' . $post->id . "</guid>\n";
        // Insert GEO
        if ($latlng = geo_latlng('user', $post->author)) {
            echo "\t\t<georss:point>{$latlng->lat} {$latlng->lng}</georss:point>\n";
        }
        echo "\t\t<description><![CDATA[{$content}";
        echo '</p><p>&#187;&nbsp;' . _('autor') . ': <strong>' . $post->username . '</strong></p>';
        echo "]]></description>\n";
        echo "\t</item>\n\n";
    }