Vergleich reputation.php - 1.2.1 - 1.2.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: reputation.php 2263 2006-09-26 09:24:25Z chris $

 * $Id: reputation.php 3030 2007-04-26 00:19:47Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 235Zeile 235
// Delete a specific reputation from a user.
if($mybb->input['action'] == "delete")
{

// Delete a specific reputation from a user.
if($mybb->input['action'] == "delete")
{

 
	// Fetch the existing reputation for this user given by our current user if there is one.
$query = $db->simple_select(TABLE_PREFIX."reputation", "*", "rid='".intval($mybb->input['rid'])."'");
$existing_reputation = $db->fetch_array($query);


	// Only administrators as well as users who gave a specifc vote can delete one.
if($mybb->usergroup['cancp'] != "yes" && $existing_reputation['adduid'] != $mybb->user['uid'])
{

	// Only administrators as well as users who gave a specifc vote can delete one.
if($mybb->usergroup['cancp'] != "yes" && $existing_reputation['adduid'] != $mybb->user['uid'])
{

Zeile 296Zeile 300

// If the user has permission to add reputations - show the image
if($mybb->usergroup['cangivereputations'] == "yes")


// If the user has permission to add reputations - show the image
if($mybb->usergroup['cangivereputations'] == "yes")

	{

	{

		eval("\$add_reputation = \"".$templates->get("reputation_addlink")."\";");
}
else

		eval("\$add_reputation = \"".$templates->get("reputation_addlink")."\";");
}
else

	{

	{

		$add_reputation = '';
}


		$add_reputation = '';
}


Zeile 327Zeile 331
		default:
$conditions = '';
$show_select['all'] = 'selected="selected"';

		default:
$conditions = '';
$show_select['all'] = 'selected="selected"';

			break;

			break;

	}

// Check the sorting options for the reputation list

	}

// Check the sorting options for the reputation list

Zeile 346Zeile 350
	// Fetch the total number of reputations for this user
$query = $db->simple_select(TABLE_PREFIX."reputation r", "COUNT(r.rid) AS reputation_count", "r.uid='{$user['uid']}' $conditions");
$reputation_count = $db->fetch_field($query, "reputation_count");

	// Fetch the total number of reputations for this user
$query = $db->simple_select(TABLE_PREFIX."reputation r", "COUNT(r.rid) AS reputation_count", "r.uid='{$user['uid']}' $conditions");
$reputation_count = $db->fetch_field($query, "reputation_count");





	// Set default count variables to 0
$positive_count = $negative_count = $neutral_count = 0;
$positive_week = $negative_week = $neutral_week = 0;

	// Set default count variables to 0
$positive_count = $negative_count = $neutral_count = 0;
$positive_week = $negative_week = $neutral_week = 0;

Zeile 357Zeile 361
	$last_week = time()-604800;
$last_month = time()-2678400;
$last_6months = time()-16070400;

	$last_week = time()-604800;
$last_month = time()-2678400;
$last_6months = time()-16070400;





	// Query reputations for the "reputation card"
$query = $db->simple_select(TABLE_PREFIX."reputation", "reputation, dateline", "uid='{$user['uid']}'");
while($reputation_vote = $db->fetch_array($query))
{
// This is a positive reputation
if($reputation_vote['reputation'] > 0)

	// Query reputations for the "reputation card"
$query = $db->simple_select(TABLE_PREFIX."reputation", "reputation, dateline", "uid='{$user['uid']}'");
while($reputation_vote = $db->fetch_array($query))
{
// This is a positive reputation
if($reputation_vote['reputation'] > 0)

		{

		{

			$positive_count++;

			$positive_count++;

			if($reputation_vote['dateline'] >= $last_week)
{

			if($reputation_vote['dateline'] >= $last_week)
{

				$positive_week++;
}

				$positive_week++;
}

			if($reputation_vote['dateline'] >= $last_month)
{
$positive_month++;
}
if($reputation_vote['dateline'] >= $last_6months)

			if($reputation_vote['dateline'] >= $last_month)
{
$positive_month++;
}
if($reputation_vote['dateline'] >= $last_6months)

			{
$positive_6months++;
}

			{
$positive_6months++;
}

Zeile 386Zeile 390
			if($reputation_vote['dateline'] >= $last_week)
{
$negative_week++;

			if($reputation_vote['dateline'] >= $last_week)
{
$negative_week++;

			}
if($reputation_vote['dateline'] >= $last_month)
{

			}
if($reputation_vote['dateline'] >= $last_month)
{

				$negative_month++;
}
if($reputation_vote['dateline'] >= $last_6months)

				$negative_month++;
}
if($reputation_vote['dateline'] >= $last_6months)

Zeile 479Zeile 483
		// Get the reputation for the user who posted this comment
if($reputation_vote['adduid'] == 0)
{

		// Get the reputation for the user who posted this comment
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']);

 
		if($reputation_vote['username'])
{
$reputation_vote['user_reputation'] = " <span class=\"smalltext\">({$reputation_vote['user_reputation']})";
}
else
{
$reputation_vote['user_reputation'] = '';
}


// Format the date this reputation was last modified
$last_updated_date = my_date($mybb->settings['dateformat'], $reputation_vote['dateline']);


// Format the date this reputation was last modified
$last_updated_date = my_date($mybb->settings['dateformat'], $reputation_vote['dateline']);