SMF Shop

SMFShop => General SMFShop Discussion => Topic started by: Daniel15 on June 27, 2006, 05:45:40 pm

Title: How to set up the interest cron job in cPanel (step-by-step)
Post by: Daniel15 on June 27, 2006, 05:45:40 pm
Moved to the Wiki... Please see http://www.dansoftaustralia.net/smfshop_wiki/
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Syndel on October 15, 2006, 01:34:15 pm
It should add interest on a daily basis? Because its been a month that I fixed (finally) the file by creating my own empty interest_log.htm... and so far... nothing...

This is what my screen looks like:
(http://i71.photobucket.com/albums/i160/khaotikdezirez/yuck.jpg)


And this is the... http://www.khaotikdezirez.com/interest_log.htm
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Daniel15 on October 20, 2006, 09:48:28 pm
Hmmm... It looks like there is a problem with running PHP in a cron job.
To fix this, create a file in your forum's directory. Give it a random name, like interest12312312.php. Place the following into it:
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//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");
}
?>


Then, change the cron command to:
Code: [Select]
wget -O - -q http://www.khaotikdezirez.com/forum/[filename].phpThat should work for you :)
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Aes-Sedai on April 28, 2007, 01:46:38 pm
I installed the Cron Job the way you mentioned; but there doesn't seem to be interest generating - I looked for interest_log.htm but there was none there so I created one... I'm going to wait 24 hours to see if it works but should it generate interest WITHOUT the file?
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Daniel15 on April 28, 2007, 02:01:11 pm
I installed the Cron Job the way you mentioned; but there doesn't seem to be interest generating - I looked for interest_log.htm but there was none there so I created one... I'm going to wait 24 hours to see if it works but should it generate interest WITHOUT the file?

When the cron job runs, it creates the interest_log.htm file. After it has run, check that file. It should say "Interest added at " followed by the date and time :).
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Aes-Sedai on May 03, 2007, 02:18:28 pm
Nup, nothing...

I created the log file myself as it wasn't appearing and it says 'no input file specified'
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Daniel15 on May 04, 2007, 09:19:31 pm
Nup, nothing...

I created the log file myself as it wasn't appearing and it says 'no input file specified'
That sounds like a PHP problem to me... "No input file specified"  is a common sign that PHP is misconfigured on the server.

Try getting rid of the -q from the command line, and see if that solves it.
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Aes-Sedai on May 05, 2007, 03:11:52 pm
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: TexasBartender on May 16, 2007, 02:14:37 pm
Well I did it like you say but it gave everyone max points how do i fix this

This is the command and i still dont have the interest_log.htm

/usr/bin/php -q /home/texasb/public_html/Sources/shop/dointerest.php > /home/texasb/public_html/interest_log.htm


Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Aes-Sedai on May 16, 2007, 07:02:55 pm
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?


I would like a bit of assistance here. I've waited patiently for ages.
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: tfalbb on June 25, 2007, 11:16:46 pm
Doesn't work for me. Not having CPanel or any way of setting up a cron job on the server I used www.cronjobs.org but still nothing.

I rather suspect that it's due to there being no SSI.php file in my /forum directory. Why isn't it there and where would I find it?

** edit - ok, found SSI.php in the original distribution. Don't know why it didn't copy over but it's there now.  Interest still doesn't appear to work.
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: ibexy on July 04, 2007, 08:09:44 am
my forum is installed directly to the public_html. I have this enterd as a cron job but interest is not calculating. Cant figure out why. its been 3 days since I put the command.

/usr/bin/php -q /home/albert/public_html/Sources/shop/dointerest.php > /home/albert/public_html/interest_log.htm
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: ibexy on July 04, 2007, 06:52:58 pm
Solved.

I created the htm file and loaded it to my forum root and that was it. It worked last night :)
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: Aes-Sedai on July 06, 2007, 07:29:16 pm
Quote
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html
No Imput File Specified

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?



I would like a bit of assistance here. I've waited patiently for ages.

cough. It's been months now, still not working.
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: CuTe_MaN on July 14, 2007, 07:50:00 pm
Hello all,

I cant get the interest to work.

I am using SMFSHOP 3.0

I have made all what you have said in this topic and the interest_log file was created automatically but I found this message in it:

Code: [Select]
Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(): Failed opening '../../SSI.php' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Fatal error: Call to undefined function:  db_query() in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 20

anybody can help???

CuTe_MaN
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: feeble on July 14, 2007, 08:02:56 pm
Hello all,

I cant get the interest to work.

I am using SMFSHOP 3.0

I have made all what you have said in this topic and the interest_log file was created automatically but I found this message in it:

Code: [Select]
Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(): Failed opening '../../SSI.php' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Fatal error: Call to undefined function:  db_query() in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 20

anybody can help???

CuTe_MaN

Open up your do interest file
/hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php
on line 17 find
../../SSI.php

and replace with
/hsphere/local/home/rsabouni/samasyria.net/smf/SSI.php
Title: Re: How to set up the interest cron job in cPanel (step-by-step)
Post by: CuTe_MaN on July 18, 2007, 07:10:50 am
I think that there is a problem with the intrest

I have assigned 1% per day and now users are getting more than that

I have added 100 credits to my bank account and after 2 days I have 182 credits thats impossible

can u help me please?

CuTe_MaN