includes/pageprocess.php
changeset 46 6ddaa9bd7977
parent 37 7267c2a67a93
child 47 d6361ccbd2bd
equal deleted inserted replaced
45:9cb99e37bfc4 46:6ddaa9bd7977
   523     $q = $db->sql_query('SELECT u.username, u.user_id AS authoritative_uid, u.real_name, u.email, u.reg_time, x.*, COUNT(c.comment_id) AS n_comments
   523     $q = $db->sql_query('SELECT u.username, u.user_id AS authoritative_uid, u.real_name, u.email, u.reg_time, x.*, COUNT(c.comment_id) AS n_comments
   524                            FROM '.table_prefix.'users u
   524                            FROM '.table_prefix.'users u
   525                            LEFT JOIN '.table_prefix.'users_extra AS x
   525                            LEFT JOIN '.table_prefix.'users_extra AS x
   526                              ON ( u.user_id = x.user_id OR x.user_id IS NULL ) 
   526                              ON ( u.user_id = x.user_id OR x.user_id IS NULL ) 
   527                            LEFT JOIN '.table_prefix.'comments AS c
   527                            LEFT JOIN '.table_prefix.'comments AS c
   528                              ON ( ( c.user_id=u.user_id AND c.approved=1 ) OR ( c.comment_id IS NULL AND c.approved IS NULL ) )
   528                              ON ( ( c.user_id=authoritative_uid AND c.approved=1 ) OR ( c.comment_id IS NULL AND c.approved IS NULL ) )
   529                            WHERE u.username=\'' . $db->escape($target_username) . '\'
   529                            WHERE u.username=\'' . $db->escape($target_username) . '\'
   530                            GROUP BY u.user_id;');
   530                            GROUP BY u.user_id;');
   531     if ( !$q )
   531     if ( !$q )
   532       $db->_die();
   532       $db->_die();
   533     
   533