Lottery/Job Mod & Item Auction
-----
| Author | Message | |
|---|---|---|
|
Exorcizer |
||
| Wed Sep 13, 2006 9:10 pm Post subject: Lottery/Job Mod & Item Auction | ||
|
For some reason, I can't have all three of them work at the same time. Its either the lottery and job mod, or the Item auction mod. It seems that the following code makes all the difference:
Code: function duration($seconds) { global $lang; if ( $seconds > 86399 ) { $days = floor($seconds / 86400); $seconds = ($seconds - ($days * 86400)); $string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', '; } if ( $seconds > 3599 ) { $hours = floor($seconds / 3600); if ( $seconds != 0 ) { $string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', '; } $seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) ); } if ( $seconds > 59 ) { $minutes = floor($seconds / 60); if ( $seconds != 0 ) { $string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', '; } $seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60)); } if ( $seconds > 0 ) { $string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', '; } $string = substr($string, 0, -2); return $string; } Can someone help me out on this one? |
||
|
Thoul |
||
| Wed Sep 13, 2006 10:07 pm Post subject: re: Lottery/Job Mod & Item Auction | ||
|
I've never really looked at the lottery or job mod, but from what I understand that snippet of code could be added by both the job mod and the auction mod. You only need to add it once, though. If you already have it for one, don't add it again for the other.
|
||
|
RedTrinity |
||
| Thu Sep 14, 2006 3:36 am Post subject: re: Lottery/Job Mod & Item Auction | ||
|
I actually dealt with the same issue today whilst re-installing the Lottery mod onto our forum for the first time in months, it came up an error relating to a "fatal error, previously redeclared" etc. within the ACP.
It was that exact same piece of coding that was causing the problems. It would have to be from the job mod as we have never had the auction mod installed. Thankfully for us I uninstalled the job mod a while back and it was just a case of accidentally missing that piece of coding, but removing it fixed the problem in the ACP and the Lottery mod started working properly. Anyway point of this story is that I wanted to confirm Exorcizer's suspicions about that coding causing problems and forcing the admin to decide between one mod or the other, so it might be worth looking into as it will probably become a more common problem in future. I hope finding a solution for it doesnt become too difficult an issue. Cheers, RT. |
||
|
Thoul |
||
| Thu Sep 14, 2006 9:01 am Post subject: re: Lottery/Job Mod & Item Auction | ||
|
I can't speak for the lottery, but the auction mod's instructions do say to skip adding that if it's already been added. You just have to be careful and be aware of what you've installed before.
|
||
|
Exorcizer |
||
| Thu Sep 14, 2006 1:37 pm Post subject: | ||
|
I can't find this code anywhere else though.... Oh well, I think I'll stick with my lottery and my job mod! Unless I try to reinstall the lottery... I'll see that later since I'm not home right now
|
||
|
Exorcizer |
||
| Thu Sep 14, 2006 4:05 pm Post subject: | ||
|
I was able to fix this issue on my own! I just deleted the duration function in lottery.php, jobs.php, and admin_lottery.php, and kept the duration function in functions.php. So, it all works fine now!
|
||
|
Thoul |
||
| Thu Sep 14, 2006 7:23 pm Post subject: re: Lottery/Job Mod & Item Auction | ||
|
Excellent, I'm glad you got it worked out.
|
||
Page 1 of 1