Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all articles
Browse latest Browse all 690

Most Reputations Page

$
0
0
Hi,

Step 1: Create a new file called mostreputations.php and paste this code into it:
<?php

/**
* Most Reputations Page
* Author: #Raptor
* Author's email: raptorsmailx@gmail.com
**/

define('IN_MYBB', 1);

require_once("global.php");

if($mybb->user['uid'] == 0)
error_no_permission();

add_breadcrumb("Most Reputations", $_SERVER['PHP_SELF']);

$sablon = '<html>
<head>
<title>Most Reputations</title>
{$headerinclude}
</head>
<body>
{$header}';

$liste = '<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
<tbody><tr>
<td class="thead" colspan="2"><strong>Most Reputations Page</strong></td>
</tr>
<tr>
<td class="tcat" width="50%"><strong>Username</strong></td>
<td class="tcat" width="50%"><strong>Reputation</strong></td>
</tr>';

$a = $db->simple_select('users', 'uid, username, usergroup, displaygroup, reputation', "reputation<>0 AND usergroup<>7", ['order_by' => 'reputation', 'order_dir' => 'desc', 'limit' => 100]);

while($cek = $db->fetch_array($a))
{
$kadi = format_name($cek['username'],$cek['usergroup'],$cek['displaygroup']);
$kid = $cek['uid'];
$rep = $cek['reputation'];
$url = $mybb->settings['bburl'];
$k = '<a href="'.$url.'/member.php?action=profile&uid='.$kid.'">'.$kadi.'</a>';
$r = '<div style="color:green;">'.$rep.'</div> <a href="'.$url.'/reputation.php?uid='.$kid.'">[Details]</a>';
$liste = $liste . '<tr>
<td class="trow1">'.$k.'</td>
<td class="trow1">'.$r.'</td>
</tr>';
}

$son = $liste . '</tbody></table>
{$footer}
</body>
</html>';

$sablon = $sablon . $son;

$sablon = str_replace("\'", "'", addslashes($sablon));
eval("\$page = \"" . $sablon . "\";");
output_page($page);

?>

Step 2: Upload the file to forum root.

Tested on MyBB 1.8 and works fine.

Screenshot:

[Image: ekrangoruntusu.png]

Viewing all articles
Browse latest Browse all 690

Trending Articles