"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/reputation.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

reputation.php  (mybb_1821):reputation.php  (mybb_1822)
skipping to change at line 868 skipping to change at line 868
$query = $db->query(" $query = $db->query("
SELECT r.*, r.uid AS rated_uid, u.uid, u.username, u.reputation A S user_reputation, u.usergroup AS user_usergroup, u.displaygroup AS user_display group SELECT r.*, r.uid AS rated_uid, u.uid, u.username, u.reputation A S user_reputation, u.usergroup AS user_usergroup, u.displaygroup AS user_display group
FROM ".TABLE_PREFIX."reputation r FROM ".TABLE_PREFIX."reputation r
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid)
WHERE r.uid='{$user['uid']}' $conditions WHERE r.uid='{$user['uid']}' $conditions
ORDER BY $order ORDER BY $order
LIMIT $start, {$perpage} LIMIT $start, {$perpage}
"); ");
// Gather a list of items that have post reputation // Gather a list of items that have post reputation
$reputation_cache = $post_cache = $post_reputation = array(); $reputation_cache = $post_cache = $post_reputation = $not_reportable = ar ray();
while($reputation_vote = $db->fetch_array($query)) while($reputation_vote = $db->fetch_array($query))
{ {
$reputation_cache[] = $reputation_vote; $reputation_cache[] = $reputation_vote;
// If this is a post, hold it and gather some information about i t // If this is a post, hold it and gather some information about i t
if($reputation_vote['pid'] && !isset($post_cache[$reputation_vote ['pid']])) if($reputation_vote['pid'] && !isset($post_cache[$reputation_vote ['pid']]))
{ {
$post_cache[$reputation_vote['pid']] = $reputation_vote[' pid']; $post_cache[$reputation_vote['pid']] = $reputation_vote[' pid'];
} }
skipping to change at line 946 skipping to change at line 946
if(isset($forumpermissions[$post['fid']]['canonlyviewownt hreads']) && $forumpermissions[$post['fid']]['canonlyviewownthreads'] == 1 && $p ost['uid'] != $mybb->user['uid']) if(isset($forumpermissions[$post['fid']]['canonlyviewownt hreads']) && $forumpermissions[$post['fid']]['canonlyviewownthreads'] == 1 && $p ost['uid'] != $mybb->user['uid'])
{ {
continue; continue;
} }
$post_reputation[$post['pid']] = $post; $post_reputation[$post['pid']] = $post;
} }
} }
$reputation_votes = ''; $reputation_votes = '';
if(!empty($reputation_cache) && $mybb->user['uid'] != 0)
{
$reputation_ids = implode(',', array_map('array_shift', $reputati
on_cache));
$query = $db->query("
SELECT id, reporters FROM ".TABLE_PREFIX."reportedcontent
WHERE reportstatus != '1' AND id IN (".$reputation_ids.") AND type = 'reputatio
n'
");
while($report = $db->fetch_array($query))
{
$reporters = my_unserialize($report['reporters']);
if(is_array($reporters) && in_array($mybb->user['uid'], $
reporters))
{
$not_reportable[] = $report['id'];
}
}
}
foreach($reputation_cache as $reputation_vote) foreach($reputation_cache as $reputation_vote)
{ {
// Get the reputation for the user who posted this comment // Get the reputation for the user who posted this comment
if($reputation_vote['adduid'] == 0) if($reputation_vote['adduid'] == 0)
{ {
$reputation_vote['user_reputation'] = 0; $reputation_vote['user_reputation'] = 0;
} }
$reputation_vote['user_reputation'] = get_reputation($reputation_ vote['user_reputation'], $reputation_vote['adduid']); $reputation_vote['user_reputation'] = get_reputation($reputation_ vote['user_reputation'], $reputation_vote['adduid']);
skipping to change at line 1028 skipping to change at line 1043
} }
// Does the current user have permission to delete this reputatio n? Show delete link // Does the current user have permission to delete this reputatio n? Show delete link
$delete_link = ''; $delete_link = '';
if($mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['cand eletereputations'] == 1 && $reputation_vote['adduid'] == $mybb->user['uid'] && $ mybb->user['uid'] != 0)) if($mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['cand eletereputations'] == 1 && $reputation_vote['adduid'] == $mybb->user['uid'] && $ mybb->user['uid'] != 0))
{ {
eval("\$delete_link = \"".$templates->get("reputation_vot e_delete")."\";"); eval("\$delete_link = \"".$templates->get("reputation_vot e_delete")."\";");
} }
$report_link = ''; $report_link = '';
if($mybb->user['uid'] != 0) if($mybb->user['uid'] != 0 && !in_array($reputation_vote['rid'], $not_reportable))
{ {
eval("\$report_link = \"".$templates->get("reputation_vot e_report")."\";"); eval("\$report_link = \"".$templates->get("reputation_vot e_report")."\";");
} }
// Parse smilies in the reputation vote // Parse smilies in the reputation vote
$reputation_parser = array( $reputation_parser = array(
"allow_html" => 0, "allow_html" => 0,
"allow_mycode" => 0, "allow_mycode" => 0,
"allow_smilies" => 1, "allow_smilies" => 1,
"allow_imgcode" => 0, "allow_imgcode" => 0,
 End of changes. 3 change blocks. 
2 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)