Exemplo n.º 1
0
function do_conversation()
{
    global $db, $rows, $user, $offset, $page_size, $globals, $current_user;
    do_user_subheader(array($user->username => get_user_uri($user->username, 'commented'), _('conversación') . $globals['extra_comment_conversation'] => get_user_uri($user->username, 'conversation'), _('votados') => get_user_uri($user->username, 'shaken_comments'), _('favoritos') => get_user_uri($user->username, 'favorite_comments')), 1, 'comments_rss?answers_id=' . $user->id, _('conversación en rss2'));
    $rows = -1;
    //$db->get_var("SELECT count(distinct(conversation_from)) FROM conversations WHERE conversation_user_to=$user->id and conversation_type='comment'");
    $conversation = "SELECT distinct(conversation_from) FROM conversations WHERE conversation_user_to={$user->id} and conversation_type='comment' ORDER BY conversation_time desc LIMIT {$offset},{$page_size}";
    $comments = $db->get_results("SELECT comment_id, link_id, comment_type FROM comments INNER JOIN links ON (link_id = comment_link_id) INNER JOIN ({$conversation}) AS convs ON convs.conversation_from = comments.comment_id");
    if ($comments) {
        $last_read = print_comment_list($comments, $user);
    }
    if ($last_read > 0 && $current_user->user_id == $user->id) {
        Comment::update_read_conversation($timestamp_read);
    }
}
Exemplo n.º 2
0
function do_conversation () {
	global $db, $rows, $user, $offset, $page_size, $globals, $current_user;

	do_user_subheader(array(_('mis comentarios') => get_user_uri($user->username, 'commented'), _('conversación') => get_user_uri($user->username, 'conversation'), _('votados') => get_user_uri($user->username, 'shaken_comments'), _('favoritos') => get_user_uri($user->username, 'favorite_comments')), 1,
		'comments_rss2.php?answers_id='.$user->id, _('conversación en rss2'));
	$rows = $db->get_var("SELECT count(*) FROM conversations WHERE conversation_user_to=$user->id and conversation_type='comment'");
	$comments = $db->get_results("SELECT comment_id, link_id, comment_type FROM conversations, comments, links WHERE conversation_user_to=$user->id and conversation_type='comment' and comment_id=conversation_from and link_id=comment_link_id ORDER BY conversation_time desc LIMIT $offset,$page_size");
	if ($comments) {
		print_comment_list($comments, $user);
	}
}