Zeile 102 | Zeile 102 |
---|
if($mybb->settings['postrep'] != 1) { $mybb->input['pid'] = 0;
|
if($mybb->settings['postrep'] != 1) { $mybb->input['pid'] = 0;
|
}
// Check if this user has reached their "maximum reputations per day" quota if($mybb->usergroup['maxreputationsday'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete'])))) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND dateline>'$timesearch'"); $numtoday = $db->num_rows($query);
// Reached the quota - error. if($numtoday >= $mybb->usergroup['maxreputationsday']) { $message = $lang->add_maxperday; if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error; exit; } }
// Is the user giving too much reputation to another? if($mybb->usergroup['maxreputationsperuser'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete'])))) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->simple_select("reputation", "*", "uid='".$uid."' AND dateline>'$timesearch'"); $numtoday = $db->num_rows($query);
if($numtoday >= $mybb->usergroup['maxreputationsperuser']) { $message = $lang->add_maxperuser; if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error; exit; }
| |
}
if($mybb->get_input('pid', MyBB::INPUT_INT))
| }
if($mybb->get_input('pid', MyBB::INPUT_INT))
|
Zeile 160 | Zeile 113 |
---|
$thread = get_thread($post['tid']); $forum = get_forum($thread['fid']); $forumpermissions = forum_permissions($forum['fid']);
|
$thread = get_thread($post['tid']); $forum = get_forum($thread['fid']); $forumpermissions = forum_permissions($forum['fid']);
|
|
|
// Post doesn't belong to that user or isn't visible
|
// Post doesn't belong to that user or isn't visible
|
if($uid != $post['uid'] || ($post['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || $post['visible'] < 0) { $mybb->input['pid'] = 0; } // Thread isn't visible elseif(($thread['visible'] == 0 && !is_moderator($forum['fid'], "canviewunapprove")) || $thread['visible'] < 0)
| if($uid != $post['uid'] || $post['visible'] != 1)
|
{
|
{
|
$mybb->input['pid'] = 0; }
| $mybb->input['pid'] = 0; }
// Thread isn't visible elseif($thread['visible'] != 1) { $mybb->input['pid'] = 0; }
|
// Current user can't see the forum elseif($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1) { $mybb->input['pid'] = 0; }
|
// Current user can't see the forum elseif($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1) { $mybb->input['pid'] = 0; }
|
|
|
// Current user can't see that thread elseif(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) { $mybb->input['pid'] = 0; }
|
// Current user can't see that thread elseif(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) { $mybb->input['pid'] = 0; }
|
else // We have the correct post, but has the user given too much reputation to another in the same thread? if($mybb->usergroup['maxreputationsperthread'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete'])))) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->query(" SELECT COUNT(p.pid) AS posts FROM ".TABLE_PREFIX."reputation r LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid = r.pid) WHERE r.uid = '{$uid}' AND r.adduid = '{$mybb->user['uid']}' AND p.tid = '{$post['tid']}' AND r.dateline > '{$timesearch}' ");
$numtoday = $db->fetch_field($query, 'posts');
if($numtoday >= $mybb->usergroup['maxreputationsperthread']) { $message = $lang->add_maxperthread; if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error; exit; } } }
| }
|
else
|
else
|
{ $mybb->input['pid'] = 0; } }
| { $mybb->input['pid'] = 0; } }
|
$rid = 0;
// Fetch the existing reputation for this user given by our current user if there is one.
| $rid = 0;
// Fetch the existing reputation for this user given by our current user if there is one.
|
Zeile 233 | Zeile 161 |
---|
$existing_reputation = $db->fetch_array($query); $rid = $existing_reputation['rid']; $was_post = true;
|
$existing_reputation = $db->fetch_array($query); $rid = $existing_reputation['rid']; $was_post = true;
|
| }
if($rid == 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete'])))) { $message = '';
// Check if this user has reached their "maximum reputations per day" quota if($mybb->usergroup['maxreputationsday'] != 0) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->simple_select("reputation", "*", "adduid='{$mybb->user['uid']}' AND dateline>'$timesearch'"); $numtoday = $db->num_rows($query);
// Reached the quota - error. if($numtoday >= $mybb->usergroup['maxreputationsday']) { $message = $lang->add_maxperday; } }
// Is the user giving too much reputation to another? if(!$message && $mybb->usergroup['maxreputationsperuser'] != 0) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->simple_select("reputation", "*", "uid='{$uid}' AND adduid='{$mybb->user['uid']}' AND dateline>'$timesearch'"); $numtoday = $db->num_rows($query);
if($numtoday >= $mybb->usergroup['maxreputationsperuser']) { $message = $lang->add_maxperuser; } }
// We have the correct post, but has the user given too much reputation to another in the same thread? if(!$message && $was_post && $mybb->usergroup['maxreputationsperthread'] != 0) { $timesearch = TIME_NOW - (60 * 60 * 24); $query = $db->query(" SELECT COUNT(p.pid) AS posts FROM ".TABLE_PREFIX."reputation r LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid = r.pid) WHERE r.uid = '{$uid}' AND r.adduid = '{$mybb->user['uid']}' AND p.tid = '{$post['tid']}' AND r.dateline > '{$timesearch}' ");
$numtoday = $db->fetch_field($query, 'posts');
if($numtoday >= $mybb->usergroup['maxreputationsperthread']) { $message = $lang->add_maxperthread; } }
if($message) { if($mybb->input['nomodal']) { eval('$error = "'.$templates->get("reputation_add_error_nomodal", 1, 0).'";'); } else { eval('$error = "'.$templates->get("reputation_add_error", 1, 0).'";'); } echo $error; exit; }
|
} }
| } }
|
Zeile 254 | Zeile 247 |
---|
if($mybb->usergroup['issupermod'] != 1 && ($mybb->usergroup['candeletereputations'] != 1 || $existing_reputation['adduid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0)) { error_no_permission();
|
if($mybb->usergroup['issupermod'] != 1 && ($mybb->usergroup['candeletereputations'] != 1 || $existing_reputation['adduid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0)) { error_no_permission();
|
}
| }
|
if($mybb->get_input('pid', MyBB::INPUT_INT) != 0) { $db->delete_query("reputation", "uid='{$uid}' AND adduid='".$mybb->user['uid']."' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
| if($mybb->get_input('pid', MyBB::INPUT_INT) != 0) { $db->delete_query("reputation", "uid='{$uid}' AND adduid='".$mybb->user['uid']."' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
|
Zeile 279 | Zeile 272 |
---|
if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0) { $message = $lang->add_no_comment;
|
if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0) { $message = $lang->add_no_comment;
|
if($mybb->input['nomodal']) {
| if($mybb->input['nomodal']) {
|
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
|
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
|
}
| }
|
else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
| else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
|
Zeile 293 | Zeile 286 |
---|
// The power for the reputation they specified was invalid. if($reputation > $mybb->usergroup['reputationpower'])
|
// The power for the reputation they specified was invalid. if($reputation > $mybb->usergroup['reputationpower'])
|
{
| {
|
$message = $lang->add_invalidpower;
|
$message = $lang->add_invalidpower;
|
if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error; exit; }
// The user is trying to give a negative reputation, but negative reps have been disabled. if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1) { $message = $lang->add_negative_disabled;
| if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error; exit; }
// The user is trying to give a negative reputation, but negative reps have been disabled. if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1) { $message = $lang->add_negative_disabled;
|
if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
| if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
|
Zeile 327 | Zeile 320 |
---|
if($mybb->get_input('reputation', MyBB::INPUT_INT) == 0 && $mybb->settings['neurep'] != 1) { $message = $lang->add_neutral_disabled;
|
if($mybb->get_input('reputation', MyBB::INPUT_INT) == 0 && $mybb->settings['neurep'] != 1) { $message = $lang->add_neutral_disabled;
|
if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else {
| if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); } else {
|
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error;
| eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";"); } echo $error;
|
Zeile 343 | Zeile 336 |
---|
if($mybb->get_input('reputation', MyBB::INPUT_INT) > 0 && $mybb->settings['posrep'] != 1) { $message = $lang->add_positive_disabled;
|
if($mybb->get_input('reputation', MyBB::INPUT_INT) > 0 && $mybb->settings['posrep'] != 1) { $message = $lang->add_positive_disabled;
|
if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
| if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
|
} else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
|
} else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
|
}
| }
|
echo $error; exit; }
| echo $error; exit; }
|
Zeile 359 | Zeile 352 |
---|
if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength']) { $message = $lang->sprintf($lang->add_toolong, $mybb->settings['maxreplength']);
|
if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength']) { $message = $lang->sprintf($lang->add_toolong, $mybb->settings['maxreplength']);
|
if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); }
| if($mybb->input['nomodal']) { eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";"); }
|
else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
| else { eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
|
Zeile 422 | Zeile 415 |
---|
$plugins->run_hooks("reputation_add_start");
// If we have an existing reputation for this user, the user can modify or delete it.
|
$plugins->run_hooks("reputation_add_start");
// If we have an existing reputation for this user, the user can modify or delete it.
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
if(!empty($existing_reputation['uid'])) { $vote_title = $lang->sprintf($lang->update_reputation_vote, $user['username']);
| if(!empty($existing_reputation['uid'])) { $vote_title = $lang->sprintf($lang->update_reputation_vote, $user['username']);
|
Zeile 578 | Zeile 572 |
---|
error($lang->reputations_disabled_group); }
|
error($lang->reputations_disabled_group); }
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']); $lang->reputation_report = $lang->sprintf($lang->reputation_report, $user['username']);
| $lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']); $lang->reputation_report = $lang->sprintf($lang->reputation_report, $user['username']);
|
Zeile 895 | Zeile 890 |
---|
if($unviewable) { $sql[] = "p.fid NOT IN ({$unviewable})";
|
if($unviewable) { $sql[] = "p.fid NOT IN ({$unviewable})";
|
}
| }
|
// get inactive forums $inactive = get_inactive_forums(); if($inactive) { $sql[] = "p.fid NOT IN ({$inactive})";
|
// get inactive forums $inactive = get_inactive_forums(); if($inactive) { $sql[] = "p.fid NOT IN ({$inactive})";
|
}
| }
|
if(!$mybb->user['ismoderator']) { $sql[] = "p.visible='1'"; $sql[] = "t.visible='1'";
|
if(!$mybb->user['ismoderator']) { $sql[] = "p.visible='1'"; $sql[] = "t.visible='1'";
|
}
$sql = implode(' AND ', $sql);
| }
$sql = implode(' AND ', $sql);
|
$query = $db->query(" SELECT p.pid, p.uid, p.fid, p.visible, p.message, t.tid, t.subject, t.visible AS thread_visible
| $query = $db->query(" SELECT p.pid, p.uid, p.fid, p.visible, p.message, t.tid, t.subject, t.visible AS thread_visible
|
Zeile 918 | Zeile 913 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE {$sql} ");
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE {$sql} ");
|
|
|
$forumpermissions = array();
while($post = $db->fetch_array($query))
|
$forumpermissions = array();
while($post = $db->fetch_array($query))
|
{
| {
|
if(($post['visible'] == 0 || $post['thread_visible'] == 0) && !is_moderator($post['fid'], 'canviewunapprove'))
|
if(($post['visible'] == 0 || $post['thread_visible'] == 0) && !is_moderator($post['fid'], 'canviewunapprove'))
|
{ continue; }
if(($post['visible'] == -1 || $post['thread_visible'] == -1) && !is_moderator($post['fid'], 'canviewdeleted'))
| { continue; }
if(($post['visible'] == -1 || $post['thread_visible'] == -1) && !is_moderator($post['fid'], 'canviewdeleted'))
|
{ continue; }
if(!isset($forumpermissions[$post['fid']]))
|
{ continue; }
if(!isset($forumpermissions[$post['fid']]))
|
{ $forumpermissions[$post['fid']] = forum_permissions($post['fid']);
| { $forumpermissions[$post['fid']] = forum_permissions($post['fid']);
|
}
// Make sure we can view this post
| }
// Make sure we can view this post
|
Zeile 962 | Zeile 957 |
---|
// Format the username of this poster if(!$reputation_vote['username'])
|
// Format the username of this poster if(!$reputation_vote['username'])
|
{
| {
|
$reputation_vote['username'] = $lang->na; $reputation_vote['user_reputation'] = ''; } else {
|
$reputation_vote['username'] = $lang->na; $reputation_vote['user_reputation'] = ''; } else {
|
$reputation_vote['username'] = format_name($reputation_vote['username'], $reputation_vote['user_usergroup'], $reputation_vote['user_displaygroup']);
| $reputation_vote['username'] = format_name(htmlspecialchars_uni($reputation_vote['username']), $reputation_vote['user_usergroup'], $reputation_vote['user_displaygroup']);
|
$reputation_vote['username'] = build_profile_link($reputation_vote['username'], $reputation_vote['uid']); $reputation_vote['user_reputation'] = "({$reputation_vote['user_reputation']})"; }
| $reputation_vote['username'] = build_profile_link($reputation_vote['username'], $reputation_vote['uid']); $reputation_vote['user_reputation'] = "({$reputation_vote['user_reputation']})"; }
|
Zeile 1003 | Zeile 998 |
---|
// Format the date this reputation was last modified $last_updated_date = my_date('relative', $reputation_vote['dateline']); $last_updated = $lang->sprintf($lang->last_updated, $last_updated_date);
|
// Format the date this reputation was last modified $last_updated_date = my_date('relative', $reputation_vote['dateline']); $last_updated = $lang->sprintf($lang->last_updated, $last_updated_date);
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
// Is this rating specific to a post? $postrep_given = '';
| // Is this rating specific to a post? $postrep_given = '';
|