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 90 | Zeile 90 |
---|
break; case 3: // Announcement global $announcementarray, $message;
|
break; case 3: // Announcement global $announcementarray, $message;
|
$parser_options['allow_html'] = $announcementarray['allowhtml'];
| $parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $announcementarray['allowhtml'];
|
$parser_options['allow_mycode'] = $announcementarray['allowmycode']; $parser_options['allow_smilies'] = $announcementarray['allowsmilies']; $parser_options['allow_imgcode'] = 1;
| $parser_options['allow_mycode'] = $announcementarray['allowmycode']; $parser_options['allow_smilies'] = $announcementarray['allowsmilies']; $parser_options['allow_imgcode'] = 1;
|
Zeile 110 | Zeile 110 |
---|
$parser_options['allow_imgcode'] = $forum['allowimgcode']; $parser_options['allow_videocode'] = $forum['allowvideocode']; $parser_options['filter_badwords'] = 1;
|
$parser_options['allow_imgcode'] = $forum['allowimgcode']; $parser_options['allow_videocode'] = $forum['allowvideocode']; $parser_options['filter_badwords'] = 1;
|
if(!$post['username']) { $post['username'] = $lang->guest; }
if($post['userusername']) { $parser_options['me_username'] = $post['userusername']; } else { $parser_options['me_username'] = $post['username']; }
| |
break; }
|
break; }
|
| if(!$post['username']) { $post['username'] = $lang->guest; // htmlspecialchars_uni'd below }
if($post['userusername']) { $parser_options['me_username'] = $post['userusername']; } else { $parser_options['me_username'] = $post['username']; }
$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 180 | Zeile 183 |
---|
$post['subject_title'] = $post['subject'];
// Get the usergroup
|
$post['subject_title'] = $post['subject'];
// Get the usergroup
|
if($post['userusername'])
| if($post['usergroup'])
|
{
|
{
|
if(!$post['displaygroup']) { $post['displaygroup'] = $post['usergroup']; } $usergroup = $groupscache[$post['displaygroup']];
| $usergroup = usergroup_permissions($post['usergroup']); } else { $usergroup = usergroup_permissions(1); }
// Fetch display group data. $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
if(!$post['displaygroup']) { $post['displaygroup'] = $post['usergroup'];
|
}
|
}
|
else
| $displaygroup = usergroup_displaygroup($post['displaygroup']); if(is_array($displaygroup))
|
{
|
{
|
$usergroup = $groupscache[1];
| $usergroup = array_merge($usergroup, $displaygroup);
|
}
if(!is_array($titlescache))
| }
if(!is_array($titlescache))
|
Zeile 265 | Zeile 278 |
---|
} } }
|
} } }
|
|
|
$post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
| $post['usertitle'] = htmlspecialchars_uni($post['usertitle']);
if($usergroup['stars'])
|
Zeile 276 | Zeile 289 |
---|
if(empty($post['starimage'])) { $post['starimage'] = $usergroup['starimage'];
|
if(empty($post['starimage'])) { $post['starimage'] = $usergroup['starimage'];
|
}
| }
|
if($post['starimage'] && $post['stars']) { // Only display stars if we have an image to use... $post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
|
if($post['starimage'] && $post['stars']) { // Only display stars if we have an image to use... $post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
|
|
|
$post['userstars'] = ''; for($i = 0; $i < $post['stars']; ++$i) { eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
|
$post['userstars'] = ''; for($i = 0; $i < $post['stars']; ++$i) { eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
|
}
| }
|
$post['userstars'] .= "<br />"; }
| $post['userstars'] .= "<br />"; }
|
Zeile 299 | Zeile 312 |
---|
// 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")."\";");
|
eval("\$post['onlinestatus'] = \"".$templates->get("postbit_away")."\";");
|
}
| }
|
else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
|
else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
|
} }
| } }
|
$post['useravatar'] = ''; if(isset($mybb->user['showavatars']) && $mybb->user['showavatars'] != 0 || $mybb->user['uid'] == 0)
|
$post['useravatar'] = ''; if(isset($mybb->user['showavatars']) && $mybb->user['showavatars'] != 0 || $mybb->user['uid'] == 0)
|
{ $useravatar = format_avatar(htmlspecialchars_uni($post['avatar']), $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
| { $useravatar = format_avatar($post['avatar'], $post['avatardimensions'], $mybb->settings['postmaxavatarsize']);
|
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");
|
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']) {
| { if(!$post['pid']) {
|
Zeile 341 | Zeile 354 |
---|
}
eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");
|
}
eval("\$post['button_rep'] = \"".$templates->get("postbit_rep_button")."\";");
|
}
if($post['website'] != "" && $mybb->settings['hidewebsite'] != -1 && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1) {
| }
if($post['website'] != "" && !is_member($mybb->settings['hidewebsite']) && $usergroup['canchangewebsite'] == 1) {
|
$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'] = ""; }
if($post['hideemail'] != 1 && $mybb->usergroup['cansendemail'] == 1)
|
else { $post['button_www'] = ""; }
if($post['hideemail'] != 1 && $mybb->usergroup['cansendemail'] == 1)
|
{
| {
|
eval("\$post['button_email'] = \"".$templates->get("postbit_email")."\";");
|
eval("\$post['button_email'] = \"".$templates->get("postbit_email")."\";");
|
}
| }
|
else { $post['button_email'] = "";
| else { $post['button_email'] = "";
|
Zeile 366 | Zeile 379 |
---|
// 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)
|
{
| {
|
$post['userreputation'] = get_reputation($post['reputation'], $post['uid']); eval("\$post['replink'] = \"".$templates->get("postbit_reputation")."\";"); }
| $post['userreputation'] = get_reputation($post['reputation'], $post['uid']); eval("\$post['replink'] = \"".$templates->get("postbit_reputation")."\";"); }
|
Zeile 374 | Zeile 387 |
---|
// 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 = 100;
|
$warning_level = round($post['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100) { $warning_level = 100;
|
}
| }
|
$warning_level = get_colored_warning_level($warning_level);
// If we can warn them, it's not the same person, and we're in a PM or a post.
| $warning_level = get_colored_warning_level($warning_level);
// If we can warn them, it's not the same person, and we're in a PM or a post.
|
Zeile 414 | Zeile 432 |
---|
$thing = explode("\n", $field['type'], "2"); $type = trim($thing[0]); $useropts = explode("\n", $post[$fieldfid]);
|
$thing = explode("\n", $field['type'], "2"); $type = trim($thing[0]); $useropts = explode("\n", $post[$fieldfid]);
|
|
|
if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox")) { foreach($useropts as $val)
| if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox")) { foreach($useropts as $val)
|
Zeile 461 | Zeile 479 |
---|
eval("\$post['profilefield'] .= \"".$templates->get("postbit_profilefield")."\";"); } }
|
eval("\$post['profilefield'] .= \"".$templates->get("postbit_profilefield")."\";"); } }
|
}
| }
|
eval("\$post['user_details'] = \"".$templates->get("postbit_author_user")."\";"); }
| eval("\$post['user_details'] = \"".$templates->get("postbit_author_user")."\";"); }
|
Zeile 477 | Zeile 495 |
---|
{ $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 495 | Zeile 513 |
---|
eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";"); }
|
eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";"); }
|
| $post['input_editreason'] = '';
|
$post['button_edit'] = ''; $post['button_quickdelete'] = ''; $post['button_quickrestore'] = '';
| $post['button_edit'] = ''; $post['button_quickdelete'] = ''; $post['button_quickrestore'] = '';
|
Zeile 524 | Zeile 543 |
---|
$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 540 | Zeile 565 |
---|
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";"); }
|
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";"); }
|
if((is_moderator($fid, "caneditposts") || ($forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $post['uid'] && $thread['closed'] != 1)) && $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['input_editreason'] = \"".$templates->get("postbit_editreason")."\";");
|
eval("\$post['button_edit'] = \"".$templates->get("postbit_edit")."\";"); }
| eval("\$post['button_edit'] = \"".$templates->get("postbit_edit")."\";"); }
|
Zeile 556 | Zeile 583 |
---|
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_qdelete = $postbit_qrestore = '';
|
if($mybb->user['uid'] != 0) {
|
if($mybb->user['uid'] != 0) {
|
if((is_moderator($fid, "candeleteposts") || $can_delete_post == 1) && $postcounter != 1)
| 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"; } eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
// Restore Post if(is_moderator($fid, "canrestoreposts")) {
| $display = ''; if($post['visible'] == -1) {
|
$display = "none";
|
$display = "none";
|
if($post['visible'] == -1) { $display = ""; } $postbit_qrestore = $lang->postbit_qrestore_post; eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
| |
}
|
}
|
| eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
}
|
}
|
else if((is_moderator($fid, "candeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
| else if((is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads") || $can_delete_thread == 1) && $postcounter == 1)
|
{ $postbit_qdelete = $lang->postbit_qdelete_thread;
|
{ $postbit_qdelete = $lang->postbit_qdelete_thread;
|
$display = ""; if($post['visible'] == -1) {
| $display = ''; if($post['visible'] == -1) {
|
$display = "none";
|
$display = "none";
|
} $postbit_qrestore = $lang->postbit_qrestore_thread;
| }
|
eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
eval("\$post['button_quickdelete'] = \"".$templates->get("postbit_quickdelete")."\";");
|
| }
// Restore Post if(is_moderator($fid, "canrestoreposts") && $postcounter != 1) { $display = "none"; if($post['visible'] == -1) { $display = ''; } $postbit_qrestore = $lang->postbit_qrestore_post; eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";"); }
|
|
|
// Restore Post if(is_moderator($fid, "canrestoreposts"))
| // Restore Thread else if(is_moderator($fid, "canrestorethreads") && $postcounter == 1) { $display = "none"; if($post['visible'] == -1)
|
{
|
{
|
$display = "none"; if($post['visible'] == -1) { $display = ""; } eval("\$post['button_quickrestore'] = \"".$templates->get("postbit_quickrestore")."\";");
| $display = "";
|
}
|
}
|
| $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']."|") !== false)
|
{ $inlinecheck = "checked=\"checked\""; $inlinecount++;
| { $inlinecheck = "checked=\"checked\""; $inlinecount++;
|
Zeile 626 | Zeile 658 |
---|
if($post['visible'] == 0) { $invisiblepost = 1;
|
if($post['visible'] == 0) { $invisiblepost = 1;
|
}
| }
|
} else {
| } else {
|
Zeile 681 | Zeile 713 |
---|
else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod'])) { $action = 'getip';
|
else if($show_ips == "hide" && (is_moderator($fid, "canviewips") || $mybb->usergroup['issupermod'])) { $action = 'getip';
|
| $javascript = 'getIP';
|
if($post_type == 2) { $action = 'getpmip';
|
if($post_type == 2) { $action = 'getpmip';
|
| $javascript = 'getPMIP';
|
}
|
}
|
|
|
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 720 | Zeile 779 |
---|
get_post_attachments($id, $post); }
|
get_post_attachments($id, $post); }
|
if(isset($post['includesig']) && $post['includesig'] != 0 && $post['username'] && $post['signature'] != "" && ($mybb->user['uid'] == 0 || $mybb->user['showsigs'] != 0) && ($post['suspendsignature'] == 0 || $post['suspendsignature'] == 1 && $post['suspendsigtime'] != 0 && $post['suspendsigtime'] < TIME_NOW) && $usergroup['canusesig'] == 1 && ($usergroup['canusesigxposts'] == 0 || $usergroup['canusesigxposts'] > 0 && $postnum > $usergroup['canusesigxposts']) && $mybb->settings['hidesignatures'] != -1 && !is_member($mybb->settings['hidesignatures']))
| if(isset($post['includesig']) && $post['includesig'] != 0 && $post['username'] && $post['signature'] != "" && ($mybb->user['uid'] == 0 || $mybb->user['showsigs'] != 0) && ($post['suspendsignature'] == 0 || $post['suspendsignature'] == 1 && $post['suspendsigtime'] != 0 && $post['suspendsigtime'] < TIME_NOW) && $usergroup['canusesig'] == 1 && ($usergroup['canusesigxposts'] == 0 || $usergroup['canusesigxposts'] > 0 && $postnum > $usergroup['canusesigxposts']) && !is_member($mybb->settings['hidesignatures']))
|
{ $sig_parser = array( "allow_html" => $mybb->settings['sightml'], "allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'],
|
{ $sig_parser = array( "allow_html" => $mybb->settings['sightml'], "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 765 | Zeile 826 |
---|
$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 779 | Zeile 840 |
---|
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; } } }
// 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;"; }
|
// Is this author on the ignore list of the current user? Hide this post
|
// 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)
| if(is_array($ignored_users) && $post['uid'] != 0 && isset($ignored_users[$post['uid']]) && $ignored_users[$post['uid']] == 1 && empty($deleted_bit))
|
{ $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']); eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";"); $post_visibility = "display: none;"; } break;
|
{ $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']); eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";"); $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'] = "";
| $GLOBALS['post'] = "";
|
return $postbit; }
| return $postbit; }
|
Zeile 807 | Zeile 897 |
---|
* 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 817 | Zeile 907 |
---|
$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)
|
Zeile 827 | Zeile 922 |
---|
$attachment['filesize'] = get_friendly_size($attachment['filesize']); $ext = get_extension($attachment['filename']); if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
|
$attachment['filesize'] = get_friendly_size($attachment['filesize']); $ext = get_extension($attachment['filename']); if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
|
{
| {
|
$isimage = true; } else
| $isimage = true; } else
|
Zeile 841 | Zeile 936 |
---|
{ $attachment['dateuploaded'] = $attachment['dateline']; }
|
{ $attachment['dateuploaded'] = $attachment['dateline']; }
|
$attachdate = my_date('relative', $attachment['dateuploaded']);
| $attachdate = my_date('normal', $attachment['dateuploaded']);
|
// Support for [attachment=id] code if(stripos($post['message'], "[attachment=".$attachment['aid']."]") !== false) {
| // Support for [attachment=id] code if(stripos($post['message'], "[attachment=".$attachment['aid']."]") !== false) {
|
Zeile 851 | Zeile 946 |
---|
if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes") { eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
|
if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes") { eval("\$attbit = \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
|
} elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
| } elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
|
{ eval("\$attbit = \"".$templates->get("postbit_attachments_images_image")."\";"); }
| { eval("\$attbit = \"".$templates->get("postbit_attachments_images_image")."\";"); }
|
Zeile 876 | Zeile 971 |
---|
$tcount = 0; } ++$tcount;
|
$tcount = 0; } ++$tcount;
|
}
| }
|
elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
|
elseif((($attachment['thumbnail'] == "SMALL" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == "no") && $isimage)
|
{
| {
|
eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");
|
eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";");
|
}
| }
|
else { eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment")."\";"); } }
|
else { eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment")."\";"); } }
|
} else {
| } else {
|
$validationcount++; } }
| $validationcount++; } }
|
Zeile 925 | Zeile 1020 |
---|
eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";"); } }
|
eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";"); } }
|
| }
/** * Returns bytes count from human readable string * Used to parse ini_get human-readable values to int * * @param string $val Human-readable value */ function return_bytes($val) { $val = trim($val); if ($val == "") { return 0; }
$last = strtolower($val[strlen($val)-1]); switch($last) { case 'g': $val *= 1024; case 'm': $val *= 1024; case 'k': $val *= 1024; }
return intval($val);
|
}
| }
|