Well, I am making a script that will update all users ranks every 7 days. What I came up with was to just include this page in another page that will be accessed all the time:I am not 100% sure that this will work. Will that script add 1 to a user level 7 days after their previous promotion? Also is including this in a commonly accessed page the best way to do this? Thanks in advancePHP Code:<?php
$get = mysql_query("SELECT id, level, last_pro, signup FROM `users` WHERE status = 'active'") or die ("Error Getting User Data! \n<br />\n" .mysql_error());
while ($u = mysql_fetch_array($get)) {
if ( !$last_pro && $signup >= (time()-60*60*24*7) ) { $level = $u['level'] + 1; $last_pro = date('n/j/y [g:i A]'); }
else if ( $last_pro >= (time()-60*60*24*7) ) { $level = $u['level'] + 1; $last_pro = date('n/j/y [g:i A]'); }
$update = mysql_query("UPDATE `members` SET level = '$level', last_pro = '$last_pro' WHERE id = '$id'") or die ("Error Updating Levels! \n<br />\n" .mysql_error());
}
?>



Reply With Quote
. Can I use this code to also delete users after 8 days of inactivity by changing it to this: 
Bookmarks