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'])
|
{
| {
|
$post['stars'] = $usergroup['stars']; }
if(empty($post['starimage'])) { $post['starimage'] = $usergroup['starimage'];
|
$post['stars'] = $usergroup['stars']; }
if(empty($post['starimage'])) { $post['starimage'] = $usergroup['starimage'];
|
}
| }
|
if($post['starimage'] && $post['stars']) { // Only display stars if we have an image to use...
| if($post['starimage'] && $post['stars']) { // Only display stars if we have an image to use...
|
Zeile 299 | Zeile 302 |
---|
// Determine the status to show for the user (Online/Offline/Away) $timecut = TIME_NOW - $mybb->settings['wolcutoff']; if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])
|
// Determine the status to show for the user (Online/Offline/Away) $timecut = TIME_NOW - $mybb->settings['wolcutoff']; if($post['lastactive'] > $timecut && ($post['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $post['lastvisit'] != $post['lastactive'])
|
{
| {
|
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";"); } else { if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)
|
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";"); } else { if($post['away'] == 1 && $mybb->settings['allowaway'] != 0)
|
{
| {
|
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";"); } else
| eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";"); } else
|
Zeile 319 | Zeile 322 |
---|
{ $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 336 |
---|
}
$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']) {
|
Zeile 475 | Zeile 478 |
---|
$post['profilelink'] = format_name($post['username'], 1);
if($usergroup['usertitle'])
|
$post['profilelink'] = format_name($post['username'], 1);
if($usergroup['usertitle'])
|
{
| {
|
$post['usertitle'] = $usergroup['usertitle'];
|
$post['usertitle'] = $usergroup['usertitle'];
|
}
| }
|
else { $post['usertitle'] = $lang->guest; }
|
else { $post['usertitle'] = $lang->guest; }
|
|
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
$usergroup['title'] = $lang->na;
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
$usergroup['title'] = $lang->na;
|
|
|
$post['userregdate'] = $lang->na; $post['postnum'] = $lang->na; $post['button_profile'] = '';
| $post['userregdate'] = $lang->na; $post['postnum'] = $lang->na; $post['button_profile'] = '';
|
Zeile 519 | Zeile 522 |
---|
eval("\$post['button_reply_pm'] = \"".$templates->get("postbit_reply_pm")."\";"); eval("\$post['button_forward_pm'] = \"".$templates->get("postbit_forward_pm")."\";"); eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");
|
eval("\$post['button_reply_pm'] = \"".$templates->get("postbit_reply_pm")."\";"); eval("\$post['button_forward_pm'] = \"".$templates->get("postbit_forward_pm")."\";"); eval("\$post['button_delete_pm'] = \"".$templates->get("postbit_delete_pm")."\";");
|
|
|
if($replyall == true)
|
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))) { $post['editdate'] = my_date('relative', $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);
|
// 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['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 562 | Zeile 571 |
---|
else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1) { $can_delete_post = 1;
|
else if($forumpermissions['candeleteposts'] == 1 && $postcounter != 1) { $can_delete_post = 1;
|
}
| }
|
}
$postbit_qdelete = $postbit_qrestore = ''; if($mybb->user['uid'] != 0) { if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
|
}
$postbit_qdelete = $postbit_qrestore = ''; if($mybb->user['uid'] != 0) { if((is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts") || $can_delete_post == 1) && $postcounter != 1)
|
{
| {
|
$postbit_qdelete = $lang->postbit_qdelete_post;
|
$postbit_qdelete = $lang->postbit_qdelete_post;
|
$display = ''; if($post['visible'] == -1) { $display = "none"; }
| $display = ''; if($post['visible'] == -1) { $display = "none"; }
|
eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";"); } else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
| eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";"); } else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
|
Zeile 587 | Zeile 596 |
---|
$display = "none"; } eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
$display = "none"; } eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
}
| }
|
// 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 = ''; } $postbit_qrestore = $lang->postbit_qrestore_post;
|
{ $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 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 735 | Zeile 749 |
---|
"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 787 | Zeile 801 |
---|
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 796 | Zeile 823 |
---|
$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 815 | Zeile 842 |
---|
* 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 852 |
---|
$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)
|