Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 1r5fsxal4mtcs dodana przez Hiroshima, 20.05.2012 18:11
super task
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131.
<?php if ( ! defined( 'IN_IPB' ) ) { print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit(); } class task_item { /** * Parent task manager class * * @access protected * @var object */ protected $class; /** * This task data * * @access protected * @var array */ protected $task = array(); /** * Prevent logging * * @access protected * @var boolean */ protected $restrict_log = false; /**#@+ * Registry Object Shortcuts * * @access protected * @var object */ protected $registry; protected $DB; protected $settings; protected $request; protected $lang; protected $member; protected $cache; /**#@-*/ /** * Constructor * * @access public * @param object ipsRegistry reference * @param object Parent task class * @param array This task data * @return void */ public function __construct( ipsRegistry $registry, $class, $task ) { /* Make registry objects */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->lang = $this->registry->getClass('class_localization'); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->class = $class; $this->task = $task; } /** * Run this task * * @access public * @return void */ public function runTask() { $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' ); $banned_group = ipsRegistry::$settings['banned_group']; $member_group = ipsRegistry::$settings['member_group']; $warn_max = ipsRegistry::$settings['warn_max']; $sqla = "UPDATE `" .$prefix."ipb_members` SET `member_group_id`='".$banned_group."' WHERE (`member_group_id`<>'".$banned_group."' AND `warn_level`>'".($warn_max-1)."')"; $qa = $this->DB->query($sqla); $numa = $this->DB->getAffectedRows(); $sqlb = "UPDATE `" .$prefix."ipb_members` SET `member_banned`='1' WHERE (`member_group_id`='".$banned_group."' AND `member_banned`<>'1')"; $qb = $this->DB->query($sqlb); $numb = $this->DB->getAffectedRows(); $sqlc = "UPDATE `" .$prefix."ipb_members` SET `warn_level`='".$warn_max."' WHERE (`member_group_id`='".$banned_group."' AND `member_banned`='1' AND ( `warn_level`<'".$warn_max."' OR ISNULL( `warn_level` ) ) )"; $qc = $this->DB->query($sqlc); $numc = $this->DB->getAffectedRows(); $sqld = "UPDATE `" .$prefix."ipb_profile_portal` LEFT JOIN `" .$prefix."ipb_members` ON ( `pp_member_id` = `member_id` ) SET `pp_about_me`='', `signature`='' WHERE (`member_group_id`='".$banned_group."' AND `member_banned`='1' )"; $qd = $this->DB->query($sqld); $numd = $this->DB->getAffectedRows(); //die(var_dump($sqla, $sqlb, $sqlc)); /*$sql2a = "UPDATE `" .$prefix."ipb_members` SET `member_group_id`='".$member_group."' WHERE (`warn_level`<'".$warn_max."' AND `member_group_id`='".$banned_group."')"; $q2a = $this->DB->query($sql2a); $num2a = $this->DB->getAffectedRows(); $sql2b = "UPDATE `" .$prefix."ipb_members` SET `member_banned`='0' WHERE (`member_banned`='1' AND `member_group_id`<>'".$banned_group."')"; $q2b = $this->DB->query($sql2b); $num2b = $this->DB->getAffectedRows();*/ if ($numa>0 || $numb>0 || $numc>0 || $numd>0) { $log = 'Banned: +('.$numa.', '.$numb.', '.$numc.', '.$numd.')'; //$log = 'Banned: +('.$numa.', '.$numb.') -('.$num2a.', '.$num2b.')'; //$log = 'Banned: +'.$num.' -'.$num2; $this->class->appendTaskLog( $this->task, $log ); //$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_removevalidating'], count($mids) ) ); } //----------------------------------------- // Unlock Task: DO NOT MODIFY! //----------------------------------------- $this->class->unlockTask( $this->task ); } }
Dodanych wklejek: 12215
Powered By (Pav32) Pastebin © 2011