SMFShop > SMFShop Announcements
Bank interest without cron job? Read this!
Daniel15:
Hi,
Unfortunately, some people don't have access to cron jobs, and therefore ask me if there's a way to add the interest without using cron jobs.
First, create a file somewhere on your website. Give it a random name, maybe something like dointerest2342351.php. This is so members of your site don't know the name of the file, and therefore can't add the interest themselves. Put the following text in the file:
--- Code: (php) ---<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2005 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: dointerest.php
// The file to add interest to member's bank
//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005
include("/home/[username]/public_html/forum/SSI.php");
$interest_rate = $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__);
echo "Interest added at ".date("d/m/Y h:i:s A");
?>
--- End code ---
Replace '/home/[username]/public_html/forum/' with the absolute URL of the forum. This can be found by going to SMF Admin Panel --> Edit Server Settings --> SMF Directory. It will look something like '/home/username/public_html/forum'.
Next, we use a utility that calls this script every day. There are several web-based cron tools, but most are in other languages. You can get a Windows program that will call the script every day, or, if you want to, you could just run the script yourself :)
Once you've set that up, your interest should now be working!
UPDATE: You may try to call the script via the Windows Task Scheduler. Please see this post for more details
tazpot:
I found a place that will let you set up a free web based cron job www.cronjobs.org/index.php
The only info you need to change are...
Name.....just make something up
URL http......ie www.yoursite.com/forum/your_bankinterest.php
Expire after........change to 999 because setting to 000 will give an error
HOUR.....set to 0am or whatever time you want
Hope this helps someone :)
Vinspire:
--- Quote from: tazpot on April 24, 2006, 05:55:42 am ---I found a place that will let you set up a free web based cron job www.cronjobs.org/index.php
The only info you need to change are...
Name.....just make something up
URL http......ie www.yoursite.com/forum/your_bankinterest.php
Expire after........change to 999 because setting to 000 will give an error
HOUR.....set to 0am or whatever time you want
Hope this helps someone :)
--- End quote ---
I am still waiting for a validation email from that site :'( :'( :'(
--- Quote ---Next, we use a utility that calls this script every day. There are several web-based cron tools, but most are in other languages. You can get a Windows program that will call the script every day, or, if you want to, you could just run the script yourself Smiley
UPDATE: You may try to call the script via the Windows Task Scheduler. Please see this post for more details
--- End quote ---
How to do this & i did follow the link .... and the link for the windows task scheduler is dead :crazy2: :crazy2: :crazy2:
Daniel15:
--- Quote --- and the link for the windows task scheduler is dead
--- End quote ---
Bah, my find-and-replace made the link incorrect!
Try this link instead: http://www.daniel15.com/forum/index.php?topic=95.msg349#msg349
Vinspire:
Nvm daniel. Manage to get it working by doing cron job in the cpanel O0 O0 O0
Navigation
[0] Message Index
[#] Next page
Go to full version