Advertisement
Guest User

Reputation Log

a guest
Sep 16th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.32 KB | None | 0 0
  1. <?php
  2. /*
  3. MAde by Believer from Nulledbb.com - Galaxy...
  4. Please do not share to anyone ;)
  5. */
  6. define('IN_MYBB', 1);
  7. require "global.php";
  8. global $db, $headerinclude, $header, $theme, $footer;
  9. $rlq = $db->simple_select("reputation", "uid, reputation, adduid, dateline, comments", "uid", array("order_by" => 'dateline', "order_dir" => 'DESC'));
  10.  
  11. $query = $db->simple_select("reputation", "COUNT(*) AS totalreps");
  12.     $totalreps = $db->fetch_field($query, "totalreps");
  13.  
  14. $nobans = "
  15. <tr>
  16. <td colspan='5' align='center' valign='middle' class='trow1'>There are no Reputation Logs</td>
  17. </tr>";
  18. if($db->num_rows($rlq) != 0)
  19.     {
  20.             $replogl = "";
  21.         while($rlqv = $db->fetch_array($rlq))
  22.         {
  23.             $r_uid = $rlqv['uid'];
  24.             $r_adduid = $rlqv['adduid'];
  25.             $r_comments = $rlqv['comments'];
  26.             $r_date = my_date('relative', $rlqv['dateline']);
  27.             $r_reputation = $rlqv['reputation'];
  28.             $getname = $db->query("SELECT username FROM ".TABLE_PREFIX."users WHERE uid='".(int)$r_uid."'");
  29.             $fetchn = $db->fetch_array($getname);
  30.             $name = $fetchn['username'];           
  31.             $getnamea = $db->query("SELECT username FROM ".TABLE_PREFIX."users WHERE uid='".(int)$r_adduid."'");
  32.             $fetchna = $db->fetch_array($getnamea);
  33.             $namea = $fetchna['username'];
  34. if ($rlqv['reputation'] == 0)   {
  35.     $r_reputation = "<div class=\"neutralrep\" style=\"text-align: center;\"><span>Neutral / 0</span></div>";
  36. }   elseif ($rlqv['reputation'] < 0) {
  37.     $r_reputation = "<div class=\"negativerep\" style=\"text-align: center;\"><span>$r_reputation</span></div>";
  38. }   elseif ($rlqv['reputation'] > 0) {
  39.     $r_reputation = "<div class=\"positiverep\" style=\"text-align: center;\">$r_reputation</span>";
  40. }  
  41.     $replogl .= '      
  42.   <tr>
  43. <td class="trow1"><span>'.$namea.'</span></td>
  44. <td class="trow1">'.$r_comments.'</td>
  45. <td class="trow1"><span>'.$name.'</span></td>
  46. <td class="trow1" align="left">'.$r_date.'</td>
  47. <td class="trow1" align="right" width="85">'.$r_reputation.'</td>
  48. </tr>      
  49.        ';
  50.         }          
  51.     }
  52.     else
  53.     {
  54.     $replogl = '<tr><td class="trow1" colspan="2" align="center">'. "None" .'</td></tr>';
  55.     }
  56. $template='<html>
  57. <head>
  58. <title>Reputation Log</title>
  59. {$headerinclude}
  60. </head>
  61. <style>
  62. .positiverep {
  63.    background-color: green;
  64.    color: white;
  65.    border: 1px solid green;
  66.    border-radius: 1px;
  67. }
  68. .negativerep {
  69.    background-color: red;
  70.    color: white;
  71.    border: 1px solid red;
  72.    border-radius: 1px;
  73. }
  74. .neutralrep{
  75.    background-color: rgba(0, 0, 0, 0.31);
  76.    color: white;
  77.    border: 1px solid rgba(0, 0, 0, 0.31);
  78.     border-radius: 1px;
  79. }
  80. </style>
  81. <body>
  82. {$header}
  83. <table border="0" cellspacing="0" cellpadding="10" width="100%" class="tborder">   
  84. <tbody><tr>
  85. <td colspan="5" class="thead"><strong>Reputation Log</strong><div style="background: rgba(37, 37, 37, 0.55); float: right;padding:  2px;border-radius: 2px;padding-right: 4px;padding-left: 4px;">Total rep - {$totalreps}</div>
  86. </td>
  87. </tr>
  88. </tbody><tbody>
  89. <tr>
  90. <td class="tcat">Username</td>
  91. <td class="tcat">Reason</td>
  92. <td class="tcat">Given</td>
  93. <td class="tcat" align="left">Date</td>
  94. <td class="tcat" align="center">Reputation</td>
  95. </tr>
  96. {$replogl}
  97.  </tbody>  
  98. </table>
  99. {$footer}
  100. </body>
  101. </html>';
  102. $template=str_replace("\'", "'", addslashes($template));
  103. eval("\$page=\"".$template."\";");
  104. output_page($page);
  105.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement