Zeile 11 | Zeile 11 |
---|
/** * Build a post bit *
|
/** * Build a post bit *
|
* @param array The post data * @param int The type of post bit we're building (1 = preview, 2 = pm, 3 = announcement, else = post)
| * @param array $post The post data * @param int $post_type The type of post bit we're building (1 = preview, 2 = pm, 3 = announcement, else = post)
|
* @return string The built post bit */ function build_postbit($post, $post_type=0)
| * @return string The built post bit */ function build_postbit($post, $post_type=0)
|
Zeile 126 | Zeile 126 |
---|
} break; }
|
} break; }
|
| $post['username'] = htmlspecialchars_uni($post['username']); $post['userusername'] = htmlspecialchars_uni($post['userusername']);
|
if(!$postcounter) { // Used to show the # of the post
| if(!$postcounter) { // Used to show the # of the post
|
Zeile 265 | Zeile 268 |
---|
} } }
|
} } }
|
|
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
| $post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
|
Zeile 320 | Zeile 323 |
---|
$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']); eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";"); }
|
$useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']); eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";"); }
|
else { $post['useravatar'] = ''; }
eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");
| |
|
|
if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
| $post['button_find'] = ''; if($mybb->usergroup['cansearch'] == 1) { eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";"); }
if($mybb->settings['enablepms'] == 1 && (($post['receivepms'] != 0 && $usergroup['canusepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false) || $mybb->usergroup['canoverridepm'] == 1))
|
{ eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
|
{ eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
|
}
| }
|
$post['button_rep'] = '';
|
$post['button_rep'] = '';
|
if($post_type != 3 && $mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']) && $post['uid'] != $mybb->user['uid'])
| if($post_type != 3 && $mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']) && $post['uid'] != $mybb->user['uid'] && (!isset($post['visible']) || $post['visible'] == 1) && (!isset($thread['visible']) || $thread['visible'] == 1))
|
{ if(!$post['pid']) { $post['pid'] = 0;
|
{ if(!$post['pid']) { $post['pid'] = 0;
|
}
| }
|
eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";"); }
| eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";"); }
|
Zeile 347 | Zeile 350 |
---|
{ $post['website'] = htmlspecialchars_uni($post['website']); eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");
|
{ $post['website'] = htmlspecialchars_uni($post['website']); eval("\$post['button_www'] = \"".$templates->get("postbit_www")."\";");
|
}
| }
|
else { $post['button_www'] = "";
| else { $post['button_www'] = "";
|
Zeile 360 | Zeile 363 |
---|
else { $post['button_email'] = "";
|
else { $post['button_email'] = "";
|
}
$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);
| }
$post['userregdate'] = my_date($mybb->settings['regdateformat'], $post['regdate']);
|
// Work out the reputation this user has (only show if not announcement) if($post_type != 3 && $usergroup['usereputationsystem'] != 0 && $mybb->settings['enablereputation'] == 1) {
| // Work out the reputation this user has (only show if not announcement) if($post_type != 3 && $usergroup['usereputationsystem'] != 0 && $mybb->settings['enablereputation'] == 1) {
|
Zeile 388 | Zeile 391 |
---|
// If we can warn them, it's not the same person, and we're in a PM or a post. if($mybb->usergroup['canwarnusers'] != 0 && $post['uid'] != $mybb->user['uid'] && ($post_type == 0 || $post_type == 2))
|
// If we can warn them, it's not the same person, and we're in a PM or a post. if($mybb->usergroup['canwarnusers'] != 0 && $post['uid'] != $mybb->user['uid'] && ($post_type == 0 || $post_type == 2))
|
{
| {
|
eval("\$post['button_warn'] = \"".$templates->get("postbit_warn")."\";"); $warning_link = "warnings.php?uid={$post['uid']}"; }
| eval("\$post['button_warn'] = \"".$templates->get("postbit_warn")."\";"); $warning_link = "warnings.php?uid={$post['uid']}"; }
|
Zeile 482 | Zeile 485 |
---|
{ $post['usertitle'] = $lang->guest; }
|
{ $post['usertitle'] = $lang->guest; }
|
|
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
$usergroup['title'] = $lang->na;
| $post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
$usergroup['title'] = $lang->na;
|
Zeile 521 | Zeile 524 |
---|
eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");
if($replyall == true)
|
eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");
if($replyall == true)
|
{
| {
|
eval("\$post['button_replyall_pm'] = \"".$templates->get("postbit_replyall_pm")."\";");
|
eval("\$post['button_replyall_pm'] = \"".$templates->get("postbit_replyall_pm")."\";");
|
}
| }
|
}
$post['editedmsg'] = ''; if(!$post_type) {
|
}
$post['editedmsg'] = ''; if(!$post_type) {
|
| if(!isset($forumpermissions)) { $forumpermissions = forum_permissions($fid); }
|
// Figure out if we need to show an "edited by" message if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && (($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0) || ($mybb->settings['showeditedbyadmin'] != 0 && $usergroup['cancp'] == 1)))
|
// Figure out if we need to show an "edited by" message if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && (($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0) || ($mybb->settings['showeditedbyadmin'] != 0 && $usergroup['cancp'] == 1)))
|
{
| {
|
$post['editdate'] = my_date('relative', $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);
|
$post['editdate'] = my_date('relative', $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);
|
| $post['editusername'] = htmlspecialchars_uni($post['editusername']);
|
$post['editedprofilelink'] = build_profile_link($post['editusername'], $post['edituid']); $editreason = ""; if($post['editreason'] != "")
| $post['editedprofilelink'] = build_profile_link($post['editusername'], $post['edituid']); $editreason = ""; if($post['editreason'] != "")
|
Zeile 541 | Zeile 550 |
---|
$post['editreason'] = $parser->parse_badwords($post['editreason']); $post['editreason'] = htmlspecialchars_uni($post['editreason']); eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");
|
$post['editreason'] = $parser->parse_badwords($post['editreason']); $post['editreason'] = htmlspecialchars_uni($post['editreason']); eval("\$editreason = \"".$templates->get("postbit_editedby_editreason")."\";");
|
}
| }
|
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";"); }
| eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";"); }
|
Zeile 560 | Zeile 569 |
---|
$can_delete_thread = 1; } else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
|
$can_delete_thread = 1; } else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
|
{
| {
|
$can_delete_post = 1; } }
| $can_delete_post = 1; } }
|
Zeile 571 | Zeile 580 |
---|
if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1) { $postbit_qdelete = $lang->postbit_qdelete_post;
|
if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1) { $postbit_qdelete = $lang->postbit_qdelete_post;
|
$display = '';
| $display = '';
|
if($post['visible'] == -1) { $display = "none";
| if($post['visible'] == -1) { $display = "none";
|
Zeile 582 | Zeile 591 |
---|
{ $postbit_qdelete = $lang->postbit_qdelete_thread; $display = '';
|
{ $postbit_qdelete = $lang->postbit_qdelete_thread; $display = '';
|
if($post['visible'] == -1)
| if($post['visible'] == -1)
|
{ $display = "none"; }
| { $display = "none"; }
|
Zeile 591 | Zeile 600 |
---|
// Restore Post if(is_moderator($fid, "canrestoreposts") && $postcounter != 1)
|
// Restore Post if(is_moderator($fid, "canrestoreposts") && $postcounter != 1)
|
{ $display = "none"; if($post['visible'] == -1)
| { $display = "none"; if($post['visible'] == -1)
|
{ $display = ''; }
| { $display = ''; }
|
Zeile 603 | Zeile 612 |
---|
// Restore Thread else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)
|
// Restore Thread else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)
|
{
| {
|
$display = "none"; if($post['visible'] == -1) {
| $display = "none"; if($post['visible'] == -1) {
|
Zeile 612 | Zeile 621 |
---|
$postbit_qrestore = $lang->postbit_qrestore_thread; eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";"); }
|
$postbit_qrestore = $lang->postbit_qrestore_thread; eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";"); }
|
| }
if(!isset($ismod)) { $ismod = is_moderator($fid);
|
}
// Inline moderation stuff
| }
// Inline moderation stuff
|
Zeile 625 | Zeile 639 |
---|
else { $inlinecheck = "";
|
else { $inlinecheck = "";
|
}
| }
|
eval("\$post['inlinecheck'] = \"".$templates->get("postbit_inlinecheck")."\";");
| eval("\$post['inlinecheck'] = \"".$templates->get("postbit_inlinecheck")."\";");
|
Zeile 646 | Zeile 660 |
---|
if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'], "canpostclosedthreads")) && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1)) { eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");
|
if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'], "canpostclosedthreads")) && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1)) { eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");
|
}
| }
|
if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type) { eval("\$post['button_multiquote'] = \"".$templates->get("postbit_multiquote")."\";");
|
if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1) && ($thread['closed'] != 1 || is_moderator($fid, "canpostclosedthreads")) && $mybb->settings['multiquote'] != 0 && $forum['open'] != 0 && !$post_type) { eval("\$post['button_multiquote'] = \"".$templates->get("postbit_multiquote")."\";");
|
}
| }
|
if($mybb->user['uid'] != "0") { eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");
| if($mybb->user['uid'] != "0") { eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");
|
Zeile 664 | Zeile 678 |
---|
{ eval("\$post['button_edit'] = \"".$templates->get("announcement_edit")."\";"); eval("\$post['button_quickdelete'] = \"".$templates->get("announcement_quickdelete")."\";");
|
{ eval("\$post['button_edit'] = \"".$templates->get("announcement_edit")."\";"); eval("\$post['button_quickdelete'] = \"".$templates->get("announcement_quickdelete")."\";");
|
}
| }
|
}
$post['iplogged'] = ''; $show_ips = $mybb->settings['logip']; $ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));
|
}
$post['iplogged'] = ''; $show_ips = $mybb->settings['logip']; $ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));
|
|
|
// Show post IP addresses... PMs now can have IP addresses too as of 1.8! if($post_type == 2) {
| // Show post IP addresses... PMs now can have IP addresses too as of 1.8! if($post_type == 2) {
|
Zeile 694 | Zeile 708 |
---|
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_hiden")."\";"); } }
|
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_hiden")."\";"); } }
|
| }
$post['poststatus'] = ''; if(!$post_type && $post['visible'] != 1) { if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1) { $status_type = $lang->postbit_post_deleted; } else if(is_moderator($fid, "canviewunapprove") && $postcounter != 1 && $post['visible'] == 0) { $status_type = $lang->postbit_post_unapproved; } else if(is_moderator($fid, "canviewdeleted") && $postcounter == 1 && $post['visible'] == -1) { $status_type = $lang->postbit_thread_deleted; } else if(is_moderator($fid, "canviewunapprove") && $postcounter == 1 && $post['visible'] == 0) { $status_type = $lang->postbit_thread_unapproved; }
eval("\$post['poststatus'] = \"".$templates->get("postbit_status")."\";");
|
}
if(isset($post['smilieoff']) && $post['smilieoff'] == 1)
| }
if(isset($post['smilieoff']) && $post['smilieoff'] == 1)
|
Zeile 735 | Zeile 772 |
---|
"allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'],
|
"allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'],
|
"me_username" => $post['username'],
| "me_username" => $parser_options['me_username'],
|
"filter_badwords" => 1 );
| "filter_badwords" => 1 );
|
Zeile 773 | Zeile 810 |
---|
$post['icon'] = ""; }
|
$post['icon'] = ""; }
|
$post_visibility = $ignore_bit = '';
| $post_visibility = $ignore_bit = $deleted_bit = '';
|
switch($post_type) { case 1: // Message preview
| switch($post_type) { case 1: // Message preview
|
Zeile 787 | Zeile 824 |
---|
break; default: // Regular post $post = $plugins->run_hooks("postbit", $post);
|
break; default: // Regular post $post = $plugins->run_hooks("postbit", $post);
|
| if(!isset($ignored_users)) { $ignored_users = array(); if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "") { $ignore_list = explode(',', $mybb->user['ignorelist']); foreach($ignore_list as $uid) { $ignored_users[$uid] = 1; } } }
|
// Is this author on the ignore list of the current user? Hide this post if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1) { $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']); eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");
|
// Is this author on the ignore list of the current user? Hide this post if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1) { $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']); eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");
|
| $post_visibility = "display: none;"; }
// Has this post been deleted but can be viewed? Hide this post if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted")) { $deleted_message = $lang->sprintf($lang->postbit_deleted_post_user, $post['username']); eval("\$deleted_bit = \"".$templates->get("postbit_deleted")."\";");
|
$post_visibility = "display: none;"; } break;
|
$post_visibility = "display: none;"; } break;
|
}
if($mybb->settings['postlayout'] == "classic") { eval("\$postbit = \"".$templates->get("postbit_classic")."\";"); }
| }
if($forumpermissions['canviewdeletionnotice'] == 1 && $post['visible'] == -1 && $post_type == 0 && !is_moderator($fid, "canviewdeleted")) { eval("\$postbit = \"".$templates->get("postbit_deleted_member")."\";"); }
|
else {
|
else {
|
eval("\$postbit = \"".$templates->get("postbit")."\";");
| if($mybb->settings['postlayout'] == "classic") { eval("\$postbit = \"".$templates->get("postbit_classic")."\";"); } else { eval("\$postbit = \"".$templates->get("postbit")."\";"); }
|
}
|
}
|
|
|
$GLOBALS['post'] = "";
return $postbit; }
|
$GLOBALS['post'] = "";
return $postbit; }
|
|
|
/** * Fetch the attachments for a specific post and parse inline [attachment=id] code. * Note: assumes you have $attachcache, an array of attachments set up. *
|
/** * Fetch the attachments for a specific post and parse inline [attachment=id] code. * Note: assumes you have $attachcache, an array of attachments set up. *
|
* @param int The ID of the item. * @param array The post or item passed by reference.
| * @param int $id The ID of the item. * @param array $post The post or item passed by reference.
|
*/ function get_post_attachments($id, &$post) {
| */ function get_post_attachments($id, &$post) {
|
Zeile 825 | Zeile 891 |
---|
$validationcount = 0; $tcount = 0; $post['attachmentlist'] = $post['thumblist'] = $post['imagelist'] = '';
|
$validationcount = 0; $tcount = 0; $post['attachmentlist'] = $post['thumblist'] = $post['imagelist'] = '';
|
| if(!isset($forumpermissions)) { $forumpermissions = forum_permissions($post['fid']); }
|
if(isset($attachcache[$id]) && is_array($attachcache[$id])) { // This post has 1 or more attachments foreach($attachcache[$id] as $aid => $attachment)
| if(isset($attachcache[$id]) && is_array($attachcache[$id])) { // This post has 1 or more attachments foreach($attachcache[$id] as $aid => $attachment)
|