Zeile 291 | Zeile 291 |
---|
$post['starimage'] = $usergroup['starimage']; }
|
$post['starimage'] = $usergroup['starimage']; }
|
if($post['starimage'] && $post['stars'])
| $post['userstars'] = ''; if($post['starimage'] && isset($post['stars']))
|
{ // 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) { eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
| for($i = 0; $i < $post['stars']; ++$i) { eval("\$post['userstars'] .= \"".$templates->get("postbit_userstar", 1, 0)."\";");
|
Zeile 416 | Zeile 416 |
---|
if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid'])) { eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer')."\";");
|
if($post_type != 3 && $post_type != 1 && purgespammer_show($post['postnum'], $post['usergroup'], $post['uid'])) { eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer')."\";");
|
| }
if(!isset($profile_fields)) { $profile_fields = array();
// Fetch profile fields to display $pfcache = $cache->read('profilefields'); if(is_array($pfcache)) { foreach($pfcache as $profilefield) { if($profilefield['postbit'] != 1) { continue; } $profile_fields[$profilefield['fid']] = $profilefield; } }
|
}
// Display profile fields on posts - only if field is filled in
|
}
// Display profile fields on posts - only if field is filled in
|
if(is_array($profile_fields))
| $post['profilefield'] = ''; if(!empty($profile_fields))
|
{ foreach($profile_fields as $field) {
| { foreach($profile_fields as $field) {
|
Zeile 428 | Zeile 450 |
---|
{ $post['fieldvalue'] = ''; $post['fieldname'] = htmlspecialchars_uni($field['name']);
|
{ $post['fieldvalue'] = ''; $post['fieldname'] = htmlspecialchars_uni($field['name']);
|
|
|
$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")) {
|
if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox")) {
|
| $post['fieldvalue_option'] = '';
|
foreach($useropts as $val) { if($val != '')
| foreach($useropts as $val) { if($val != '')
|
Zeile 459 | Zeile 483 |
---|
"filter_badwords" => 1 );
|
"filter_badwords" => 1 );
|
if($customfield['type'] == "textarea")
| if($field['type'] == "textarea")
|
{ $field_parser_options['me_username'] = $post['username']; }
| { $field_parser_options['me_username'] = $post['username']; }
|
Zeile 468 | Zeile 492 |
---|
$field_parser_options['nl2br'] = 0; }
|
$field_parser_options['nl2br'] = 0; }
|
if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
|
{ $field_parser_options['allow_imgcode'] = 0; }
| { $field_parser_options['allow_imgcode'] = 0; }
|
Zeile 549 | Zeile 573 |
---|
}
// Figure out if we need to show an "edited by" message
|
}
// 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)))
| if($post['edituid'] != 0 && $post['edittime'] != 0 && $post['editusername'] != "" && ($mybb->settings['showeditedby'] != 0 && $usergroup['cancp'] == 0 && !is_moderator($post['fid'], "", $post['uid']) || ($mybb->settings['showeditedbyadmin'] != 0 && ($usergroup['cancp'] == 1 || is_moderator($post['fid'], "", $post['uid'])))))
|
{ $post['editdate'] = my_date('relative', $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);
| { $post['editdate'] = my_date('relative', $post['edittime']); $post['editnote'] = $lang->sprintf($lang->postbit_edited, $post['editdate']);
|
Zeile 658 | Zeile 682 |
---|
if($post['visible'] == 0) { $invisiblepost = 1;
|
if($post['visible'] == 0) { $invisiblepost = 1;
|
} } else
| } } else
|
{ $post['inlinecheck'] = ""; }
| { $post['inlinecheck'] = ""; }
|
Zeile 669 | Zeile 693 |
---|
eval("\$post['posturl'] = \"".$templates->get("postbit_posturl")."\";"); global $forum, $thread;
|
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'] || empty($forumpermissions['canonlyreplyownthreads'])))
|
{ eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";"); }
|
{ 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)
| if($forumpermissions['canpostreplys'] != 0 && ($thread['uid'] == $mybb->user['uid'] || empty($forumpermissions['canonlyreplyownthreads'])) && ($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_multiquote'] = \"".$templates->get("postbit_multiquote")."\";"); }
|
Zeile 696 | Zeile 720 |
---|
} } elseif($post_type == 3) // announcement
|
} } elseif($post_type == 3) // announcement
|
{
| {
|
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanageannounce'] == 1 && is_moderator($fid, "canmanageannouncements")) { eval("\$post['button_edit'] = \"".$templates->get("announcement_edit")."\";"); eval("\$post['button_quickdelete'] = \"".$templates->get("announcement_quickdelete")."\";"); }
|
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanageannounce'] == 1 && is_moderator($fid, "canmanageannouncements")) { eval("\$post['button_edit'] = \"".$templates->get("announcement_edit")."\";"); eval("\$post['button_quickdelete'] = \"".$templates->get("announcement_quickdelete")."\";"); }
|
}
| }
|
$post['iplogged'] = ''; $show_ips = $mybb->settings['logip'];
|
$post['iplogged'] = ''; $show_ips = $mybb->settings['logip'];
|
$ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));
|
|
// Show post IP addresses... PMs now can have IP addresses too as of 1.8! if($post_type == 2)
|
// Show post IP addresses... PMs now can have IP addresses too as of 1.8! if($post_type == 2)
|
{
| {
|
$show_ips = $mybb->settings['showpmip']; } if(!$post_type || $post_type == 2) { if($show_ips != "no" && !empty($post['ipaddress'])) {
|
$show_ips = $mybb->settings['showpmip']; } if(!$post_type || $post_type == 2) { if($show_ips != "no" && !empty($post['ipaddress'])) {
|
| $ipaddress = my_inet_ntop($db->unescape_binary($post['ipaddress']));
|
if($show_ips == "show") { eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");
| if($show_ips == "show") { eval("\$post['iplogged'] = \"".$templates->get("postbit_iplogged_show")."\";");
|
Zeile 765 | Zeile 790 |
---|
$parser_options['allow_smilies'] = 0; }
|
$parser_options['allow_smilies'] = 0; }
|
if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
|
{ $parser_options['allow_imgcode'] = 0; }
|
{ $parser_options['allow_imgcode'] = 0; }
|
if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
|
{ $parser_options['allow_videocode'] = 0; }
| { $parser_options['allow_videocode'] = 0; }
|
Zeile 808 | Zeile 833 |
---|
$sig_parser['nofollow_on'] = 1; }
|
$sig_parser['nofollow_on'] = 1; }
|
if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
|
{ $sig_parser['allow_imgcode'] = 0; }
| { $sig_parser['allow_imgcode'] = 0; }
|
Zeile 824 | Zeile 849 |
---|
$icon_cache = $cache->read("posticons");
if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])
|
$icon_cache = $cache->read("posticons");
if(isset($post['icon']) && $post['icon'] > 0 && $icon_cache[$post['icon']])
|
{
| {
|
$icon = $icon_cache[$post['icon']];
$icon['path'] = htmlspecialchars_uni($icon['path']); $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']); eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");
|
$icon = $icon_cache[$post['icon']];
$icon['path'] = htmlspecialchars_uni($icon['path']); $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']); eval("\$post['icon'] = \"".$templates->get("postbit_icon")."\";");
|
} else {
| } else {
|
$post['icon'] = ""; }
| $post['icon'] = ""; }
|
Zeile 853 | Zeile 878 |
---|
$post = $plugins->run_hooks("postbit", $post);
if(!isset($ignored_users))
|
$post = $plugins->run_hooks("postbit", $post);
if(!isset($ignored_users))
|
{
| {
|
$ignored_users = array(); if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "") {
| $ignored_users = array(); if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "") {
|
Zeile 863 | Zeile 888 |
---|
$ignored_users[$uid] = 1; } }
|
$ignored_users[$uid] = 1; } }
|
}
| }
|
// Has this post been deleted but can be viewed? Hide this post if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted"))
| // Has this post been deleted but can be viewed? Hide this post if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted"))
|
Zeile 891 | Zeile 916 |
---|
break; }
|
break; }
|
if($forumpermissions['canviewdeletionnotice'] == 1 && $post['visible'] == -1 && $post_type == 0 && !is_moderator($fid, "canviewdeleted"))
| if($post_type == 0 && $forumpermissions['canviewdeletionnotice'] == 1 && $post['visible'] == -1 && !is_moderator($fid, "canviewdeleted"))
|
{ eval("\$postbit = \"".$templates->get("postbit_deleted_member")."\";");
|
{ eval("\$postbit = \"".$templates->get("postbit_deleted_member")."\";");
|
}
| }
|
else { if($mybb->settings['postlayout'] == "classic")
|
else { if($mybb->settings['postlayout'] == "classic")
|
{
| {
|
eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
|
eval("\$postbit = \"".$templates->get("postbit_classic")."\";");
|
}
| }
|
else { eval("\$postbit = \"".$templates->get("postbit")."\";");
|
else { eval("\$postbit = \"".$templates->get("postbit")."\";");
|
} }
| } }
|
$GLOBALS['post'] = "";
| $GLOBALS['post'] = "";
|
Zeile 993 | Zeile 1018 |
---|
} 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")."\";");
| if ($forumpermissions['candlattachments']) { eval("\$post['imagelist'] .= \"".$templates->get("postbit_attachments_images_image")."\";"); } else { eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";"); if($tcount == 5) { $thumblist .= "<br />"; $tcount = 0; } ++$tcount; }
|
} else { eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment")."\";"); } }
|
} else { eval("\$post['attachmentlist'] .= \"".$templates->get("postbit_attachments_attachment")."\";"); } }
|
} else {
| } else {
|
$validationcount++; } }
| $validationcount++; } }
|
Zeile 1011 | Zeile 1049 |
---|
if($validationcount == 1) { $postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;
|
if($validationcount == 1) { $postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;
|
}
| }
|
else { $postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);
| else { $postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);
|
Zeile 1029 | Zeile 1067 |
---|
if($post['imagelist']) { eval("\$post['attachedimages'] = \"".$templates->get("postbit_attachments_images")."\";");
|
if($post['imagelist']) { eval("\$post['attachedimages'] = \"".$templates->get("postbit_attachments_images")."\";");
|
}
| }
|
else
|
else
|
{
| {
|
$post['attachedimages'] = '';
|
$post['attachedimages'] = '';
|
}
| }
|
if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist']) { eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";");
|
if($post['attachmentlist'] || $post['thumblist'] || $post['imagelist']) { eval("\$post['attachments'] = \"".$templates->get("postbit_attachments")."\";");
|
} }
| } }
|
}
/**
| }
/**
|
Zeile 1055 | Zeile 1093 |
---|
}
$last = strtolower($val[strlen($val)-1]);
|
}
$last = strtolower($val[strlen($val)-1]);
|
| $val = intval($val);
|
switch($last)
|
switch($last)
|
{
| {
|
case 'g':
|
case 'g':
|
$val *= 1024;
| $val *= 1024;
|
case 'm':
|
case 'm':
|
$val *= 1024;
| $val *= 1024;
|
case 'k': $val *= 1024;
|
case 'k': $val *= 1024;
|
}
| }
return $val; }
/** * Detects whether an attachment removal/approval/unapproval * submit button was pressed (without triggering an AJAX request) * and sets inputs accordingly (as for an AJAX request). */ function detect_attachmentact() { global $mybb;
|
|
|
return intval($val);
| foreach($mybb->input as $key => $val) { if(strpos($key, 'rem_') === 0) { $mybb->input['attachmentaid'] = (int)substr($key, 4); $mybb->input['attachmentact'] = 'remove'; break; } elseif(strpos($key, 'approveattach_') === 0) { $mybb->input['attachmentaid'] = (int)substr($key, 14); $mybb->input['attachmentact'] = 'approve'; break; } elseif(strpos($key, 'unapproveattach_') === 0) { $mybb->input['attachmentaid'] = (int)substr($key, 16); $mybb->input['attachmentact'] = 'unapprove'; break; } }
|
}
| }
|