
AngeDevil wrote: Thanks.
Oh man! Did you just code this? It rocks, thanks. Great birthday present! A mod made for mee![]()
AngeDevil wrote: Alright, works great with Easymod, one thing though, can you make it not include inactive members?
Code: Select all
//
// Start Member of the day Mod
//
$sql = "SELECT user_id, username
FROM " . USERS_TABLE;
Code: Select all
//
// Start Member of the day Mod
//
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_active = 1";
Code: Select all
//
// Start Member of the day Mod
//
// Update the Member of the day and the time
function update_member_of_the_day($row,$row_count) {
global $board_config, $lang, $db;
// Update the time
$update_sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = " . time() . "
WHERE config_name = 'member_of_the_day_time'";
if ( !($result_update = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update config table', '', __LINE__, __FILE__, $update_sql);
}
// Randomise the Member of the day
$x = rand(1,$row_count - 1);
// Add user_id and username
$user_details[0] = $row[$x]['user_id'];
$user_details[1] = $row[$x]['username'];
$combine_user_id_username = implode("\n",$user_details);
// Update the member of the day
$update_sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '" . $combine_user_id_username . "'
WHERE config_name = 'member_of_the_day'";
if ( !($result_update = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update config table', '', __LINE__, __FILE__, $update_sql);
}
}
//
// End Member of the day Mod
//
Code: Select all
?>