Author Topic: SMF Lottery Mod  (Read 90434 times)

Offline AndyII

Re: SMF Lottery Mod
« Reply #15 on: November 15, 2007, 06:17:26 am »
great and thank you  :)
any problems running this with TP & SMF? (Tiny Portal)

Offline YamiKaitou

Re: SMF Lottery Mod
« Reply #16 on: November 15, 2007, 08:11:18 am »
I have no idea. If there is, please tell me as I don't use TP

Offline AndyII

Re: SMF Lottery Mod
« Reply #17 on: November 15, 2007, 08:16:45 am »
thanks for the reply, I will surely let you know soon,  TP is very popular as the portal for SMF, I use these as a pair and I know that the themes have to be coded separately as well

Offline AndyII

Re: SMF Lottery Mod
« Reply #18 on: November 15, 2007, 09:46:40 am »
Good news here, works perfectly with Tiny Portal  :)
using, SMF 1.1.2 and TP .9.8  O0.
question, possible to award the lotto one of the selected tickets?, no matter how many enter, or how many tickets  a user will purchase...., so a random drawing of only the lotto numbers entered. I want it to be easy for members to win as we will give a specific gift to keep them coming back lol
And how about a way to see the winning number so it can be posted?, in other words, where do I go to see the numbers that were picked by the script?, in the shop admin would be a nice place to see the winning numbers.
« Last Edit: November 15, 2007, 11:23:17 am by AndyII »

Offline YamiKaitou

Re: SMF Lottery Mod
« Reply #19 on: November 15, 2007, 01:18:28 pm »
Winning numbers are publicaly visible in the Shop section. There is a Lottery link below the Trade Centre link. Then, just click the Past Winners link to view old winners/drawings.


The numbers. I was thinking about making it have the capabilities of the normal lotteries but I just haven't had the time to work on it. I will take your suggestion into mind. If you don't mind, could you post that on my site as well so I can remember it?

Offline Alundra

Re: SMF Lottery Mod
« Reply #20 on: November 26, 2007, 07:19:32 am »
okay i know ima sound like an idiot but i dont care

Code: [Select]
/usr/bin/php -q /home/user/public_html/forums/Sources/shop/LotteryDraw.php > /dev/null

am i supposed to personalise that?!



^ and which of those options do i select? lol just select 6 days?

Offline YamiKaitou

Re: SMF Lottery Mod
« Reply #21 on: December 08, 2007, 06:23:28 am »
First, this is the actual command that is used, not the one you have

/usr/bin/php -q /home/user/public_html/forums/Sources/shop/LotteryDraw.php > /dev/null


For the time, if you want it to run 1 day a week, choose a Weekday and change the time (Hour and Minute) to what every you want


PS: Sorry for the late reply. I knew when I posted this I wouldn't check here much

Offline JMV290

Re: SMF Lottery Mod
« Reply #22 on: December 15, 2007, 03:36:18 pm »
Pretty good.  Is there a way to limit how many a person can purchase? I initially set it to 3, thinking it would stop them from buying tickets at 3 tickets.  A user then bought 12 and put them all in the trade center.  Is there a way to limit both the purchases and the entries of the item?

Other than that, it's pretty cool.  Thanks.

Offline voyager

Re: SMF Lottery Mod
« Reply #23 on: December 22, 2007, 04:46:13 am »
That image that the guy posted up there from the drawing times isn't on my shop anywhere. Is there somewhere that it is that I'm missing or did my installation just miss it when it installed, or is there a whole other mod that I need for that part? Thanks for any help with this.

AZ-{OVGY}

  • Guest
Re: SMF Lottery Mod
« Reply #24 on: December 23, 2007, 01:41:59 am »
That image Alundra posted is a screenshot of the cron job settings in CPanel. CPanel may or may not be provided with your webhosting, you will need to check.

Offline JMV290

Re: SMF Lottery Mod
« Reply #25 on: December 24, 2007, 02:38:15 pm »
I'm not sure if the item is working or not.

If there are no winners, should the results of the drawing show up in the past winners section? If so, I have a problem--they aren't.

