https://www.icyphoenix.com/viewtopic.php?f=35&t=2987&p=22434#p22434
-----------------------------------
Zuker
Wed 19 Dec, 2007 14:15

Re: "aliks0905 We Miss You" Emails ...
-----------------------------------
i've got it coded on a website control panel. that files won't help you

i hope this piece of code will help you

[code linenumbers=false]// Count users
$sql = 'SELECT user_id FROM '.USERS_TABLE.' WHERE user_id > 0 AND user_lastvisit < '.(time()-86400*30).'';
if(!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Could not count Users", "", __LINE__, __FILE__, $sql);
}
$total_users = $db->sql_numrows($result);
//

$query_result = mysql_query('SELECT username,user_email FROM '.USERS_TABLE.' WHERE user_id > 0 AND user_lastvisit < '.(time()-86400*30).'');

while( $row = $db->sql_fetchrow($query_result) )
{
	$userrow[] = $row;
}

for ($i = 0; $i < $total_users; $i++)
{
	if (empty($userrow[$i]))
	{
		break;
	}

	$row_color = (($i % 2) == 0) ? "row1" : "row2";

	$template->assign_block_vars('userrow', array(
		'COLOR' => $row_color,
		'NUMBER' => ($start + $i + 1),
		'USERNAME' => $userrow[$i]['username'],
		'U_ADMIN_USER' => append_sid("admin_users.$phpEx?mode=edit&amp;" . POST_USERS_URL . "=" . $userrow[$i]['user_id']),
		'EMAIL' => $userrow[$i]['user_email']
		) //end array
	);
} // end for[/code]

Set 30 for the amout of days you want


