Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: functions_post.php 5380 2011-02-21 12:04:43Z Tomm $
| * $Id$
|
*/
/**
| */
/**
|
Zeile 24 | Zeile 24 |
---|
global $plugins, $parser, $cache, $ignored_users, $hascustomtitle; $hascustomtitle = 0;
|
global $plugins, $parser, $cache, $ignored_users, $hascustomtitle; $hascustomtitle = 0;
|
| // Set default values for any fields not provided here foreach(array('subject_extra', 'attachments', 'button_rep', 'button_warn', 'button_reply_pm', 'button_replyall_pm', 'button_forward_pm', 'button_delete_pm') as $post_field) { if(empty($post[$post_field])) { $post[$post_field] = ''; } }
|
// Set up the message parser if it doesn't already exist. if(!$parser)
| // Set up the message parser if it doesn't already exist. if(!$parser)
|
Zeile 42 | Zeile 51 |
---|
$altbg = 'trow2'; } else
|
$altbg = 'trow2'; } else
|
{
| {
|
$altbg = 'trow1'; } $post['fid'] = $fid;
| $altbg = 'trow1'; } $post['fid'] = $fid;
|
Zeile 50 | Zeile 59 |
---|
{ case 1: // Message preview global $forum;
|
{ case 1: // Message preview global $forum;
|
$parser_options['allow_html'] = $forum['allowhtml']; $parser_options['allow_mycode'] = $forum['allowmycode'];
| $parser_options['allow_html'] = $forum['allowhtml']; $parser_options['allow_mycode'] = $forum['allowmycode'];
|
$parser_options['allow_smilies'] = $forum['allowsmilies']; $parser_options['allow_imgcode'] = $forum['allowimgcode']; $parser_options['allow_videocode'] = $forum['allowvideocode'];
| $parser_options['allow_smilies'] = $forum['allowsmilies']; $parser_options['allow_imgcode'] = $forum['allowimgcode']; $parser_options['allow_videocode'] = $forum['allowvideocode'];
|
Zeile 94 | Zeile 103 |
---|
if(!$post['username']) { $post['username'] = $lang->guest;
|
if(!$post['username']) { $post['username'] = $lang->guest;
|
}
| }
|
if($post['userusername'])
|
if($post['userusername'])
|
{
| {
|
$parser_options['me_username'] = $post['userusername']; } else { $parser_options['me_username'] = $post['username'];
|
$parser_options['me_username'] = $post['userusername']; } else { $parser_options['me_username'] = $post['username'];
|
}
| }
|
break; }
| break; }
|
Zeile 123 | Zeile 132 |
---|
{ if(!$mybb->settings['postsperpage']) {
|
{ if(!$mybb->settings['postsperpage']) {
|
$mybb->settings['postperpage'] = 20;
| $mybb->settings['postsperpage'] = 20;
|
} $postcounter = $mybb->settings['postsperpage']*($page-1);
| } $postcounter = $mybb->settings['postsperpage']*($page-1);
|
Zeile 139 | Zeile 148 |
---|
$post_extra_style = "border-top-width: 0;"; } else
|
$post_extra_style = "border-top-width: 0;"; } else
|
{
| {
|
$post_extra_style = "margin-top: 5px;";
|
$post_extra_style = "margin-top: 5px;";
|
}
| }
|
if(!$altbg) { // Define the alternate background colour if this is the first post $altbg = "trow1"; } $postcounter++;
|
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']);
| // 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']);
|
Zeile 165 | Zeile 174 |
---|
if(empty($post['subject'])) { $post['subject'] = ' ';
|
if(empty($post['subject'])) { $post['subject'] = ' ';
|
}
| }
|
$post['author'] = $post['uid'];
// Get the usergroup if($post['userusername']) { if(!$post['displaygroup'])
|
$post['author'] = $post['uid'];
// Get the usergroup if($post['userusername']) { if(!$post['displaygroup'])
|
{
| {
|
$post['displaygroup'] = $post['usergroup']; } $usergroup = $groupscache[$post['displaygroup']];
|
$post['displaygroup'] = $post['usergroup']; } $usergroup = $groupscache[$post['displaygroup']];
|
}
| }
|
else { $usergroup = $groupscache[1];
|
else { $usergroup = $groupscache[1];
|
}
| }
|
if(!is_array($titlescache)) {
| if(!is_array($titlescache)) {
|
Zeile 202 | Zeile 211 |
---|
}
// Work out the usergroup/title stuff
|
}
// Work out the usergroup/title stuff
|
| $post['groupimage'] = '';
|
if(!empty($usergroup['image'])) {
|
if(!empty($usergroup['image'])) {
|
| $language = $mybb->settings['bblanguage'];
|
if(!empty($mybb->user['language'])) { $language = $mybb->user['language']; }
|
if(!empty($mybb->user['language'])) { $language = $mybb->user['language']; }
|
else { $language = $mybb->settings['bblanguage']; }
|
|
$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']); $usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']); eval("\$post['groupimage'] = \"".$templates->get("postbit_groupimage")."\";");
|
$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']); $usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']); eval("\$post['groupimage'] = \"".$templates->get("postbit_groupimage")."\";");
|
|
|
if($mybb->settings['postlayout'] == "classic") { $post['groupimage'] .= "<br />";
| if($mybb->settings['postlayout'] == "classic") { $post['groupimage'] .= "<br />";
|
Zeile 222 | Zeile 231 |
---|
}
if($post['userusername'])
|
}
if($post['userusername'])
|
{ // This post was made by a registered user
| { // This post was made by a registered user
|
$post['username'] = $post['userusername']; $post['profilelink_plain'] = get_profile_link($post['uid']); $post['username_formatted'] = format_name($post['username'], $post['usergroup'], $post['displaygroup']);
| $post['username'] = $post['userusername']; $post['profilelink_plain'] = get_profile_link($post['uid']); $post['username_formatted'] = format_name($post['username'], $post['usergroup'], $post['displaygroup']);
|
Zeile 235 | Zeile 244 |
---|
} if($usergroup['usertitle'] != "" && !$hascustomtitle)
|
} if($usergroup['usertitle'] != "" && !$hascustomtitle)
|
{ $post['usertitle'] = $usergroup['usertitle'];
| { $post['usertitle'] = $usergroup['usertitle'];
|
} elseif(is_array($titlescache) && !$usergroup['usertitle']) {
| } elseif(is_array($titlescache) && !$usergroup['usertitle']) {
|
Zeile 257 | Zeile 266 |
---|
}
if($usergroup['stars'])
|
}
if($usergroup['stars'])
|
{
| {
|
$post['stars'] = $usergroup['stars'];
|
$post['stars'] = $usergroup['stars'];
|
}
if(!$post['starimage']) {
| }
if(empty($post['starimage'])) {
|
$post['starimage'] = $usergroup['starimage']; }
| $post['starimage'] = $usergroup['starimage']; }
|
Zeile 270 | Zeile 279 |
---|
{ // Only display stars if we have an image to use... $post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
|
{ // 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) { $post['userstars'] .= "<img src=\"".$post['starimage']."\" border=\"0\" alt=\"*\" />";
| for($i = 0; $i < $post['stars']; ++$i) { $post['userstars'] .= "<img src=\"".$post['starimage']."\" border=\"0\" alt=\"*\" />";
|
Zeile 279 | Zeile 289 |
---|
$post['userstars'] .= "<br />"; }
|
$post['userstars'] .= "<br />"; }
|
| $postnum = $post['postnum'];
|
$post['postnum'] = my_number_format($post['postnum']);
// Determine the status to show for the user (Online/Offline/Away)
| $post['postnum'] = my_number_format($post['postnum']);
// Determine the status to show for the user (Online/Offline/Away)
|
Zeile 324 | Zeile 335 |
---|
} else {
|
} else {
|
$post['useravatar'] = "";
| $post['useravatar'] = ''; $post['avatar_padding'] = '';
|
} eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");
| } eval("\$post['button_find'] = \"".$templates->get("postbit_find")."\";");
|
Zeile 334 | Zeile 346 |
---|
eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";"); }
|
eval("\$post['button_pm'] = \"".$templates->get("postbit_pm")."\";"); }
|
if($mybb->settings['enablereputation'] == 1 && $mybb->settings['postrep'] == 1 && $mybb->usergroup['cangivereputations'] == 1 && $usergroup['usereputationsystem'] == 1)
| if($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['pid']) {
| { if(!$post['pid']) {
|
Zeile 379 | Zeile 391 |
---|
if($warning_level > 100) { $warning_level = 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 399 | Zeile 411 |
---|
} else { // Message was posted by a guest or an unknown user
|
} else { // Message was posted by a guest or an unknown user
|
$post['username'] = $post['username'];
| |
$post['profilelink'] = format_name($post['username'], 1); if($usergroup['usertitle'])
| $post['profilelink'] = format_name($post['username'], 1); if($usergroup['usertitle'])
|
Zeile 450 | Zeile 461 |
---|
if(!$post_type) { // Figure out if we need to show an "edited by" message
|
if(!$post_type) { // 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['editedmsg'] = ''; 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['editdate'] = my_date($mybb->settings['dateformat'], $post['edittime']); $post['edittime'] = my_date($mybb->settings['timeformat'], $post['edittime']);
|
Zeile 486 | Zeile 498 |
---|
// Inline moderation stuff if($ismod) {
|
// Inline moderation stuff if($ismod) {
|
if(my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|"))
| if(isset($mybb->cookies[$inlinecookie]) && my_strpos($mybb->cookies[$inlinecookie], "|".$post['pid']."|"))
|
{ $inlinecheck = "checked=\"checked\""; $inlinecount++;
| { $inlinecheck = "checked=\"checked\""; $inlinecount++;
|
Zeile 561 | Zeile 573 |
---|
} // If we have incoming search terms to highlight - get it done.
|
} // If we have incoming search terms to highlight - get it done.
|
if($mybb->input['highlight'])
| if(!empty($mybb->input['highlight']))
|
{ $parser_options['highlight'] = $mybb->input['highlight']; $post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);
| { $parser_options['highlight'] = $mybb->input['highlight']; $post['subject'] = $parser->highlight_message($post['subject'], $parser_options['highlight']);
|
Zeile 571 | Zeile 583 |
---|
get_post_attachments($id, $post);
|
get_post_attachments($id, $post);
|
if($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))
| if($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']))
|
{ $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" => $post['username'], "filter_badwords" => 1
|
);
|
);
|
| if($usergroup['signofollow']) { $sig_parser['nofollow_on'] = 1; }
|
$post['signature'] = $parser->parse_message($post['signature'], $sig_parser); eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";"); } else
|
$post['signature'] = $parser->parse_message($post['signature'], $sig_parser); eval("\$post['signature'] = \"".$templates->get("postbit_signature")."\";"); } else
|
{
| {
|
$post['signature'] = ""; }
| $post['signature'] = ""; }
|
Zeile 594 | Zeile 612 |
---|
if($post['icon'] > 0 && $icon_cache[$post['icon']]) { $icon = $icon_cache[$post['icon']];
|
if($post['icon'] > 0 && $icon_cache[$post['icon']]) { $icon = $icon_cache[$post['icon']];
|
| $icon['path'] = htmlspecialchars_uni($icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']);
|
$post['icon'] = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" style=\"vertical-align: middle;\" /> "; } else
| $post['icon'] = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" style=\"vertical-align: middle;\" /> "; } else
|
Zeile 605 | Zeile 626 |
---|
switch($post_type) { case 1: // Message preview
|
switch($post_type) { case 1: // Message preview
|
$plugins->run_hooks_by_ref("postbit_prev", $post);
| $post = $plugins->run_hooks("postbit_prev", $post);
|
break; case 2: // Private message
|
break; case 2: // Private message
|
$plugins->run_hooks_by_ref("postbit_pm", $post);
| $post = $plugins->run_hooks("postbit_pm", $post);
|
break; case 3: // Announcement
|
break; case 3: // Announcement
|
$plugins->run_hooks_by_ref("postbit_announcement", $post);
| $post = $plugins->run_hooks("postbit_announcement", $post);
|
break; default: // Regular post
|
break; default: // Regular post
|
$plugins->run_hooks_by_ref("postbit", $post);
| $post = $plugins->run_hooks("postbit", $post);
|
// 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 && $ignored_users[$post['uid']] == 1)
| $ignore_bit = ''; 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")."\";");
| { $ignored_message = $lang->sprintf($lang->postbit_currently_ignoring_user, $post['username']); eval("\$ignore_bit = \"".$templates->get("postbit_ignored")."\";");
|
Zeile 652 | Zeile 674 |
---|
$validationcount = 0; $tcount = 0;
|
$validationcount = 0; $tcount = 0;
|
if(is_array($attachcache[$id]))
| if(isset($attachcache[$id]) && is_array($attachcache[$id]))
|
{ // This post has 1 or more attachments foreach($attachcache[$id] as $aid => $attachment) {
| { // This post has 1 or more attachments foreach($attachcache[$id] as $aid => $attachment) {
|