Exemple #1
0
/*$Id: byuser.php 814 2012-10-16 13:28:15Z dmitriy $*/
require_once 'head_inc.php';
$cur_page = $page_byuser;
$how_many = 50;
$max_id = 1;
$last_id = 0;
$query = 'SELECT count(*) from confa_posts where author=' . $author_id . ' and status != 2';
$result = mysql_query($query);
if (!$result) {
    mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die('Query failed ');
}
$row = mysql_fetch_row($result);
$count = $row[0];
$last_id = get_page_last_index('confa_posts where author=' . $author_id, $how_many, $page);
$query = 'SELECT u.username, u.moder, p.auth, p.closed as post_closed, CONVERT_TZ(p.created, \'' . $server_tz . '\', \'' . $prop_tz . ':00\') as created, p.subject, p.status, p.id as msg_id, p.chars  from confa_posts p, confa_users u where p.author=' . $author_id . ' and p.author=u.id and  p.status != 2 and p.id <= ' . $last_id . ' order by msg_id desc limit 50';
$result = mysql_query($query);
if (!$result) {
    mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die('Query failed ');
}
$num = 1;
$out = '';
if (mysql_num_rows($result) == 0) {
    $max_id = $last_id;
}
while ($row = mysql_fetch_assoc($result)) {
    $msg_id = $row['msg_id'];
    $u_moder = $row['moder'];
    $subj = $row['subject'];
Exemple #2
0
 }
 $where = '';
 $where_author = '';
 if (!is_null($author_id)) {
     $where_author = 'p.author=' . $author_id . ' and ';
     $where = ' and author=' . $author_id;
 }
 $query = 'SELECT count(*) from confa_posts where ' . $subquery . $where;
 $result = mysql_query($query);
 if (!$result) {
     mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
     die('Query failed ');
 }
 $row = mysql_fetch_row($result);
 $count = $row[0];
 $last_id = get_page_last_index(' confa_posts where ' . $subquery . $where, $how_many, $page);
 if (is_null($last_id) || strlen($last_id) == 0) {
     $last_id = 0;
 }
 $query = 'SELECT u.username, u.moder, p.auth, p.closed as post_closed, CONVERT_TZ(p.created, \'' . $server_tz . '\', \'EST\') as created, p.subject, p.status, p.id as msg_id, p.chars  from confa_posts p, confa_users u where ' . $where_author . ' p.author=u.id and  p.' . $subquery . ' and p.id <= ' . $last_id . ' order by msg_id desc limit 50';
 $result = mysql_query($query);
 if (!$result) {
     mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
     die('Query failed ');
 }
 $num = 1;
 $out = '';
 if (mysql_num_rows($result) == 0) {
     $max_id = $last_id;
 }
 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
Exemple #3
0
    die;
}
$cur_page = $page_pmail;
$how_many = 20;
$max_id = 1;
$last_id = 0;
$search_condition = 'receiver=' . $user_id . ' and !(p.status &' . $pm_deleted_by_receiver . ')';
$query = 'SELECT count(*) from confa_pm p where ' . $search_condition;
$result = mysql_query($query);
if (!$result) {
    mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die('Query failed ');
}
$row = mysql_fetch_row($result);
$count = $row[0];
$last_id = get_page_last_index('confa_pm p where ' . $search_condition, $how_many, $page);
if (is_null($last_id)) {
    $last_id = 1;
}
$query = 'SELECT s.username as sender_name, p.id as id, p.sender, p.receiver, p.subject, p.body, CONVERT_TZ(p.created, \'' . $server_tz . '\', \'' . $prop_tz . ':00\') as created,  p.status,  p.chars  from confa_pm p, confa_users s where p.sender=s.id and ' . $search_condition . ' and p.id <= ' . $last_id . ' order by id desc limit 20';
$result = mysql_query($query);
if (!$result) {
    mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die('Query failed ');
}
$num = 1;
$out = '';
if (mysql_num_rows($result) == 0) {
    $max_id = $last_id;
}
$auth_text = '';
Exemple #4
0
}
$how_many = 50;
$max_id = 1;
$last_id = 0;
$query = 'SELECT count(*) from confa_bookmarks where user='******'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die(' Query failed ');
}
$row = mysql_fetch_row($result);
$count = $row[0];
if (is_null($page)) {
    $page = 1;
}
$last_id = get_page_last_index('confa_bookmarks where user='******'SELECT u.username, u.moder, p.auth, p.closed as post_closed, CONVERT_TZ(p.created, \'' . $server_tz . '\', \'EST\') as created, p.subject, p.content_flags, p.views, p.likes, p.dislikes, p.status, p.id as msg_id, p.chars, b.user, b.post  from confa_posts p, confa_users u, confa_bookmarks b where b.user='******' and b.post=p.id and p.author=u.id and  p.status != 2 and b.id <= ' . $last_id . ' order by msg_id desc limit 50';
$result = mysql_query($query);
if (!$result) {
    mysql_log(__FILE__, 'query failed ' . mysql_error() . ' QUERY: ' . $query);
    die('Query failed ');
}
$num = 1;
$out = '';
if (mysql_num_rows($result) == 0) {
    $max_id = $last_id;
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {