Ejemplo n.º 1
0
<?php

// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es> and
// Beldar <beldar.cat at gmail dot com>
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
// The code below was made by Beldar <beldar at gmail dot com>
if (!defined('mnmpath')) {
    include_once '../config.php';
    header('Content-Type: text/html; charset=utf-8');
}
include_once mnminclude . 'commentmobile.php';
if (empty($_GET['id'])) {
    die;
}
$id = intval($_GET['id']);
$comment = new CommentMobile();
$comment->id = $id;
$comment->read();
if (!$comment->read) {
    die;
}
$link = Link::from_db($comment->link);
$comment->link_permalink = $link->get_relative_permalink();
$comment->print_text(0);
Ejemplo n.º 2
0
$globals['link_id'] = $link->id;
$globals['link_permalink'] = $globals['link']->get_permalink();
// to avoid search engines penalisation
if ($link->status == 'discard') {
    $globals['noindex'] = true;
}
do_header($link->title, 'post');
do_tabs("main", _('noticia'), true);
echo '<div id="newswrap">' . "\n";
$link->print_summary();
do_comment_pages($link->comments, $current_page);
echo '<div class="comments">';
$comments = $db->get_col("SELECT SQL_CACHE comment_id FROM comments WHERE comment_link_id={$link->id} ORDER BY {$order_field} {$limit}");
if ($comments) {
    echo '<ol class="comments-list">';
    $comment = new CommentMobile();
    foreach ($comments as $comment_id) {
        $comment->id = $comment_id;
        $comment->read();
        echo '<li>';
        $comment->print_summary($link, 700, true);
        echo '</li>';
        echo "\n";
    }
    echo "</ol>\n";
}
echo '</div>' . "\n";
if ($link->date > $globals['now'] - $globals['time_enabled_comments'] && $link->comments < $globals['max_comments'] && $current_user->authenticated && ($current_user->user_karma > $globals['min_karma_for_comments'] || $current_user->user_id == $link->author)) {
    print_comment_form();
}
do_comment_pages($link->comments, $current_page);