Changeset 321

Show
Ignore:
Timestamp:
10/03/10 12:36:47 (2 years ago)
Author:
Nafania
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • comment.php

    r318 r321  
    1818                $sql_table = REQUESTS_TABLE; 
    1919                $filename = 'requests'; 
    20                 $field = 'request AS name, id, cat AS category, comments AS comments_count'; 
     20                $field = 'request AS name, id, cat AS category, comments AS comments_count, userid AS owner'; 
    2121                $comment_field = 'comments'; 
    2222                $where_id = 'id'; 
     
    2626                $sql_table = OFFERS_TABLE; 
    2727                $filename = 'offers'; 
    28                 $field = 'name, id, category, comments AS comments_count'; 
     28                $field = 'name, id, category, comments AS comments_count, userid AS owner'; 
    2929                $comment_field = 'comments'; 
    3030                $where_id = 'id'; 
     
    3434                $sql_table = TORRENTS_TABLE; 
    3535                $filename = 'details'; 
    36                 $field = 'name, disable_comments, fid AS id, category, comments AS comments_count'; 
     36                $field = 'name, disable_comments, fid AS id, category, comments AS comments_count, owner'; 
    3737                $comment_field = 'comments'; 
    3838                $where_id = 'fid'; 
     
    4242                $sql_table = NEWS_TABLE; 
    4343                $filename = 'news'; 
    44                 $field = 'title AS name, news_disable_comments AS disable_comments, NULL AS category, id, news_comments AS comments_count'; 
     44                $field = 'title AS name, news_disable_comments AS disable_comments, NULL AS category, id, news_comments AS comments_count, userid AS owner'; 
    4545                $comment_field = 'news_comments'; 
    4646                $where_id = 'id'; 
     
    202202                )); 
    203203 
    204                 preview_commentable($type, $id); 
     204                preview_commentable($type, $id, $arr['owner']); 
    205205 
    206206                stdhead(sprintf($lang['add_comment_to_header'], $name)); 
     
    379379                switch ( $type ) { 
    380380                        case TYPE_TORRENT: 
    381                                 $select = 't.name, t.fid AS id, t.disable_comments'; 
     381                                $select = 't.name, t.fid AS id, t.disable_comments, t.owner'; 
    382382                                $from = TORRENTS_TABLE . ' t'; 
    383383                                $where = 'c.comment_for_id = t.fid'; 
     
    385385 
    386386                        case TYPE_REQUEST: 
    387                                 $select = 'r.request AS name, r.id'; 
     387                                $select = 'r.request AS name, r.id, r.userid AS owner'; 
    388388                                $from = REQUESTS_TABLE . ' r'; 
    389389                                $where = 'c.comment_for_id = r.id'; 
     
    391391 
    392392                        case TYPE_OFFER: 
    393                                 $select = 'o.name, o.id'; 
     393                                $select = 'o.name, o.id, o.userid AS owner'; 
    394394                                $from = OFFERS_TABLE . ' o'; 
    395395                                $where = 'c.comment_for_id = o.id'; 
     
    397397 
    398398                        case TYPE_NEWS: 
    399                                 $select = 'n.title AS name, n.id, n.news_disable_comments AS disable_comments'; 
     399                                $select = 'n.title AS name, n.id, n.news_disable_comments AS disable_comments, n.userid AS owner'; 
    400400                                $from = NEWS_TABLE . ' n'; 
    401401                                $where = 'c.comment_for_id = n.id'; 
     
    404404                } 
    405405 
    406                 $sql = 'SELECT c.*, u.name AS username, u.uid, ' . $select . ' 
     406                $sql = 'SELECT c.*, u.name AS username, u.privacy, u.uid, ' . $select . ' 
    407407                                FROM ' . COMMENTS_TABLE . ' c, ' . USERS_TABLE . ' u, ' . $from . ' 
    408408                                WHERE c.comment_id = ' . $id . ' AND ' . $where . ' AND comment_type = ' . $type . ' AND c.comment_user = u.uid'; 
     
    417417             $name = split_string($arr['name'], 55); 
    418418 
    419              $username = ( $arr['uid'] == ANONYMOUS ? $lang['unknown'] : $arr['username'] ); 
     419             $username = ( $arr['uid'] == ANONYMOUS || ( $arr['privacy'] == PRIVACY_LEVEL_HIGH && $arr['owner'] == $arr['uid'] ) ? $lang['unknown'] : $arr['username'] ); 
    420420 
    421421             $quoted_text = '[quote="' . $username . '"]' . $arr['comment_text'] . '[/quote]'; 
     
    432432                )); 
    433433 
    434                 preview_commentable($type, $arr['id']); 
     434                preview_commentable($type, $arr['id'], $arr['owner']); 
    435435 
    436436                stdhead(sprintf($lang['add_comment_to_header'], $name)); 
  • include/bbcode/Xbb/Tags/Google.php

    r269 r321  
    2626    public $behaviour = 'a'; 
    2727    function get_html($tree = null) { 
    28         $attr = rawurlencode($this -> attrib['google']); 
    29         $attr = ' href="http://www.google.com/search?q='.$attr.'"'; 
    30         $title = isset($this -> attrib['title']) ? $this -> attrib['title'] : ''; 
    31         if ($title) { $attr .= ' title="'.$title.'"'; } 
    32         $name = isset($this -> attrib['name']) ? $this -> attrib['name'] : ''; 
    33         if ($name) { $attr .= ' name="'.$name.'"'; } 
    34         $target = isset($this -> attrib['target']) ? $this -> attrib['target'] : ''; 
    35         if ($target) { $attr .= ' target="'.$target.'"'; } 
     28        $src = ''; 
     29        foreach ($this -> tree as $text) { 
     30                if ('text' == $text['type']) { $src .= $text['str']; } 
     31        } 
     32 
     33        $attr = ' href="http://www.google.com/search?q='.$src.'"'; 
    3634        return '<a class="bb_google" '.$attr.'>'.parent::get_html($this -> tree).'</a>'; 
    3735    } 
  • include/functions.php

    r318 r321  
    364364        if ( $data['uid'] == ANONYMOUS ) { 
    365365                $username = '<i>' . $lang['unknown'] . '</i>'; 
     366 
     367                $ret_string = $username; 
    366368        } 
    367369        else { 
    368370                $seo->set_user_url($username, $data['uid']); 
    369         } 
    370  
    371         $pics = ( !empty($data['donor']) ? '<img src="' . $images['donor'] . '" alt="' . $lang['donor'] . '" />' : '' ); 
    372         $pics .= ( !empty($data['parked']) ? '<img src="' . $images['parked'] . '" alt="' . $lang['parked'] . '" />' : '' ); 
    373  
    374         if ( !empty($data['warneduntil']) ) { 
    375                 $pics .= '<img src="' . $images['warned'] . '" alt="' . $lang['warned'] . '" />'; 
    376         } 
    377         elseif ( !empty($data['enabled']) && !$data['enabled'] ) { 
    378                 $pics .= '<img src="' . $images['disabled'] . '" alt="' . $lang['disabled'] . '" />'; 
    379         } 
    380  
    381         if ( !empty($data['name_append']) ) { 
    382                 $name_append = unserialize($data['name_append']); 
    383                 foreach ( $name_append AS $type => $param ) { 
    384                         if ( $type == 'img' ) { 
    385                                 foreach ( $param AS $img_alt => $img_path ) { 
    386                                         $pics .= '<img src="' . $img_path . '" alt="' . $img_alt . '" title="' . $img_alt . '" />'; 
     371 
     372                $pics = ( !empty($data['donor']) ? '<img src="' . $images['donor'] . '" alt="' . $lang['donor'] . '" />' : '' ); 
     373               $pics .= ( !empty($data['parked']) ? '<img src="' . $images['parked'] . '" alt="' . $lang['parked'] . '" />' : '' ); 
     374 
     375                if ( !empty($data['warneduntil']) ) { 
     376                       $pics .= '<img src="' . $images['warned'] . '" alt="' . $lang['warned'] . '" />'; 
     377                } 
     378               elseif ( !empty($data['enabled']) && !$data['enabled'] ) { 
     379                       $pics .= '<img src="' . $images['disabled'] . '" alt="' . $lang['disabled'] . '" />'; 
     380                } 
     381 
     382                if ( !empty($data['name_append']) ) { 
     383                       $name_append = unserialize($data['name_append']); 
     384                       foreach ( $name_append AS $type => $param ) { 
     385                               if ( $type == 'img' ) { 
     386                                       foreach ( $param AS $img_alt => $img_path ) { 
     387                                               $pics .= '<img src="' . $img_path . '" alt="' . $img_alt . '" title="' . $img_alt . '" />'; 
     388                                        } 
    387389                                } 
    388390                        } 
    389391                } 
    390         } 
    391  
    392         switch ( $data['class'] ) { 
    393                 case UC_SYSOP: 
    394                      $style = 'color:#FF0000;'
    395                      $title = $lang['sysop']
    396                 break; 
    397           case UC_ADMINISTRATOR: 
    398                      $style = 'color:#FFA500;'
    399                      $title = $lang['administrator']
    400           break; 
    401           case UC_MODERATOR: 
    402                      $style = 'color:#008000;'
    403                      $title = $lang['moderator']
    404           break; 
    405           case UC_UPLOADER: 
    406                      $style = 'color:#0000FF;'
    407                      $title = $lang['uploader']
    408           break; 
    409           case UC_VIP: 
    410                      $style = 'color:#FF00FF;'
    411                      $title = $lang['vip']
    412           break; 
    413           case UC_POWER_USER: 
    414                      $style = 'font-weight:bold;'
    415                      $title = $lang['power_user']
    416           break; 
    417           case UC_USER: 
    418                      $style = ''
    419                      $title = $lang['user']
    420           break; 
    421           case UC_PEASANT: 
    422                      $style = 'color:#808080;'
    423                      $title = $lang['peasant']
    424           break; 
    425         } 
    426  
    427         $rep_level = ( isset($data['user_reputation_level']) ? $data['user_reputation_level'] : false ); 
    428  
    429         if ( $add_href && $data['uid'] <> ANONYMOUS ) { 
    430                 $base_link_options = array( 
    431                         'style' => $style, 
    432                         'title' => $title
    433                         'href' => append_sid($root_path . 'userdetails.php?id=' . $data['uid'])
    434                         'onclick' => '', 
    435                 ); 
    436  
    437                 $link_params = ''; 
    438  
    439                 foreach ( $base_link_options AS $opt => $val ) { 
    440                         $param = ''; 
    441                         if ( !empty($link_options[$opt]) ) { 
    442                                 $param = $opt . '="' . $link_options[$opt] . '"'; 
    443                         } 
    444                         elseif ( $val ) { 
    445                                 $param = $opt . '="' . $val . '"'; 
    446                         } 
    447  
    448                         $link_params .= ( $link_params ? ' ' : '' ) . $param; 
    449                 } 
    450  
    451                 $ret_string = '<a ' . $link_params . '>' . $username . '</a>'; 
    452         } 
    453         else { 
    454                 $ret_string = '<span' . ( $style ? ' style="' . $style . '"' : '' )  . ' title="' . $title . '">' . $username . '</span>'; 
    455         } 
    456  
    457         $ret_string .= '&nbsp;' . $pics; 
    458  
    459         if ( $rep_level !== false && $data['uid'] <> ANONYMOUS ) { 
    460                 if ( !isset($ranks) ) { 
    461                         $ranks = $cache->obtain_ranks(); 
    462                 } 
    463                 $user_rank = ( isset($ranks[$data['user_rank_id']]['rank_name']) ? $ranks[$data['user_rank_id']]['rank_name'] : '' ); 
    464  
    465                 $ret_string .= '&nbsp;<span class="' . ( $rep_level < 0 ? 'badUserResp' : 'goodUserResp' ) . '" title="' . $user_rank . ', ' . $lang['reputation'] . ': ' . $data['user_reputation'] . '"><a href="javascript:;" onclick="window.open(\'' . append_sid($root_path . 'userdetails.php?id=' . $data['uid'] . '&amp;action=card') . '\', \'\', \'width=420,height=230,resizable=yes,scrollbars=yes,status=yes\')">' . $rep_level . '</a></span>'; 
     392 
     393                switch ( $data['class'] ) { 
     394                       case UC_SYSOP: 
     395                               $style = 'color:#FF0000;'; 
     396                               $title = $lang['sysop']
     397                               break
     398                       case UC_ADMINISTRATOR: 
     399                                $style = 'color:#FFA500;'; 
     400                               $title = $lang['administrator']
     401                               break
     402                        case UC_MODERATOR: 
     403                                $style = 'color:#008000;'; 
     404                               $title = $lang['moderator']
     405                               break
     406                        case UC_UPLOADER: 
     407                                $style = 'color:#0000FF;'; 
     408                               $title = $lang['uploader']
     409                               break
     410                        case UC_VIP: 
     411                                $style = 'color:#FF00FF;'; 
     412                               $title = $lang['vip']
     413                               break
     414                        case UC_POWER_USER: 
     415                                $style = 'font-weight:bold;'; 
     416                               $title = $lang['power_user']
     417                               break
     418                        case UC_USER: 
     419                                $style = ''; 
     420                               $title = $lang['user']
     421                               break
     422                        case UC_PEASANT: 
     423                                $style = 'color:#808080;'; 
     424                               $title = $lang['peasant']
     425                               break
     426                } 
     427 
     428                $rep_level = ( isset($data['user_reputation_level']) ? $data['user_reputation_level'] : false ); 
     429 
     430                if ( $add_href ) { 
     431                       $base_link_options = array( 
     432                               'style' => $style, 
     433                               'title' => $title, 
     434                               'href' => append_sid($root_path . 'userdetails.php?id=' . $data['uid'])
     435                               'onclick' => ''
     436                        ); 
     437 
     438                        $link_params = ''; 
     439 
     440                        foreach ( $base_link_options AS $opt => $val ) { 
     441                               $param = ''; 
     442                               if ( !empty($link_options[$opt]) ) { 
     443                                       $param = $opt . '="' . $link_options[$opt] . '"'; 
     444                                } 
     445                               elseif ( $val ) { 
     446                                       $param = $opt . '="' . $val . '"'; 
     447                                } 
     448 
     449                                $link_params .= ( $link_params ? ' ' : '' ) . $param; 
     450                        } 
     451 
     452                        $ret_string = '<a ' . $link_params . '>' . $username . '</a>'; 
     453                } 
     454               else { 
     455                       $ret_string = '<span' . ( $style ? ' style="' . $style . '"' : '' )  . ' title="' . $title . '">' . $username . '</span>'; 
     456                } 
     457 
     458                $ret_string .= '&nbsp;' . $pics; 
     459 
     460                if ( $rep_level !== false && $data['uid'] <> ANONYMOUS ) { 
     461                       if ( !isset($ranks) ) { 
     462                               $ranks = $cache->obtain_ranks(); 
     463                        } 
     464                       $user_rank = ( isset($ranks[$data['user_rank_id']]['rank_name']) ? $ranks[$data['user_rank_id']]['rank_name'] : '' ); 
     465 
     466                        $ret_string .= '&nbsp;<span class="' . ( $rep_level < 0 ? 'badUserResp' : 'goodUserResp' ) . '" title="' . $user_rank . ', ' . $lang['reputation'] . ': ' . $data['user_reputation'] . '"><a href="javascript:;" onclick="window.open(\'' . append_sid($root_path . 'userdetails.php?id=' . $data['uid'] . '&amp;action=card') . '\', \'\', \'width=420,height=230,resizable=yes,scrollbars=yes,status=yes\')">' . $rep_level . '</a></span>'; 
     467                } 
    466468        } 
    467469 
  • include/functions_post.php

    r317 r321  
    11<?php 
    2 function commenttable( $type = TYPE_TORRENT, $id, $offset, $limit ) { 
     2function commenttable( $type = TYPE_TORRENT, $id, $owner, $offset, $limit ) { 
    33        global $db, $userdata, $lang, $template, $config, $images, $cache, $root_path; 
    44        global $bb_code; 
     
    3333        $simpaty_ary = array(); 
    3434 
    35      while ( $row = $db->sql_fetchrow($result) ) { 
    36  
    37                 if ( $row['comment_user'] <> ANONYMOUS ) { 
     35        while ( $row = $db->sql_fetchrow($result) ) { 
     36 
     37                if ( $row['comment_user'] == ANONYMOUS ) { 
     38                        $show_comment_user == false; 
     39                } 
     40                else { 
     41                        if ( ( $owner == $row['comment_user'] && $row['privacy'] == PRIVACY_LEVEL_HIGH ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['comment_user'] ) ) { 
     42                                $show_comment_user = false; 
     43                        } 
     44                        else { 
     45                                $show_comment_user = true; 
     46                        } 
     47                } 
     48 
     49                if ( $show_comment_user ) { 
    3850                        if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['comment_user'] ) ) { 
    3951                                $ratio = '---'; 
    40                              $uploaded = '---'; 
     52                               $uploaded = '---'; 
    4153                                $downloaded = '---'; 
    4254                                $ratio_color = ''; 
    4355                        } 
    4456                        else { 
    45                        $ratio = get_ratio($row['uploaded'], $row['downloaded']); 
    46                     $ratio_color = get_ratio_color($ratio); 
    47                     $uploaded = mksize($row['uploaded']); 
    48                     $downloaded = mksize($row['downloaded']); 
    49                
    50  
    51                $username = $row['name']; 
    52  
    53                if ( $row['comment_user'] != $userdata['uid'] && $userdata['session_logged_in'] ) { 
    54                        $u_respect = append_sid('simpaty.php?action=add&amp;simpaty=1&amp;targetid=' . $row['comment_user'] . '&amp;type=1&amp;simpid=' . $row['comment_id']); 
    55                        $u_antirespect = append_sid('simpaty.php?action=add&amp;simpaty=0&amp;targetid=' . $row['comment_user'] . '&amp;type=1&amp;simpid=' . $row['comment_id']); 
    56                
    57                else { 
    58                        $u_respect = ''; 
    59                        $u_antirespect = ''; 
    60                
    61  
    62                if ( $row['gender'] ) { 
     57                               $ratio = get_ratio($row['uploaded'], $row['downloaded']); 
     58                               $ratio_color = get_ratio_color($ratio); 
     59                               $uploaded = mksize($row['uploaded']); 
     60                               $downloaded = mksize($row['downloaded']); 
     61                       
     62 
     63                       $username = $row['name']; 
     64 
     65                       if ( $row['comment_user'] != $userdata['uid'] && $userdata['session_logged_in'] ) { 
     66                               $u_respect = append_sid('simpaty.php?action=add&amp;simpaty=1&amp;targetid=' . $row['comment_user'] . '&amp;type=1&amp;simpid=' . $row['comment_id']); 
     67                               $u_antirespect = append_sid('simpaty.php?action=add&amp;simpaty=0&amp;targetid=' . $row['comment_user'] . '&amp;type=1&amp;simpid=' . $row['comment_id']); 
     68                       
     69                       else { 
     70                               $u_respect = ''; 
     71                               $u_antirespect = ''; 
     72                       
     73 
     74                       if ( $row['gender'] ) { 
    6375                                $gender_img = $images['female']; 
    6476                                $gender_text = $lang['gender_female']; 
     
    7587                                $u_report = ''; 
    7688                        } 
    77                $avatar = get_user_avatar($row['uid'], $row['avatar']); 
    78  
    79                         //$gender = ( !$row['gender'] ?'<img src="' . $images['male'] . '" alt="' . $lang['gender_male'] . '" />':'<img src="' . $images['female'] . '" alt="' . $lang['gender_female'] . '" />'); 
    80                $age = get_age($row['birthday']); 
    81                //$report = ( $userdata['session_logged_in'] && $row['comment_user'] != $userdata['uid'] ? '<a href="' . append_sid('reports.php?action=comment&amp;id=' . $row['comment_id']) . '" title="' . sprintf($lang['report_comment'], $row['comment_id']) . '">' . $lang['report'] . '</a>' : '' ); 
    82                $user_online = ( $row['user_session_time'] > ( time() - $config['online_time'] ) ? sprintf($lang['user_online'], $username) : sprintf($lang['user_offline'], $username) ); 
     89 
     90                        $avatar = get_user_avatar($row['uid'], $row['avatar']); 
     91 
     92                       $age = get_age($row['birthday']); 
     93 
     94                       $user_online = ( $row['user_session_time'] > ( time() - $config['online_time'] ) ? sprintf($lang['user_online'], $username) : sprintf($lang['user_offline'], $username) ); 
    8395 
    8496                        if ( $row['user_sig'] && $config['allow_sig'] ) { 
    8597                       //now we delete imgs if config allow_sig == 2 
    86                     $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url?(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $row['user_sig']) : $row['user_sig']; 
     98                               $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url?(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $row['user_sig']) : $row['user_sig']; 
    8799                    //and now we format sig 
    88                     $bb_code->parse($user_sig); 
    89                     $user_sig = $bb_code->get_html(); 
    90                     $user_sig = censor_text($user_sig); 
     100                               $bb_code->parse($user_sig); 
     101                               $user_sig = $bb_code->get_html(); 
     102                               $user_sig = censor_text($user_sig); 
    91103                    //last preparation :) 
    92                     $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
    93                } 
    94                else { 
    95                        $user_sig = ''; 
    96                } 
    97  
    98                   $title = ( $row['title'] ? $row['title'] . '<br />' : '' ); 
    99                         $title .= ( isset($ranks[$row['user_rank_id']]['rank_name']) ? $ranks[$row['user_rank_id']]['rank_name'] : '' ); 
    100           } 
    101           else { 
    102                $username = '<i>' . $lang['unknown'] . '</i>'; 
    103                $ratio = ''; 
    104                $ratio_color = ''; 
    105                $uploaded = ''; 
    106                $downloaded = ''; 
    107                $title = ''; 
     104                                $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
     105                        } 
     106                        else { 
     107                                $user_sig = ''; 
     108                        } 
     109 
     110                        $title = ( $row['title'] ? $row['title'] . '<br />' : '' ); 
     111                        $title .= ( isset($ranks[$row['user_rank_id']]['rank_name']) ? $ranks[$row['user_rank_id']]['rank_name'] : '' ); 
     112                } 
     113                else { 
     114                        $username = '<i>' . $lang['unknown'] . '</i>'; 
     115                $row['comment_user'] = $row['uid'] = ANONYMOUS; 
     116                        $ratio = ''; 
     117                        $ratio_color = ''; 
     118                        $uploaded = ''; 
     119                        $downloaded = ''; 
     120                        $title = ''; 
    108121                        $u_respect = ''; 
    109122                        $u_antirespect = ''; 
    110                $avatar = $images['default_avatar']; 
    111                $gender_img = ''; 
    112                $gender_text = ''; 
    113                $age = ''; 
    114                $u_report = ''; 
    115                $user_online = ''; 
    116                $user_sig = ''; 
    117          
     123                       $avatar = $images['default_avatar']; 
     124                       $gender_img = ''; 
     125                       $gender_text = ''; 
     126                       $age = ''; 
     127                       $u_report = ''; 
     128                       $user_online = ''; 
     129                       $user_sig = ''; 
     130               
    118131 
    119132                $bb_code->parse($row['comment_text']); 
     
    121134                $text = censor_text($text); 
    122135 
    123           $post_time = create_date($row['comment_added']); 
    124  
    125           if ( $row['comment_editedby'] ) { 
    126                   if ( $row['edited_by_username'] ) { 
     136               $post_time = create_date($row['comment_added']); 
     137 
     138               if ( $row['comment_editedby'] ) { 
     139                       if ( $row['edited_by_username'] ) { 
    127140                                // www.phpBB-SEO.com SEO TOOLKIT START 
    128141                                $seo->set_user_url($row['edited_by_username'], $row['comment_editedby']); 
    129142                                // www.phpBB-SEO.com SEO TOOLKIT END 
    130143 
    131                           $u_edited_by = append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']); 
    132                           $edited_by_username = $row['edited_by_username']; 
     144                               $u_edited_by = append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']); 
     145                               $edited_by_username = $row['edited_by_username']; 
    133146                        } 
    134147                        else { 
     
    138151 
    139152                        $edited_by = sprintf($lang['edited_by'], $edited_by_username, create_date($row['comment_editedat'])); 
    140           } 
    141           else { 
    142                   $u_edited_by = ''; 
    143                   $edited_by_username = ''; 
    144                   $edited_by = ''; 
    145           } 
    146  
    147           if ( ( $row['comment_user'] == $userdata['uid'] && $row['comment_user'] <> ANONYMOUS ) || $userdata['class'] >= UC_MODERATOR ) { 
    148                   $u_edit = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=edit&amp;cid=' . $row['comment_id']); 
    149           } 
    150           else { 
    151                   $u_edit = ''; 
    152           } 
    153  
    154           if ( $userdata['class'] >= UC_MODERATOR && $row['class'] <= $userdata['class'] ) { 
    155                   $u_delete = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=delete&amp;cid=' . $row['comment_id']); 
    156                   $s_delete_comment = true; 
    157           } 
    158           else { 
    159                   $u_delete = ''; 
    160                   $s_delete_comment = false; 
    161           } 
    162  
    163           if ( $userdata['session_logged_in']  ) { 
    164                   $u_quote = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=quote&amp;cid=' . $row['comment_id']); 
    165           } 
    166           else { 
    167                   $u_quote = ''; 
    168           } 
    169  
    170                 if ( $userdata['session_logged_in'] && $row['comment_added'] > $userdata['user_lastvisit'] && $row['comment_added'] > $last_read ) 
    171                 { 
    172                   $mini_post_img = $images['icon_minipost_new']; 
    173                $mini_post_alt = $lang['new_post']; 
    174                 } 
    175                 else 
    176                 { 
    177                $mini_post_img = $images['icon_minipost']; 
    178                $mini_post_alt = $lang['comment']; 
    179                 } 
    180  
    181                 if ( $row['comment_reputation'] > 0 ) { 
    182                         $current_reputation_show = '+' . $row['comment_reputation']; 
    183                 } 
    184                 else { 
    185                         $current_reputation_show = $row['comment_reputation']; 
    186                 } 
     153                } 
     154                else { 
     155                        $u_edited_by = ''; 
     156                        $edited_by_username = ''; 
     157                        $edited_by = ''; 
     158                } 
     159 
     160                if ( ( $row['comment_user'] == $userdata['uid'] && $row['comment_user'] <> ANONYMOUS ) || $userdata['class'] >= UC_MODERATOR ) { 
     161                        $u_edit = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=edit&amp;cid=' . $row['comment_id']); 
     162                } 
     163                else { 
     164                        $u_edit = ''; 
     165                } 
     166 
     167                if ( $userdata['class'] >= UC_MODERATOR && $row['class'] <= $userdata['class'] ) { 
     168                        $u_delete = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=delete&amp;cid=' . $row['comment_id']); 
     169                        $s_delete_comment = true; 
     170                } 
     171                else { 
     172                        $u_delete = ''; 
     173                        $s_delete_comment = false; 
     174                } 
     175 
     176                if ( $userdata['session_logged_in']  ) { 
     177                        $u_quote = append_sid($root_path . 'comment.php?type=' . $type . '&amp;action=quote&amp;cid=' . $row['comment_id']); 
     178                } 
     179                else { 
     180                        $u_quote = ''; 
     181                } 
     182 
     183                if ( $userdata['session_logged_in'] && $row['comment_added'] > $userdata['user_lastvisit'] && $row['comment_added'] > $last_read ) 
     184                { 
     185                        $mini_post_img = $images['icon_minipost_new']; 
     186                        $mini_post_alt = $lang['new_post']; 
     187                } 
     188                else { 
     189                        $mini_post_img = $images['icon_minipost']; 
     190                        $mini_post_alt = $lang['comment']; 
     191        } 
     192 
     193                if ( $row['comment_reputation'] > 0 ) { 
     194                        $current_reputation_show = '+' . $row['comment_reputation']; 
     195                } 
     196                else { 
     197                        $current_reputation_show = $row['comment_reputation']; 
     198                } 
    187199 
    188200                // www.phpBB-SEO.com SEO TOOLKIT START 
     
    324336} 
    325337 
    326 function preview_commentable ( $type = TYPE_TORRENT, $id ) { 
     338function preview_commentable ( $type = TYPE_TORRENT, $id, $owner ) { 
    327339        global $userdata, $lang, $template, $config, $images, $db, $cache, $root_path; 
    328340        global $bb_code; 
     
    351363                do { 
    352364 
    353                         if ( $row['uid'] <> ANONYMOUS ) { 
     365                        if ( $row['uid'] == ANONYMOUS ) { 
     366                                $show_comment_user == false; 
     367                        } 
     368                        else { 
     369                                if ( ( $owner == $row['uid'] && $row['privacy'] == PRIVACY_LEVEL_HIGH ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['uid'] ) ) { 
     370                                        $show_comment_user = false; 
     371                                } 
     372                                else { 
     373                                        $show_comment_user = true; 
     374                                } 
     375                        } 
     376 
     377                        if ( $show_comment_user ) { 
    354378                                if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['uid'] ) ) { 
    355379                                        $ratio = '---'; 
     
    395419                        else { 
    396420                                $username = '<i>' . $lang['unknown'] . '</i>'; 
     421                                $row['comment_user'] = $row['uid'] = ANONYMOUS; 
    397422                                //$title = ''; 
    398423                                $avatar = $images['default_avatar']; 
  • include/modtask/edituser.php

    r308 r321  
    316316                        $modcomment = 't' . time() . ' ' . $userdata['name'] . ' ' . implode('; ', $modcomment); 
    317317                        if ( sizeof($change_set) ) { 
    318                                 $modcomment .= ' ' . $lang['reason'] . ': &quot;' . $user['comment'] . '&quot;'; 
     318                                $modcomment .= ' ' . $lang['reason'] . ': &quot; ' . $user['comment'] . ' &quot;'; 
    319319                        } 
    320320                        $modcomment = $this_userdata['modcomment'] . ( $this_userdata['modcomment'] ? "\n" : '' ) . $modcomment; 
     
    418418 
    419419                        $modcomment = $user['modcomment']; 
    420                         $modcomment = implode("\n", array_reverse(explode("\n", $modcomment))); 
    421                         $modcomment = preg_replace('/t([0-9]{10})/e', "'[b]' . create_date('\\1') . '[/b]'", $modcomment); 
    422                         $bb_code = new bbcode($modcomment); 
    423                         $modcomment = $bb_code->get_html(); 
     420                        if ( $modcomment ) { 
     421                                $modcomment = implode("\n", array_reverse(preg_split("/\nt/", $modcomment, 0))); 
     422                                $modcomment = preg_replace('/(t?)([0-9]{10})/e', "'[b]' . create_date('\\2') . '[/b]'", $modcomment); 
     423                                $bb_code = new bbcode($modcomment); 
     424                                $modcomment = $bb_code->get_html(); 
     425                        } 
    424426 
    425427                        $template->assign_vars(array( 
  • news.php

    r317 r321  
    5454                        list($pagertop, $pagerbottom, $offset, $limit) = pager( $config['posts_per_page'], $row['news_comments'], 'news.php?id=' . $id . '&amp;' ); 
    5555 
    56                         commenttable(TYPE_NEWS, $id, $offset, $limit); 
     56                        commenttable(TYPE_NEWS, $id, $row['userid'], $offset, $limit); 
    5757                } 
    5858                else { 
  • offers.php

    r317 r321  
    334334                        list($pagertop, $pagerbottom, $offset, $limit) = pager($config['posts_per_page'], $row['comments'], 'offers.php?id=' . $id . '&amp;', array( 'reverse' => 1 )); 
    335335 
    336                         commenttable(TYPE_OFFER, $id, $offset, $limit); 
     336                        commenttable(TYPE_OFFER, $id, $row['userid'], $offset, $limit); 
    337337                } 
    338338                else { 
  • requests.php

    r317 r321  
    336336                        list($pagertop, $pagerbottom, $offset, $limit) = pager($config['posts_per_page'], $row['comments'], 'offers.php?id=' . $id . '&amp;', array( 'reverse' => 1 )); 
    337337 
    338                         commenttable(TYPE_REQUEST, $id, $offset, $limit); 
     338                        commenttable(TYPE_REQUEST, $id, $row['userid'], $offset, $limit); 
    339339                } 
    340340                else {