Yes, I've set a cron job.  I set it to go every friday at 3PM and then edited the file like you said
Code: [Select]
// 518400 is the amount of seconds in 6 days. Change this to change the time between the draws.
if ($currentTime - $last_draw < 604800)
fatal_error("Lottery draws are to close together.",true);
Which, should result in a 7 day drawing period.


Offline jdv

Re: SMF Lottery Mod
« Reply #26 on: December 27, 2007, 10:52:46 pm »
awesome mod YamiKaitou,

works great in tp and smf. quick question... i'd like to pull the $ amount and post in front page of site what the lottery is currently at. was curious if there is a quick ssi function or what not to pull that info to display. sort of a way to advertise on the site how big the lottery jackpot is getting. i know you can go to the shop and see it, but its hard to get folks to look in there to spark their interest in using the lottery. just looking for something that would pull the current jackpot amount and updates as it grows. also something to pull the lottery numbers drawn and post as well on front page.

Offline Bandit

Re: SMF Lottery Mod
« Reply #27 on: January 04, 2008, 01:11:52 pm »
I haven't been able to get the cron job to run. The lottery center indicates no draws have taken place yet. I have the crom job set to run every Thursday at 11:30 PM, and I've edited the LotteryDraw.php file to allow for a period of 7 days between draws. It just doesn't run. When I try to access the file with my browser to run it that way I get an internal server error. I have the interest for the bank working, and I've made sure the path is the same for both jobs. I really don't know much at all about cron jobs, so I'm at a loss. I even tried chmod 777 on the lotterydraw file. Can anyone give me any ideas? I love this mod and my users are buying up tickets left and right, but I've got to get the draw working.

Thanks in advance for any help anyone can offer.

UPDATE: I got it to work by choosing every weekday instead of a specific day of the week, and changing the time between draws to 24 hours. I don't want a daily draw, though, I only want a weekly draw. And I don't even care what day of the week it happens on, just that it only happens once a week. If I leave it at every weekday, and change the time between draws to 7 days, will that allow it to run weekly?

UPDATE #2: Now that the lottery draw has run once, none of my regular members can use their tickets. They are able to buy them fine, they go into their inventory and choose their numbers but when they click to use the item, they get this:

Quote
"Database Error Please try again. If you come back to this error screen, report the error to an administrator."

When I look in the forum's error log, this is the error that shows up:

Code: [Select]
test   Today at 08:54:23 PM 

 74.77.24.187     8ffbf09aa0698d68c39dfa13e9636742 

 http://www.lacrosse-network.com/forum/index.php?option=com_smf&amp;Itemid=26&amp;action=shop;do=inv3;id=199 

Database Error: Incorrect table name ''
File: /home/xxxxxx/public_html/lacrosse-network/forum/Sources/shop/items/Lottery.php
Line: 115   


Here is line 113-117 of my lottery.php file:

Code: [Select]
$result = db_query("SELECT `MemberTicketID` FROM `{$db_prefix}shop_lottery` WHERE
        `ID_MEMBER` = '$ID_MEMBER' AND
        `ID_TICKET` > $lastTicket",__FILE__,__LINE__);
        if (mysql_num_rows($result) == $item_info[1])
        {

I don't get any errors using my admin account, I am able to use the tickets without issue. I'm lost. I can't figure out why the table name would be incorrect for one user group and not another. I haven't changed anything in any of the files except the time between draws. Using SMF 1.1.4, shop 3.0 (build 12) and lottery mod 1.0.1. Any ideas?

Bandit
« Last Edit: January 06, 2008, 01:28:36 pm by Bandit »

Offline JusPlay77

Re: SMF Lottery Mod
« Reply #28 on: February 07, 2008, 09:37:30 am »
When I try to use my ticket, I get this:

Table 'xxxxxxx.smf_lottery_win' doesn't exist
File: /home/content/x/x/x/xxxxxxxx/html/smf/Sources/shop/items/Lottery.php
Line: 106

Offline AndyII

Re: SMF Lottery Mod
« Reply #29 on: February 16, 2008, 04:40:43 am »
question, possible to award the lotto one of the selected tickets?, no matter how many enter, or how many tickets  a user will purchase...., so a random drawing of only the lotto numbers entered. I want it to be easy for members to win as we will give a specific gift to keep them coming back lol