Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions_post.php 4052 2008-07-29 15:45:49Z Tikitiki $
| * $Id: functions_post.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
/**
| */
/**
|
Zeile 102 | Zeile 102 |
---|
} break; }
|
} break; }
|
| // Sanatize our custom profile fields for use in templates, if people choose to use them foreach($post as $post_field => $field_value) { if(substr($post_field, 0, 3) != 'fid') { continue; } $post[$post_field] = htmlspecialchars_uni($field_value); }
|
if(!$postcounter) { // Used to show the # of the post if($page > 1)
| if(!$postcounter) { // Used to show the # of the post if($page > 1)
|
Zeile 132 | Zeile 142 |
---|
if(!$altbg) { // Define the alternate background colour if this is the first post $altbg = "trow1";
|
if(!$altbg) { // Define the alternate background colour if this is the first post $altbg = "trow1";
|
}
| }
|
$postcounter++;
// Format the post date and time using my_date $post['postdate'] = my_date($mybb->settings['dateformat'], $post['dateline']); $post['posttime'] = my_date($mybb->settings['timeformat'], $post['dateline']);
|
$postcounter++;
// Format the post date and time using my_date $post['postdate'] = my_date($mybb->settings['dateformat'], $post['dateline']); $post['posttime'] = my_date($mybb->settings['timeformat'], $post['dateline']);
|
|
|
// Dont want any little 'nasties' in the subject $post['subject'] = $parser->parse_badwords($post['subject']);
// Pm's have been htmlspecialchars_uni()'ed already. if($post_type != 2)
|
// Dont want any little 'nasties' in the subject $post['subject'] = $parser->parse_badwords($post['subject']);
// Pm's have been htmlspecialchars_uni()'ed already. if($post_type != 2)
|
{
| {
|
$post['subject'] = htmlspecialchars_uni($post['subject']);
|
$post['subject'] = htmlspecialchars_uni($post['subject']);
|
}
| }
|
if(empty($post['subject'])) { $post['subject'] = ' ';
|
if(empty($post['subject'])) { $post['subject'] = ' ';
|
}
| }
|
$post['author'] = $post['uid'];
// Get the usergroup
| $post['author'] = $post['uid'];
// Get the usergroup
|
Zeile 161 | Zeile 171 |
---|
if(!$post['displaygroup']) { $post['displaygroup'] = $post['usergroup'];
|
if(!$post['displaygroup']) { $post['displaygroup'] = $post['usergroup'];
|
}
| }
|
$usergroup = $groupscache[$post['displaygroup']]; } else
| $usergroup = $groupscache[$post['displaygroup']]; } else
|
Zeile 261 | Zeile 271 |
---|
if($post['userstars'] && $post['starimage'] && $post['stars']) { $post['userstars'] .= "<br />";
|
if($post['userstars'] && $post['starimage'] && $post['stars']) { $post['userstars'] .= "<br />";
|
}
| }
|
$post['postnum'] = my_number_format($post['postnum']);
// 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'])
|
$post['postnum'] = my_number_format($post['postnum']);
// 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
| eval("\$post['onlinestatus'] = \"".$templates->get("postbit_online")."\";"); } else
|
Zeile 279 | Zeile 289 |
---|
else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
|
else { eval("\$post['onlinestatus'] = \"".$templates->get("postbit_offline")."\";");
|
} }
| } }
|
if($post['avatar'] != "" && ($mybb->user['showavatars'] != 0 || !$mybb->user['uid'])) {
| if($post['avatar'] != "" && ($mybb->user['showavatars'] != 0 || !$mybb->user['uid'])) {
|
Zeile 289 | Zeile 299 |
---|
if($avatar_dimensions[0] && $avatar_dimensions[1]) {
|
if($avatar_dimensions[0] && $avatar_dimensions[1]) {
|
list($max_width, $max_height) = explode("x", $mybb->settings['postmaxavatarsize']);
| list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['postmaxavatarsize']));
|
if($avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height) { require_once MYBB_ROOT."inc/functions_image.php"; $scaled_dimensions = scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width, $max_height); $avatar_width_height = "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
|
if($avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height) { require_once MYBB_ROOT."inc/functions_image.php"; $scaled_dimensions = scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width, $max_height); $avatar_width_height = "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
|
}
| }
|
else { $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
| else { $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
|
Zeile 308 | Zeile 318 |
---|
else { $post['useravatar'] = "";
|
else { $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) { eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
|
if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false) { eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";");
|
}
| }
|
if($post['website'] != "") { $post['website'] = htmlspecialchars_uni($post['website']);
| if($post['website'] != "") { $post['website'] = htmlspecialchars_uni($post['website']);
|
Zeile 424 | Zeile 434 |
---|
{ // 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($mybb->settings['dateformat'], $post['edittime']); $post['edittime'] = my_date($mybb->settings['timeformat'], $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate'], $post['edittime']);
| $post['editdate'] = my_date($mybb->settings['dateformat'], $post['edittime']); $post['edittime'] = my_date($mybb->settings['timeformat'], $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate'], $post['edittime']);
|
Zeile 526 | Zeile 536 |
---|
$parser_options['allow_smilies'] = 0; }
|
$parser_options['allow_smilies'] = 0; }
|
$post['message'] = $parser->parse_message($post['message'], $parser_options);
| |
// If we have incoming search terms to highlight - get it done.
|
// If we have incoming search terms to highlight - get it done.
|
global $highlight_cache;
| |
if($mybb->input['highlight']) {
|
if($mybb->input['highlight']) {
|
if(!is_array($highlight_cache)) { $highlight_cache = build_highlight_array($mybb->input['highlight']); } if(is_array($highlight_cache)) { $post['message'] = preg_replace(array_keys($highlight_cache), $highlight_cache, $post['message']); $post['subject'] = preg_replace(array_keys($highlight_cache), $highlight_cache, $post['subject']); }
| $parser_options['highlight'] = $mybb->input['highlight']; $post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);
|
}
|
}
|
| $post['message'] = $parser->parse_message($post['message'], $parser_options);
|
get_post_attachments($id, $post);
| get_post_attachments($id, $post);
|
Zeile 593 | Zeile 595 |
---|
// Is this author on the ignore list of the current user? Hide this post if(is_array($ignored_users) && $post['uid'] != 0 && $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 && $ignored_users[$post['uid']] == 1) {
|
$lang->postbit_currently_ignoring_user = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']);
| $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']);
|
eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";"); $post_visibility = "display: none;"; }
| eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";"); $post_visibility = "display: none;"; }
|
Zeile 699 | Zeile 701 |
---|
{ if($validationcount == 1) {
|
{ if($validationcount == 1) {
|
$lang->postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;
| $postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;
|
} else {
|
} else {
|
$lang->postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);
| $postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);
|
} eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment_unapproved")."\";"); }
| } eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment_unapproved")."\";"); }
|