منتدى استراحات زايد

منتدى استراحات زايد (http://vb.ma7room.com/index.php)
-   منتدى أخبار المواقع والمنتديات العربية والأجنبية (http://vb.ma7room.com/forumdisplay.php?f=183)
-   -   Forum Maintenance Update User Titles and Ranks (http://vb.ma7room.com/showthread.php?t=1154119)

محروم.كوم 02-12-2013 02:30 AM

Forum Maintenance Update User Titles and Ranks
 
In maintenace when I update User Titles and Ranks I get the code displayed and nothing runs, is this a known bug in 4.0.8?


?php /*================================================= =====================*\ || ################################################## ################## || || # vBulletin 4.0.8 - Licence Number VBF94A2D38 || # ---------------------------------------------------------------- # || || # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. || || # This file may not be redistributed in whole or significant part. # || || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # || || #
Content Relevant URLs by vBSEO 3.5.2http://www.vbulletin.com | http://www.vbulletin.com/license.html # || || ################################################## ################## || \*================================================ ======================*/ /** * "Magic" Function that builds all the information regarding infractions * (only used in Cron) * * @param array Infraction Points Array * @param array Infractions Array * @param array Warnings Array * * @return boolean Whether infractions info was updated. * */ function build_user_infractions($points, $infractions, $warnings) { global $vbulletin; $warningsql = array(); $infractionsql = array(); $ipointssql = array(); $querysql = array(); $userids = array(); // ############################ WARNINGS ################################# $wa = array(); foreach($warnings AS $userid => $warning) { $wa["$warning"][] = $userid; $userids["$userid"] = $userid; } unset($warnings); foreach($wa AS $warning => $users) { $warningsql[] = "WHEN userid IN(" . implode(', ', $users) . ") THEN $warning"; } unset($wa); if (!empty($warningsql)) { $querysql[] = " warnings = CAST(warnings AS SIGNED) - CASE " . implode(" \r\n", $warningsql) . " ELSE 0 END"; } unset($warningsql); // ############################ INFRACTIONS ############################## $if = array(); foreach($infractions AS $userid => $infraction) { $if["$infraction"][] = $userid; $userids["$userid"] = $userid; } unset($infractions); foreach($if AS $infraction => $users) { $infractionsql[] = "WHEN userid IN(" . implode(', ', $users) . ") THEN $infraction"; } unset($if); if (!empty($infractionsql)) { $querysql[] = " infractions = CAST(infractions AS SIGNED) - CASE " . implode(" \r\n", $infractionsql) . " ELSE 0 END"; } unset($infractionsql); // ############################ POINTS ################################### $ip = array(); foreach($points AS $userid => $point) { $ip["$point"][] = $userid; } unset($points); foreach($ip AS $point => $users) { $ipointssql[] = "WHEN userid IN(" . implode(', ', $users) . ") THEN $point"; } unset($ip); if (!empty($ipointssql)) { $querysql[] = " ipoints = CAST(ipoints AS SIGNED) - CASE " . implode(" \r\n", $ipointssql) . " ELSE 0 END"; } unset($ipointssql); if (!empty($querysql)) { $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET " . implode(', ', $querysql) . " WHERE userid IN (" . implode(', ', $userids) . ") "); return true; } else { return false; } } /** * Builds infraction groups for users * * @param array User IDs to build * */ function build_infractiongroupids($userids) { global $vbulletin; static $infractiongroups = array(), $beenhere; if (!$beenhere) { $beenhere == true; $groups = $vbulletin->db->query_read_slave(" SELECT usergroupid, orusergroupid, pointlevel, override FROM " . TABLE_PREFIX . "infractiongroup ORDER BY pointlevel "); while ($group = $vbulletin->db->fetch_array($groups)) { $infractiongroups["$group[usergroupid]"]["$group[pointlevel]"][] = array( 'orusergroupid' => $group['orusergroupid'], 'override' => $group['override'], ); } } $users = $vbulletin->db->query_read(" SELECT user.* FROM " . TABLE_PREFIX . "user AS user WHERE userid IN (" . implode(', ', $userids) . ") "); while ($user = $vbulletin->db->fetch_array($users)) { $infractioninfo = fetch_infraction_groups($infractiongroups, $user['userid'], $user['ipoints'], $user['usergroupid']); if (($groupids = implode(',', $infractioninfo['infractiongroupids'])) != $user['infractiongroupids'] OR $infractioninfo['infractiongroupid'] != $user['infractiongroupid']) { $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD); $userdata->set_existing($user); $userdata->set('infractiongroupids', $groupids); $userdata->set('infractiongroupid', $infractioninfo['infractiongroupid']); $userdata->save(); } } } /** * Takes valid data and sets it as part of the data to be saved * * @param array List of infraction groups * @param integer Userid of user * @param integer Infraction Points * @param interger Usergroupid * * @return array User's final infraction groups */ function fetch_infraction_groups(&$infractiongroups, $userid, $ipoints, $usergroupid) { static $cache; if (!is_array($data)) { $data = array(); } $infractiongroupids = array(); if (!empty($infractiongroups["$usergroupid"])) { foreach($infractiongroups["$usergroupid"] AS $pointlevel => $orusergroupids) { if ($pointlevel query_read(" SELECT userid FROM " . TABLE_PREFIX . "user WHERE FIND_IN_SET('" . intval($override_groupid) . "', infractiongroupids) "); } else { $user_sql = $vbulletin->db->query_read(" SELECT userid FROM " . TABLE_PREFIX . "user WHERE FIND_IN_SET('" . intval($override_groupid) . "', infractiongroupids) OR (ipoints >= " . intval($point_level) . " " . ($applies_groupid != -1 ? "AND usergroupid = " . intval($applies_groupid) : '') . " ) "); } while ($user = $vbulletin->db->fetch_array($user_sql)) { $users[] = $user['userid']; } if ($users) { build_infractiongroupids($users); } } /*================================================= =====================*\ || ################################################## ################## || # Downloaded: 18:31, Fri Nov 12th 2010 || # CVS: $RCSfile$ - $Revision: 32878 $ || ################################################## ################## \*================================================ ======================*/ ?> Updating user info...


الساعة الآن 03:01 AM

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd. TranZ By Almuhajir


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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227