1814400 / 60 / 60 * 24 = 21 dan
WHERE dateRegistered < ". ($time - 1814400) ."
AND lastLogin < ". ($time - 1814400) ."
AND aeiou_email < ". ($time - 1814400) ."
AND ID_GROUP != 1
AND NOT FIND_IN_SET(1, additionalGroups)
AND aeiou_count < 2
AND is_activated < 10
AND is_activated != 0
AND is_activated != 4
i
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE dateRegistered < ". ($time - 1814400) ."
AND lastLogin < ". ($time - 1814400) ."
AND ID_GROUP != 1
AND FIND_IN_SET(1, additionalGroups) = 0
AND aeiou_count > 1
AND aeiou_email < ". ($time - 1814400) ."
Ovo je sto ima u subs.php , a vezano za broj dana tj tacnije za broj sekundi.
Takodje i u ModSettings.php
function ModifyAeiouSettings()
{
global $txt, $scripturl, $context, $settings, $sc, $db_prefix, $modSettings;
// If the mod is enabled and we're not saving, query for mod status information
if (!isset($_GET['save']) && $modSettings['aeiou_enable'])
{
// Current time
$time = time();
// Get the delete band
$request = db_query("
SELECT count(*)
FROM {$db_prefix}members
WHERE lastLogin < ". ($time - 1814400) ."
AND aeiou_email < ". ($time - 1814400) ."
AND aeiou_count > 1
AND posts <= ". (int) $modSettings['aeiou_underposts']. "
", __FILE__, __LINE__);
list($deletion) = mysql_fetch_row($request);
// Create an array for the bands, with default values of 0
$temp = array(0 => 0, 1 => 0, 2 => (int) $deletion);
// Tidy up
unset($deletion);
mysql_free_result($request);
// Get the email bands
$request = db_query("
SELECT count(*) as no, aeiou_count
FROM {$db_prefix}members
WHERE dateRegistered < ". ($time - 1814400) ."
AND lastLogin < ". ($time - 1814400) ."
AND aeiou_email < ". ($time - 1814400) ."
AND ID_GROUP != 1
AND NOT FIND_IN_SET(1, additionalGroups)
AND aeiou_count < 2
AND is_activated < 10
AND is_activated != 0
AND is_activated != 4
GROUP BY aeiou_count
ORDER BY aeiou_count ASC
", __FILE__, __LINE__);
// No further emails, if not set already, stop the mod until tomorrow
if(mysql_num_rows($request) == 0)
{
// If not already, tell the mod to stop
if(!empty($modSettings['aeiou_stop']))
aeiou_update(array('stop' => 1));
// Change the variable for the remainder of this page
$modSettings['aeiou_stop'] = 1;
}
else
{
// Store the bands in the array created earlier
while($row = mysql_fetch_assoc($request))
$temp[$row['aeiou_count']] = $row['no'];
// Tidy up
unset($row);
// The mod is set as stopped, but we discovered some emails, so re-activate us
if(!empty($modSettings['aeiou_stop']))
{
aeiou_update(array('stop' => 0));
// Change the variable for the remainder of this page
$modSettings['aeiou_stop'] = 0;
$reactivated = 1;
}
}
// Prepare rows for the stats table
$items = array();
// Last ran
$items['aeiou_last_ran'] = ($modSettings['aeiou_locktimestamp'] == 0) ? $txt['aeiou_never'] : timeformat($modSettings['aeiou_locktimestamp'], true) ;
$again = ($modSettings['aeiou_locktimestamp'] == 0) ? $time : $modSettings['aeiou_locktimestamp'];
// But if reached daily limit or is stopped we will start/check again tomorrow
if($modSettings['aeiou_day_max'] <= $modSettings['aeiou_day_sent'] || !empty($modSettings['aeiou_stop']))
{
$date = explode('-', date('Y-m-d', $again));
$tomorrow = mktime(0, 0, 0, $date[1], $date[2], $date[0]) + (60*60*24);
$items['aeiou_starts_again'] = timeformat($tomorrow, true);
unset($date, $tomorrow);
}
elseif($modSettings['aeiou_hour_max'] <= $modSettings['aeiou_hour_sent'])
{
// Or reached hourly limit we will start/check again next hour
$date = explode('-', date('Y-m-d-h', $again));
$nexthour = mktime($date[3], 0, 0, $date[1], $date[2], $date[0]) + (60*60);
$items['aeiou_starts_again'] = timeformat($nexthour, true);
unset($date, $nexthour);
}
else
// Else Can start again from previous + 5mins
$items['aeiou_starts_again'] = timeformat($again + 300, true) ;
// Emailed today with max in parenthesis
$items['aeiou_sent_day'] = $modSettings['aeiou_day_sent']
.' <span style="font-weight:normal;font-style:italic">('.$txt['aeiou_max'].': '.$modSettings['aeiou_day_max'].')</span>';
// Emailed this hour with max in parenthesis
$items['aeiou_sent_hour'] = $modSettings['aeiou_hour_sent']
.' <span style="font-weight:normal;font-style:italic">('.$txt['aeiou_max'].': '.$modSettings['aeiou_hour_max'].')</span>';
// Now setup the stats about no.s of email etc
$items['aeiou_awaiting_total'] = $temp[0] + $temp[1];
$items['aeiou_awaiting_initial_email'] = $temp[0];
$items['aeiou_awaiting_final_email'] = $temp[1];
$items['aeiou_awaiting_deletion'] = $temp[2] . (empty($modSettings['aeiou_delete']) ? ' <span style="color:red">'.$txt['aeiou_disabled'].'</span>' : '' ) ;
// Reasons for inactive
if(!empty($modSettings['aeiou_stop']))
$status = $txt['aeiou_nofurtheremails'];
elseif($modSettings['aeiou_day_max'] <= $modSettings['aeiou_day_sent'])
$status = $txt['aeiou_reacheddailylimit'];
elseif($modSettings['aeiou_hour_max'] <= $modSettings['aeiou_hour_sent'])
$status = $txt['aeiou_reachedhourlylimit'];
// Is the mod Active? (even if enabled, it might not be active)
// If the mod was stopped, but on loading this page, we discovered more emails, show as re-activated
if(!empty($reactivated))
$status = '<span style="color:darkgreen">'.$txt['aeiou_reactivated'].'</span>';
elseif(empty($status))
$status = '<span style="color:darkgreen">'.$txt['aeiou_active'].'</span>';
else
// Inactive
$status = '<span style="color:maroon">'.$txt['aeiou_stopped'].'</span> - '. $status;
// Header of the stats chunk and status
$chunk = '<table cellpadding="1" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg"><td colspan="2">'.$txt['aeiou_status'].': '.$status.'</td></tr>';
// Now build the chunk of html of our stats
foreach($items as $string => $value)
{
// Less emphasis on the sub-totals
$italic = ($string == 'aeiou_awaiting_initial_email' || $string == 'aeiou_awaiting_final_email') ? 1 : 0 ;
// Add more rows to the existing chunk
$chunk .= '<tr class="windowbg"><td'.($italic ? ' style="font-weight:normal;font-style:italic"' : '').' >'.$txt[$string].':</td><td'.($italic ? ' style="font-weight:normal;font-style:italic"' : '').'>'.$value.'</td></tr>';
}
$chunk .= '</table><br />';
// Now for the last 10 people emailed
$request = db_query("
SELECT ID_MEMBER, memberName, aeiou_email, aeiou_count
FROM {$db_prefix}members
WHERE aeiou_email != 0
ORDER BY aeiou_email DESC
LIMIT 10
", __FILE__, __LINE__);
$chunk2 = '<table cellpadding="1" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg"><td colspan="3">'.$txt['aeiou_last10emailed'].'</td></tr>';
if(mysql_num_rows($request) == 0)
$chunk2 .= '<tr class="windowbg"><td colspan="3">'.$txt['aeiou_never'].'</td></tr>';
else
{
// Add each user as a row in the table
while($row = mysql_fetch_assoc($request))
$chunk2 .= '<tr class="windowbg"><td><a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$row['memberName'].'</a></td><td style="font-weight:normal;">'.timeformat($row['aeiou_email'], true).'</td><td style="font-weight:normal;">'. $txt['aeiou_'.( ($row['aeiou_count'] == 1) ? 'initial' : 'final' )].'</td></tr>';
}
$chunk2 .= '</table><br />';
}
else
// If the mod is not enabled, don't show either as chunks. use a space to prevent it being shown as a delimiter
$chunk = $chunk2 = ' ';
// Compile/Build some language strings/add to
// Avoids using html in the language files
$temp = array('initial_subject' => 'subject', 'initial_message' => 'message', 'final_subject' => 'subject', 'final_message' => 'message');
$add = '<div class="smalltext">'.$txt['aeiou_email_desc1'].'<br />'.$txt['aeiou_email_desc2'].'<br />'.$txt['aeiou_email_desc3'].'</div>';
foreach($temp as $a => $b)
{
// Add the descriptions to the txt string
$txt['aeiou_'.$a] .= $add;
// Use the default message if we don't have a custom one saved
if(empty($modSettings['aeiou_'.$a]))
$modSettings['aeiou_'.$a] = !empty($txt['aeiou_default_'.$b]) ? $txt['aeiou_default_'.$b] : '' ;
}
// Tidy up
unset($temp, $add, $a);
// More descriptions to add with html
$temp = array('delete', 'underposts', 'hour_max', 'day_max', 'chunksize');
foreach($temp as $a)
$txt['aeiou_'.$a] .= '<div class="smalltext">'.$txt['aeiou_'.$a.'_desc'] .'</div>';
// Now the warning chunk. Comprises of 4 parts.
$txt['aeiou_warning'] .= '<div class="smalltext">'. $txt['aeiou_warning2'] .'<br />'.$txt['aeiou_warning3'].'<br />'.$txt['aeiou_warning4'].'</div>';
// The important array
$config_vars = array(
$chunk,
array('check', 'aeiou_enable'),
array('text', 'aeiou_initial_subject', '30" style="width:95%'),
array('large_text', 'aeiou_initial_message', '5" style="width:95%'),
array('text', 'aeiou_final_subject', '30" style="width:95%'),
array('large_text', 'aeiou_final_message', '5" style="width:95%'),
'',
array('check', 'aeiou_delete'),
array('int', 'aeiou_underposts'),
'',
$txt['aeiou_warning'],
array('int', 'aeiou_hour_max'),
array('int', 'aeiou_day_max'),
array('int', 'aeiou_chunksize'),
$chunk2,
);
// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=aeiou');
}
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=aeiou';
$context['settings_title'] = $txt['aeiou_title'];
prepareDBSettingContext($config_vars);
}
Dakle da kratim SVE 1814400 (21 dan) na 432000 (5 dana) ?