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 265 | Zeile 265 |
---|
} } }
|
} } }
|
|
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
| $post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
|
Zeile 290 | Zeile 290 |
---|
}
$post['userstars'] .= "<br />";
|
}
$post['userstars'] .= "<br />";
|
}
| }
|
$postnum = $post['postnum']; $post['postnum'] = my_number_format($post['postnum']);
| $postnum = $post['postnum']; $post['postnum'] = my_number_format($post['postnum']);
|
Zeile 307 | Zeile 307 |
---|
if($post['away'] == 1 && $mybb->settings['allowaway'] != 0) { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";");
|
if($post['away'] == 1 && $mybb->settings['allowaway'] != 0) { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";");
|
}
| }
|
else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
| else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
|
Zeile 320 | Zeile 320 |
---|
$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['button_find'] = ''; if($mybb->usergroup['cansearch'] == 1)
|
{
|
{
|
$post['useravatar'] = '';
| eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");
|
}
|
}
|
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) {
| if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false) {
|
Zeile 333 | Zeile 333 |
---|
}
$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'])
|
{ if(!$post['pid'])
|
{
| {
|
$post['pid'] = 0; }
eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");
|
$post['pid'] = 0; }
eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");
|
}
| }
|
if($post['website'] != "" && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1) {
| if($post['website'] != "" && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1) {
|
Zeile 360 | Zeile 360 |
---|
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']);
|
Zeile 374 | Zeile 374 |
---|
// Showing the warning level? (only show if not announcement) if($post_type != 3 && $mybb->settings['enablewarningsystem'] != 0 && $usergroup['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || ($mybb->user['uid'] == $post['uid'] && $mybb->settings['canviewownwarning'] != 0))) {
|
// Showing the warning level? (only show if not announcement) if($post_type != 3 && $mybb->settings['enablewarningsystem'] != 0 && $usergroup['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || ($mybb->user['uid'] == $post['uid'] && $mybb->settings['canviewownwarning'] != 0))) {
|
| if($mybb->settings['maxwarningpoints'] < 1) { $mybb->settings['maxwarningpoints'] = 10; }
|
$warning_level = round($post['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100) {
| $warning_level = round($post['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100) {
|
Zeile 472 | Zeile 477 |
---|
if($usergroup['usertitle']) { $post['usertitle'] = $usergroup['usertitle'];
|
if($usergroup['usertitle']) { $post['usertitle'] = $usergroup['usertitle'];
|
} else {
| } else {
|
$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 508 | Zeile 513 |
---|
// For private messages, fetch the reply/forward/delete icons if($post_type == 2 && $post['pmid'])
|
// For private messages, fetch the reply/forward/delete icons if($post_type == 2 && $post['pmid'])
|
{
| {
|
global $replyall;
eval("\$post['button_reply_pm'] = \"".$templates->get("postbit_reply_pm")."\";");
| global $replyall;
eval("\$post['button_reply_pm'] = \"".$templates->get("postbit_reply_pm")."\";");
|
Zeile 524 | Zeile 529 |
---|
$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))) {
|
Zeile 542 | Zeile 552 |
---|
$time = TIME_NOW; if((is_moderator($fid, "caneditposts") || ($forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $post['uid'] && $thread['closed'] != 1 && ($mybb->usergroup['edittimelimit'] == 0 || $mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] > ($time-($mybb->usergroup['edittimelimit']*60))))) && $mybb->user['uid'] != 0)
|
$time = TIME_NOW; if((is_moderator($fid, "caneditposts") || ($forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $post['uid'] && $thread['closed'] != 1 && ($mybb->usergroup['edittimelimit'] == 0 || $mybb->usergroup['edittimelimit'] != 0 && $post['dateline'] > ($time-($mybb->usergroup['edittimelimit']*60))))) && $mybb->user['uid'] != 0)
|
{
| {
|
eval("\$post['button_edit'] = \"".$templates->get("postbit_edit")."\";"); }
| eval("\$post['button_edit'] = \"".$templates->get("postbit_edit")."\";"); }
|
Zeile 551 | Zeile 561 |
---|
if($mybb->user['uid'] == $post['uid'] && $thread['closed'] == 0) { if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
|
if($mybb->user['uid'] == $post['uid'] && $thread['closed'] == 0) { if($forumpermissions['candeletethreads'] == 1 && $postcounter == 1)
|
{
| {
|
$can_delete_thread = 1; } else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
| $can_delete_thread = 1; } else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1)
|
Zeile 566 | Zeile 576 |
---|
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 = ''; if($post['visible'] == -1) {
| $display = ''; if($post['visible'] == -1) {
|
$display = "none"; } eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
| $display = "none"; } eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
Zeile 577 | Zeile 587 |
---|
{ $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 586 | Zeile 596 |
---|
// 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 = ''; } $postbit_qrestore = $lang->postbit_qrestore_post;
|
$display = "none"; if($post['visible'] == -1) { $display = ''; } $postbit_qrestore = $lang->postbit_qrestore_post;
|
eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";"); }
| eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";"); }
|
// Restore Thread else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)
| // Restore Thread else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1)
|
Zeile 607 | Zeile 617 |
---|
$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 if($ismod)
|
}
// Inline moderation stuff if($ismod)
|
{
| {
|
if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|"))
|
if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|"))
|
{
| {
|
$inlinecheck = "checked=\"checked\""; $inlinecount++; } else { $inlinecheck = "";
|
$inlinecheck = "checked=\"checked\""; $inlinecount++; } else { $inlinecheck = "";
|
}
| }
|
eval("\$post['inlinecheck'] = \"".$templates->get("postbit_inlinecheck")."\";");
| eval("\$post['inlinecheck'] = \"".$templates->get("postbit_inlinecheck")."\";");
|
Zeile 637 | Zeile 652 |
---|
$post_number = my_number_format($postcounter); eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";"); global $forum, $thread;
|
$post_number = my_number_format($postcounter); eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";"); global $forum, $thread;
|
|
|
if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'], "canpostclosedthreads")) && ($thread['uid'] == $mybb->user['uid'] || $forumpermissions['canonlyreplyownthreads'] != 1))
|
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")."\";");
|
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($mybb->user['uid'] != "0") {
| if($mybb->user['uid'] != "0") {
|
Zeile 680 | Zeile 695 |
---|
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";"); } else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))
|
eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";"); } else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod']))
|
{
| {
|
$action = 'getip'; if($post_type == 2) {
| $action = 'getip'; if($post_type == 2) {
|
Zeile 782 | Zeile 797 |
---|
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)
| // 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)
|
Zeile 791 | Zeile 819 |
---|
$post_visibility = "display: none;"; } break;
|
$post_visibility = "display: none;"; } break;
|
}
| }
|
if($mybb->settings['postlayout'] == "classic") { eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
|
if($mybb->settings['postlayout'] == "classic") { eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
|
}
| }
|
else { eval("\$postbit = \"".$templates->get("postbit")."\";");
|
else { eval("\$postbit = \"".$templates->get("postbit")."\";");
|
}
| }
|
$GLOBALS['post'] = "";
return $postbit;
| $GLOBALS['post'] = "";
return $postbit;
|
Zeile 810 | Zeile 838 |
---|
* 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 820 | Zeile 848 |
---|
$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)
|