REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 5 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Rep Fuck" Button
#21
The plugin looks cool man and the repfuck button only appears for admins only isn't it?
#22
This gave me a good laugh >.>
Nice job on the plug-in though. Very useful.
#23
Only admins and smods can see the repfuck button. And thank you to everyone for all the support and love <3
#24
(Jun 30, 2010, 08:39 AM)NeoFusion720 Wrote:
(Jun 30, 2010, 08:38 AM)88power88 Wrote: Sooo it just give's them -Rep -_- Fail

No, it removes all positive rep and adds -rep

ahh ok Wink
#25
If you add these 3 lines add the end, it will update the reputation count Smile

Code:
$query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
$reputation_value = $db->fetch_field($query, "reputation_count");
$db->update_query("users", array('reputation' => intval($reputation_value)), "uid='{$uid}'");

That way, when the page is refreshed, you can see the user's true rep!

All credits goto the MyBB crew, I just saw that while trying out some stuff Tongue
#26
(Jul 08, 2010, 08:49 PM)CometJack Wrote: If you add these 3 lines add the end, it will update the reputation count Smile

Code:
$query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
$reputation_value = $db->fetch_field($query, "reputation_count");
$db->update_query("users", array('reputation' => intval($reputation_value)), "uid='{$uid}'");

That way, when the page is refreshed, you can see the user's true rep!

All credits goto the MyBB crew, I just saw that while trying out some stuff Tongue

Thanks :] I was too lazy to figure out how to do it. Thanks mate.
#27
You're welcome Smile This is the one I edited for my site:
Code:
<?php
  
  define("IN_MYBB", 1);
  require_once "./global.php";

  //Credits to Boxxy for this mod, I (CometJack) just added some things :P
  
  $uid = intval($mybb->input['uid']);
  $user = mysql_fetch_array(mysql_query("SELECT * FROM `mybb_users` WHERE `uid` = '{$uid}'"));
  $username = $db->escape_string($user['username']);
  $imgdir = $db->escape_string($mybb->settings['bburl'] . '/' . $theme['imgdir']);
  
  if (!$user['uid']) {
      error($lang->add_no_uid);
  }
  
  if ($mybb->settings['enablereputation'] != 1) {
      error($lang->reputation_disabled);
  }
  
  if ($mybb->usergroup['canview'] != 1) {
      error_no_permission();
  }
  
  if ($mybb->user['usergroup'] != 4) {
      error_no_permission();
  } else {
      echo "<html>
<head>
<title>{$mybb->settings['bbname']} - RepFuck</title>
{$headerinclude}
</head>
<body onunload=\"window.opener.location.reload();\">
<br />
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">
  <tr>
    <td class=\"trow1\" style=\"padding: 20px\">
      <strong>{$vote_title}</strong><br /><br />
            <blockquote>{$username} has just been repfucked.</blockquote>
<center>                <script type=\"text/javascript\">
          <!--
            document.write('[<a href=\"javascript:window.close();\">Close Window</a>]');
          // -->
          </script></center>
                </td>
  </tr>
</table>
</body>
</html>";
      $db->query("DELETE FROM `" . TABLE_PREFIX . "reputation` WHERE uid=" . $uid . " ORDER BY `dateline` DESC");
      $db->query("INSERT INTO `" . TABLE_PREFIX . "reputation` (`uid`, `adduid`, `reputation`, `dateline`, `comments`) VALUES ('" . $uid . "', '" . 0 . "', '-25', '" . TIME_NOW . "', '[img]{$imgdir}/repfuck.png[/img]')");
      $query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
      $reputation_value = $db->fetch_field($query, "reputation_count");
      $db->update_query("users", array('reputation' => intval($reputation_value)), "uid='{$uid}'");
  }
?>

I then noticed that images aren't allowed to be displayed in reputation so the repfuck image didn't work. You can remove it Smile

Also I put 0 for the user ID so it's anonymous and no-one knows who did it Smile
#28
Boxxy start adding readme.txt in side of the plugin folder itself. Some people just download lol
#29
(Jul 09, 2010, 12:08 PM)CometJack Wrote: You're welcome Smile This is the one I edited for my site:
Code:
<?php
  
  define("IN_MYBB", 1);
  require_once "./global.php";

  //Credits to Boxxy for this mod, I (CometJack) just added some things :P
  
  $uid = intval($mybb->input['uid']);
  $user = mysql_fetch_array(mysql_query("SELECT * FROM `mybb_users` WHERE `uid` = '{$uid}'"));
  $username = $db->escape_string($user['username']);
  $imgdir = $db->escape_string($mybb->settings['bburl'] . '/' . $theme['imgdir']);
  
  if (!$user['uid']) {
      error($lang->add_no_uid);
  }
  
  if ($mybb->settings['enablereputation'] != 1) {
      error($lang->reputation_disabled);
  }
  
  if ($mybb->usergroup['canview'] != 1) {
      error_no_permission();
  }
  
  if ($mybb->user['usergroup'] != 4) {
      error_no_permission();
  } else {
      echo "<html>
<head>
<title>{$mybb->settings['bbname']} - RepFuck</title>
{$headerinclude}
</head>
<body onunload=\"window.opener.location.reload();\">
<br />
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">
  <tr>
    <td class=\"trow1\" style=\"padding: 20px\">
      <strong>{$vote_title}</strong><br /><br />
            <blockquote>{$username} has just been repfucked.</blockquote>
<center>                <script type=\"text/javascript\">
          <!--
            document.write('[<a href=\"javascript:window.close();\">Close Window</a>]');
          // -->
          </script></center>
                </td>
  </tr>
</table>
</body>
</html>";
      $db->query("DELETE FROM `" . TABLE_PREFIX . "reputation` WHERE uid=" . $uid . " ORDER BY `dateline` DESC");
      $db->query("INSERT INTO `" . TABLE_PREFIX . "reputation` (`uid`, `adduid`, `reputation`, `dateline`, `comments`) VALUES ('" . $uid . "', '" . 0 . "', '-25', '" . TIME_NOW . "', '[img]{$imgdir}/repfuck.png[/img]')");
      $query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
      $reputation_value = $db->fetch_field($query, "reputation_count");
      $db->update_query("users", array('reputation' => intval($reputation_value)), "uid='{$uid}'");
  }
?>

I then noticed that images aren't allowed to be displayed in reputation so the repfuck image didn't work. You can remove it Smile

Also I put 0 for the user ID so it's anonymous and no-one knows who did it Smile
I thought about putting the UID to 0, but then thought that would cause problems as if let's say, you were part of my forum, and you were popular, and had +800 rep, and someone accidentally repfucked you, No one would take responsibility, this way the person looks twice before hitting the rep fuck button, because it could cost them staff.

About the image, you could put it in using HTML tags?


(Jul 10, 2010, 12:14 AM)Snooopy` Wrote: Boxxy start adding readme.txt in side of the plugin folder itself. Some people just download lol

But then people wouldn't read my post Tongue
#30
Haha ya readme.txt takes to long to make haha

Just kidding, great as always boxxy!


Possibly Related Threads...
Thread Author Replies Views Last Post
  does qany 1 know how to change how much rep u can give nottzlad 5 5,068 Sep 19, 2010, 08:46 PM
Last Post: nottzlad
  [1.4] Social Sharing Button Plugin for Mybb1.4 jnd52 11 8,489 May 06, 2010, 08:26 PM
Last Post: MarkWesley
  Neg Rep Control labrocca 14 9,391 Sep 02, 2009, 05:54 AM
Last Post: SimplyGorgeous

Forum Jump:


Users browsing this thread: 1 Guest(s)