Wow. I just happened to read this and find that it actually doesn't avoid cron jobs. A cron job just calls a script daily. If you can't do that, what can you do? Well, why not simply run interest whenever someone visits the shop... it takes a few database querys, but nothing fancy. Note that this only works if your members are active. Someone needs to log-on to trigger it. You could be fancy, and have it find the number of days in between failed interest days, but that would be tricky with leap years. I wanna keep this simple
Ok. Open shop.php, find
$context['page_title'] = $txt['shop'];
$context['linktree'][] = array(
'url' => "$scripturl?action=shop",
'name' => $txt['shop'],
);
Below this is where we will code. The first thing to do is to check if it is a new day or not. The best way to do this is to create a column in the Settings database table, which records the last time someone collected interest. So insert a row into that table with variable = 'InterestDate' and value = 0.
now add this code
$date = date('z') //find the current date. Z is the day of the year it is.
$olddate = $modSettings['InterestDate'] //last date you got interest
if ($date != $olddate) // if they are equal, do nothing. If they are not equal, time to collect interest.
{
$interest_rate = $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__); // This gives interst copied from daniels script, so it should work.
$result = db_query("UPDATE {$db_prefix}settings
SET value = {$date}
WHERE variable = 'InterestDate'", __FILE__, __LINE__); //update the last time interest was collected
}
And that it. I havn't tested it(its 11:30 PM right now), but it should work. If not, just give me the error you get and I will try to fix it.