SMF Shop
SMFShop => Installation Problems => Topic started by: Licorne on March 22, 2007, 08:38:44 am
-
I enabled the bank interest and set up the cron job exactly as the instructions said. Then I noticed that the interest wasn't working. So I looked at the interest_log.htm file vi my browser and this is what I got:
Fatal error: Cannot redeclare ssi_recentkarma() (previously declared in /home/winglica/public_html/forum/SSI.php:1644) in /home/winglica/public_html/forum/SSI.php on line 1799
How do I fix this? Thank you.
-
can you post the php code in the dointerest file that you have a cron job set to please
-
<?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
// $Id: dointerest.php 4 2006-07-08 10:09:08Z daniel15 $
if(!isset($_SERVER["HTTP_HOST"])) {
include("../../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");
}
?>
-
maybe you should give permission 777 to interest_log.htm, but I'm not quite sure.
-
Thanks, I got it working now. It was the ssi file that was causing the trouble.
-
It was the ssi file that was causing the trouble.
Yeah, it looks like a karma mod of some kind was causing the error.
-
(Email from Cron) (No errors in the server error log)
Warning: main(../../SSI.php): failed to open stream: No such file or directory in /home/tryfree/public_html/smf1/Sources/shop/dointerest.php on line 17
Warning: main(../../SSI.php): failed to open stream: No such file or directory in /home/tryfree/public_html/smf1/Sources/shop/dointerest.php on line 17
Warning: main(): Failed opening '../../SSI.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tryfree/public_html/smf1/Sources/shop/dointerest.php on line 17
Fatal error: Call to undefined function: db_query() in /home/tryfree/public_html/smf1/Sources/shop/dointerest.php on line 20
This is the error message i get from the crontab, no errors in the server log. ^^^^^
<?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
// $Id: dointerest.php 4 2006-07-08 10:09:08Z daniel15 $
if(!isset($_SERVER["HTTP_HOST"])) {
include("../../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");
}
?>
This is dointerest.php ^^^^^
Any idea on how to fix the ssi problem? And the db query problem?
From,
Ouch
-
change
include("../../SSI.php");
to
include("/home/tryfree/public_html/smf1/SSI.php");
-
ssi.php does not exist in the smf1 folder, so it simply does nothing. No error messages, but also no interest.
-
so point it to where it does exist.
..if its not given if you errors, then it must exist. or am i mistaken?
-
It does exist, just overlooked it. My host had to correct the path for the cron job (I didn't know the absolute path.) I'm going to use the same root path for the SSI.php and see if that solves the problem.
To find out if i had the path correct in the crontab, my host put in a script called Test.php and set it to run once daily. It's output is "test", sent to my email account. (it's not really a script, just a php file with the word 'test' in it, too see if the crontab is working.)
From,
Ouch
-
nevermind lol. I'll install Shop after about, 2 years, or whenever i finally know how to write php lol, Still getting an error from line seventeen, even after aiming dointerest.php to it. Maybe I'll learn enough to re-write the dointerest.php so that it can work without everyone asking millions of questions about the interest.
Daniel, I bet you wish you never wrote the shop mod lol
Peace out,
-
ssi.php does not exist in the smf1 folder, so it simply does nothing. No error messages, but also no interest.
:o
That's the problem, SSI.php is a core part of SMF. Does going to ssi_examples.php in your SMF directory work? If not, you'll need to reupload the SSI.php file.