$twit = array(); foreach ($ignoreList as $username) { $useResult = sql_query("SELECT `useid` FROM `users`" . dbWhere(array("useUsername" => $username))); if ($useData = mysql_fetch_assoc($useResult)) { if ($useData["useid"] != $_auth["useid"]) { $twit[] = $useData["useid"]; } } mysql_free_result($useResult); } sql_query("DELETE FROM `twitList`" . dbWhere(array("twtCreator" => $_auth["useid"]))); $twit = array_unique($twit); foreach ($twit as $useid) { sql_query("INSERT INTO `twitList`" . dbValues(array("twtCreator" => $_auth["useid"], "twtBadUser" => $useid))); } recountAllUpdates($_auth["useid"]); // Update the database sql_query("UPDATE `useExtData`" . dbSet(array("useSignature" => $_auth["useSignature"], "useNoSig" => $_auth["useNoSig"], "useNoEmoticons" => $_auth["useNoEmoticons"], "useNoBBCode" => $_auth["useNoBBCode"], "useNotifyWatch" => $_auth["useNotifyWatch"], "useNotifyFavs" => $_auth["useNotifyFavs"])) . dbWhere(array("useEid" => $_auth["useid"]))); notice(_SET_SAVED); } // ====================================================================================================== // FOUND NEW CLUB // ====================================================================================================== ?> <?php iefixStart(); ?> <div class="sep largetext"><?php echo _CLUB_FOUND; ?> </div>
function recountAllUpdatesIfNeeded($user) { global $_auth; $now = time(); if ($now - $_auth["useLastUpdate"] < 240) { return; } /* We used to set useLastUpdate to $count, but now we're going to store the time of the update check instead $updResult = sql_query( "SELECT COUNT(*) FROM `updates` ". "WHERE `updCreator` = '".intval( $user )."'" ); $count = mysql_result( $updResult, 0 ); $updResult = sql_query( "SELECT COUNT(*) FROM `updatesArt` ". "WHERE `updCreator` = '".intval( $user )."'" ); $count += mysql_result( $updResult, 0 ); if( $_auth[ "useLastUpdate" ] == $count ) { return; } */ recountAllUpdates($user); // Update useLastUpdate so that we don't have to recount again next time. sql_query("UPDATE `useExtData` SET `useLastUpdate` = '{$now}' " . "WHERE `useEid` = '" . intval($user) . "' LIMIT 1"); if ($user == $_auth["useid"]) { $_auth["useLastUpdate"] = $now; // Immediate effect. } return true; }