Changeset 321
- Timestamp:
- 10/03/10 12:36:47 (2 years ago)
- Files:
-
- comment.php (modified) (12 diffs)
- include/bbcode/Xbb/Tags/Google.php (modified) (1 diff)
- include/functions.php (modified) (1 diff)
- include/functions_post.php (modified) (8 diffs)
- include/modtask/edituser.php (modified) (2 diffs)
- news.php (modified) (1 diff)
- offers.php (modified) (1 diff)
- requests.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
comment.php
r318 r321 18 18 $sql_table = REQUESTS_TABLE; 19 19 $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'; 21 21 $comment_field = 'comments'; 22 22 $where_id = 'id'; … … 26 26 $sql_table = OFFERS_TABLE; 27 27 $filename = 'offers'; 28 $field = 'name, id, category, comments AS comments_count ';28 $field = 'name, id, category, comments AS comments_count, userid AS owner'; 29 29 $comment_field = 'comments'; 30 30 $where_id = 'id'; … … 34 34 $sql_table = TORRENTS_TABLE; 35 35 $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'; 37 37 $comment_field = 'comments'; 38 38 $where_id = 'fid'; … … 42 42 $sql_table = NEWS_TABLE; 43 43 $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'; 45 45 $comment_field = 'news_comments'; 46 46 $where_id = 'id'; … … 202 202 )); 203 203 204 preview_commentable($type, $id );204 preview_commentable($type, $id, $arr['owner']); 205 205 206 206 stdhead(sprintf($lang['add_comment_to_header'], $name)); … … 379 379 switch ( $type ) { 380 380 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'; 382 382 $from = TORRENTS_TABLE . ' t'; 383 383 $where = 'c.comment_for_id = t.fid'; … … 385 385 386 386 case TYPE_REQUEST: 387 $select = 'r.request AS name, r.id ';387 $select = 'r.request AS name, r.id, r.userid AS owner'; 388 388 $from = REQUESTS_TABLE . ' r'; 389 389 $where = 'c.comment_for_id = r.id'; … … 391 391 392 392 case TYPE_OFFER: 393 $select = 'o.name, o.id ';393 $select = 'o.name, o.id, o.userid AS owner'; 394 394 $from = OFFERS_TABLE . ' o'; 395 395 $where = 'c.comment_for_id = o.id'; … … 397 397 398 398 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'; 400 400 $from = NEWS_TABLE . ' n'; 401 401 $where = 'c.comment_for_id = n.id'; … … 404 404 } 405 405 406 $sql = 'SELECT c.*, u.name AS username, u. uid, ' . $select . '406 $sql = 'SELECT c.*, u.name AS username, u.privacy, u.uid, ' . $select . ' 407 407 FROM ' . COMMENTS_TABLE . ' c, ' . USERS_TABLE . ' u, ' . $from . ' 408 408 WHERE c.comment_id = ' . $id . ' AND ' . $where . ' AND comment_type = ' . $type . ' AND c.comment_user = u.uid'; … … 417 417 $name = split_string($arr['name'], 55); 418 418 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'] ); 420 420 421 421 $quoted_text = '[quote="' . $username . '"]' . $arr['comment_text'] . '[/quote]'; … … 432 432 )); 433 433 434 preview_commentable($type, $arr['id'] );434 preview_commentable($type, $arr['id'], $arr['owner']); 435 435 436 436 stdhead(sprintf($lang['add_comment_to_header'], $name)); include/bbcode/Xbb/Tags/Google.php
r269 r321 26 26 public $behaviour = 'a'; 27 27 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.'"'; 36 34 return '<a class="bb_google" '.$attr.'>'.parent::get_html($this -> tree).'</a>'; 37 35 } include/functions.php
r318 r321 364 364 if ( $data['uid'] == ANONYMOUS ) { 365 365 $username = '<i>' . $lang['unknown'] . '</i>'; 366 367 $ret_string = $username; 366 368 } 367 369 else { 368 370 $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 } 387 389 } 388 390 } 389 391 } 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 .= ' ' . $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 .= ' <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'] . '&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 .= ' ' . $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 .= ' <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'] . '&action=card') . '\', \'\', \'width=420,height=230,resizable=yes,scrollbars=yes,status=yes\')">' . $rep_level . '</a></span>'; 467 } 466 468 } 467 469 include/functions_post.php
r317 r321 1 1 <?php 2 function commenttable( $type = TYPE_TORRENT, $id, $o ffset, $limit ) {2 function commenttable( $type = TYPE_TORRENT, $id, $owner, $offset, $limit ) { 3 3 global $db, $userdata, $lang, $template, $config, $images, $cache, $root_path; 4 4 global $bb_code; … … 33 33 $simpaty_ary = array(); 34 34 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 ) { 38 50 if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['comment_user'] ) ) { 39 51 $ratio = '---'; 40 $uploaded = '---';52 $uploaded = '---'; 41 53 $downloaded = '---'; 42 54 $ratio_color = ''; 43 55 } 44 56 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&simpaty=1&targetid=' . $row['comment_user'] . '&type=1&simpid=' . $row['comment_id']);55 $u_antirespect = append_sid('simpaty.php?action=add&simpaty=0&targetid=' . $row['comment_user'] . '&type=1&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&simpaty=1&targetid=' . $row['comment_user'] . '&type=1&simpid=' . $row['comment_id']); 67 $u_antirespect = append_sid('simpaty.php?action=add&simpaty=0&targetid=' . $row['comment_user'] . '&type=1&simpid=' . $row['comment_id']); 68 } 69 else { 70 $u_respect = ''; 71 $u_antirespect = ''; 72 } 73 74 if ( $row['gender'] ) { 63 75 $gender_img = $images['female']; 64 76 $gender_text = $lang['gender_female']; … … 75 87 $u_report = ''; 76 88 } 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&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) ); 83 95 84 96 if ( $row['user_sig'] && $config['allow_sig'] ) { 85 97 //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']; 87 99 //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); 91 103 //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 = ''; 108 121 $u_respect = ''; 109 122 $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 } 118 131 119 132 $bb_code->parse($row['comment_text']); … … 121 134 $text = censor_text($text); 122 135 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'] ) { 127 140 // www.phpBB-SEO.com SEO TOOLKIT START 128 141 $seo->set_user_url($row['edited_by_username'], $row['comment_editedby']); 129 142 // www.phpBB-SEO.com SEO TOOLKIT END 130 143 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']; 133 146 } 134 147 else { … … 138 151 139 152 $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 . '&action=edit&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 . '&action=delete&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 . '&action=quote&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 . '&action=edit&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 . '&action=delete&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 . '&action=quote&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 } 187 199 188 200 // www.phpBB-SEO.com SEO TOOLKIT START … … 324 336 } 325 337 326 function preview_commentable ( $type = TYPE_TORRENT, $id ) {338 function preview_commentable ( $type = TYPE_TORRENT, $id, $owner ) { 327 339 global $userdata, $lang, $template, $config, $images, $db, $cache, $root_path; 328 340 global $bb_code; … … 351 363 do { 352 364 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 ) { 354 378 if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['uid'] ) ) { 355 379 $ratio = '---'; … … 395 419 else { 396 420 $username = '<i>' . $lang['unknown'] . '</i>'; 421 $row['comment_user'] = $row['uid'] = ANONYMOUS; 397 422 //$title = ''; 398 423 $avatar = $images['default_avatar']; include/modtask/edituser.php
r308 r321 316 316 $modcomment = 't' . time() . ' ' . $userdata['name'] . ' ' . implode('; ', $modcomment); 317 317 if ( sizeof($change_set) ) { 318 $modcomment .= ' ' . $lang['reason'] . ': " ' . $user['comment'] . '"';318 $modcomment .= ' ' . $lang['reason'] . ': " ' . $user['comment'] . ' "'; 319 319 } 320 320 $modcomment = $this_userdata['modcomment'] . ( $this_userdata['modcomment'] ? "\n" : '' ) . $modcomment; … … 418 418 419 419 $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 } 424 426 425 427 $template->assign_vars(array( news.php
r317 r321 54 54 list($pagertop, $pagerbottom, $offset, $limit) = pager( $config['posts_per_page'], $row['news_comments'], 'news.php?id=' . $id . '&' ); 55 55 56 commenttable(TYPE_NEWS, $id, $ offset, $limit);56 commenttable(TYPE_NEWS, $id, $row['userid'], $offset, $limit); 57 57 } 58 58 else { offers.php
r317 r321 334 334 list($pagertop, $pagerbottom, $offset, $limit) = pager($config['posts_per_page'], $row['comments'], 'offers.php?id=' . $id . '&', array( 'reverse' => 1 )); 335 335 336 commenttable(TYPE_OFFER, $id, $ offset, $limit);336 commenttable(TYPE_OFFER, $id, $row['userid'], $offset, $limit); 337 337 } 338 338 else { requests.php
r317 r321 336 336 list($pagertop, $pagerbottom, $offset, $limit) = pager($config['posts_per_page'], $row['comments'], 'offers.php?id=' . $id . '&', array( 'reverse' => 1 )); 337 337 338 commenttable(TYPE_REQUEST, $id, $ offset, $limit);338 commenttable(TYPE_REQUEST, $id, $row['userid'], $offset, $limit); 339 339 } 340 340 else {
