Advertisement
Guest User

Untitled

a guest
Mar 20th, 2012
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. /*======================================*\
  2. || #################################### ||
  3. || # Post Thank You Hack version 7.83 # ||
  4. || # Original version by Abe1 # ||
  5. || # Updated by Phaedrus # ||
  6. || #################################### ||
  7. \*======================================*/
  8. var post_thanks_handleSuccess = function(o)
  9. {
  10. if(o.responseText !== undefined)
  11. {
  12. if (post_thanks_callback.object_name[o.tId] !== undefined)
  13. {
  14. fetch_object(post_thanks_callback.object_name[o.tId]).innerHTML = o.responseText;
  15. }
  16. }
  17. }
  18. var post_thanks_handleFailure = function(o)
  19. {
  20. if(o.responseText !== undefined)
  21. {
  22. alert(o.responseText);
  23. }
  24. }
  25. var post_thanks_callback =
  26. {
  27. success: post_thanks_handleSuccess,
  28. failure: post_thanks_handleFailure,
  29. timeout: vB_Default_Timeout,
  30. cache: false,
  31. object_name: new Array()
  32. };
  33. function post_thanks_give(postid, integrate)
  34. {
  35. fetch_object('post_thanks_button_' + postid).style.display = 'none';
  36. fetch_object('post_thanks_separator_' + postid).style.display = 'none';
  37.  
  38. if (integrate == true)
  39. {
  40. fetch_object('post_groans_button_' + postid).style.display = 'none';
  41. }
  42.  
  43. var sUrl = 'post_thanks.php';
  44. var postData = 'do=post_thanks_add&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;
  45.  
  46. var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);
  47.  
  48. post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;
  49.  
  50. fetch_object('post_thanks_box_' + postid).style.display = '';
  51.  
  52. return false;
  53. }
  54. function post_thanks_remove_all(postid, integrate)
  55. {
  56. var sUrl = 'post_thanks.php';
  57. var postData = 'do=post_thanks_remove_all&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;
  58.  
  59. var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);
  60.  
  61. post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;
  62.  
  63. fetch_object('post_thanks_button_' + postid).style.display = ''
  64. fetch_object('post_thanks_separator_' + postid).style.display = '';
  65.  
  66. if (integrate == true)
  67. {
  68. fetch_object('post_groans_button_' + postid).style.display = '';
  69. }
  70.  
  71. fetch_object('post_thanks_box_' + postid).style.display = 'none';
  72.  
  73. return false;
  74. }
  75. function post_thanks_remove_user(postid, integrate)
  76. {
  77. var sUrl = 'post_thanks.php';
  78. var postData = 'do=post_thanks_remove_user&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;
  79.  
  80. var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_thanks_callback, postData);
  81.  
  82. post_thanks_callback.object_name[request.tId] = 'post_thanks_box_' + postid;
  83.  
  84. fetch_object('post_thanks_button_' + postid).style.display = ''
  85. fetch_object('post_thanks_separator_' + postid).style.display = '';
  86.  
  87. if (integrate == true)
  88. {
  89. fetch_object('post_groans_button_' + postid).style.display = '';
  90. }
  91.  
  92. fetch_object('post_thanks_box_' + postid).style.display = 'none';
  93.  
  94. return false;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement