function updateUserUrls() { printfnq("Updating user URLs...\n"); // XXX: only update user URLs where out-of-date $qry = "SELECT * FROM profile order by id asc"; $pflQry = new Profile(); $pflQry->query($qry); $members = array(); while ($pflQry->fetch()) { $members[] = clone $pflQry; } $pflQry->free(); foreach ($members as $member) { $user = $member->getUser(); printfv("Updating user {$user->nickname}..."); try { $profile = $user->getProfile(); updateProfileUrl($profile); updateAvatarUrls($profile); // Broadcast for remote users common_broadcast_profile($profile); } catch (Exception $e) { printv("Error updating URLs: " . $e->getMessage()); } printfv("DONE."); } }
function updateUserUrls() { printfnq("Updating user URLs...\n"); // XXX: only update user URLs where out-of-date $user = new User(); if ($user->find()) { while ($user->fetch()) { printfv("Updating user {$user->nickname}..."); try { $profile = $user->getProfile(); updateProfileUrl($profile); updateAvatarUrls($profile); } catch (Exception $e) { echo "Error updating URLs: " . $e->getMessage(); } printfv("DONE."); } } }