SMF Shop
SMFShop => Completed Additions => Modifications => Topic started by: YamiKaitou on October 25, 2007, 10:41:09 am
-
Information
Project Name: SMF Lottery System
Author: Yami Kaitou
Version: 1.0.1
Features
Adds a Lottery feature to SMF Shop 3.0
Shop Admin can set the following variables dealing with the tickets
-Amount of tickets per user
-Percentage of cost of ticket to be added to jackpot
-Range of the balls (example 1-10)
-User the winner PM comes from (0 will be a special guest)
Jackpot will always have a minimum of 1000
To win the lottery, a user must match all 4 balls
By default, drawings can only happen once every 6 days
Drawings can either be done by a cron or by manually going to the script (see FAQ for details)
Special page within main shop for the lottery
-Allows users to see the tickets they have entered for the current drawing
-Allows users to see their previously entered tickets and whether they have won or not
-Allows users to see previous drawings and the winners
Bug Fixes
Jackpot resetting back to 1000 when nobody won.
Jackpot not resetting when someone did win.
FAQ
http://forums.projectyami.com/showthread.php?t=4
Website
http://forums.projectyami.com/forumdisplay.php?f=17
NOTE
I will prefer if you report bugs and feature requests at the website as I want to keep track of my progress, and the fact that I check there more often than here. Also, the attached file may not always be the latest version. So, make sure you check the site for updates as well. I will try to keep this topic up-to-date, but I can't be certain that it always will be.
To Upgrade to 1.0.1 from 1.0.0
Look here (http://projectyami.com/forum/index.php?topic=10.0), simple and easy way to upgrade without having to install the new package.
-
The hell is the cron job? I won't download this because i don't wanna do that. Pitty i really liked the look of this mod too.
-
it's not hard to set up and Yami has provided clear instruction on how to do it. a mod well worth having imo.
-
nice work with this mod, its been asked for a long time so thank you.
good solid list of features, nice one
-
The hell is the cron job? I won't download this because i don't wanna do that. Pitty i really liked the look of this mod too.
Then do it the same way that you do your shops interest. The file is Sources/shop/LotteryDraw.php
-
Version 1.0.1 released due to a bug that I didn't notice. Uploaded new package here and method to upgrade to the latest version is found on my forums (very easy upgrade, involves changing 1 character in the source)
-
What exactly is cron and why do you have to do it? So you're saying everytime we want to draw a lottery we have to go through this cron stuff/scripting?
I have this mod installed on my forums. How would I test the system and see what it's like to win?
When I click "Previous tickets" it's already told me that I havent won before the lottery has been drawn. is that normal? Will it change after the lottery has been drawn.
Is it possible for the people who have purchased a lottery ticket and lost get a pm saying they lost?
-
A cron is something that allows you to do something on certain days of the week/month/etc. It is all automated. So, unless you want to remember to run the script yourself every week, this is the easiest way. And no, you just have to set the cron up once and it will always run on the specified date you give it.
-
Alright thanks.
Is there a way to keep it so that the jackpot doesn't reset and keeps on going till someone wins it all?
-
If you use 1.0.1, it will do that
-
Feature request=
Make this mod editable in the admin section, like the time between drawings, the option to reset the jackpot after no winners or not, and make it so that we don't have to go through this cron job stuff. It's kinda alot of work just to get this mod running in my opinion. Especially for the not so advanced people here. :-/
It's an excellent mod and has nice features. Now try to make it easier for us to use maybe?
(P.S. I still can't get it to work. lol...)
-
I will see about making it more editable through the admin section (maybe a lottery section in the shop admin area that only works when you have the lottery item enabled, maybe). But, the cron will not go away. You don't have to use the cron though, you can always run the script manually when you want to. The only reason why there is the time limit in between drawings is so other members don't run the script when their not supposed to. Changing the time limit is not that hard either. I don't see any way that I can make the setup for this any easier than it is. The cron is not mandatory, it is just a good idea. You set it up the same way you set up the cron for the bank interest.
-
Thanks, I got it to run every friday at 5pm. My members love this new feature.
Sorry about the loads of questions, Im learning. :]
-
wow i found a error (at least for me) when you uninstall it there a error in the uninstall and it told me the tables were unknown and it wouldn't uninstall so i just reinstalled smf and deleted it :P i hope you can help me i really liked this mod
thanks you for your time
-
What tables did it error on? Cause, it worked fine for me to uninstall. Though, I haven't tried it lately
-
great and thank you :)
any problems running this with TP & SMF? (Tiny Portal)
-
I have no idea. If there is, please tell me as I don't use TP
-
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
-
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.
-
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?
-
okay i know ima sound like an idiot but i dont care
/usr/bin/php -q /home/user/public_html/forums/Sources/shop/LotteryDraw.php > /dev/null
am i supposed to personalise that?!
(http://i18.photobucket.com/albums/b108/yuk75/cron.jpg)
^ and which of those options do i select? lol just select 6 days?
-
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
-
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.
-
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.
-
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.
-
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
// 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.
-
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.
-
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:
"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:
test Today at 08:54:23 PM
74.77.24.187 8ffbf09aa0698d68c39dfa13e9636742
http://www.lacrosse-network.com/forum/index.php?option=com_smf&Itemid=26&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:
$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
-
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
-
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
-
how do i increase the start amount of 1000 to a higher amount? ???
-
I would try this,
in Lottery.php there is this line $this->price = 1000;
put to what you like, no guarantee as I am not a coder
there is also reference in the db
// Add a place to store the jackpot. Start jackpot off at 1000 just because I want to
db_query("INSERT INTO {$db_prefix}settings (`variable`, `value`) VALUES ('lottery_pot', '1000')",__FILE__,__LINE__);
-
I just installed this, having no problems except that I couldn't see anywhere to buy or use the tickets. The Shop had a link for 'Lottery', but all it did was offer links to previous winners & stuff like that. I snooped around, looking in admin, my profile, & the avatar box of posts & found nothing, so I checked the FAQs page at his site, had a good laugh at that, then uninstalled it.
I then got this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
File: /home/xxxxx/public_html/xxxxx.com/forums/Packages/temp/LotterySQLUninstall.php
Line: 32
I'm not looking for help, because I can manage, but I wanted to let you all know what happened because that's what helps a mod evolve. Great idea for a mod; it's just too bad it didn't work for my site, which btw is smf 1.1.4.
Now I'm going in for a manual removal, but I should have listened to my gut & not fiddled with this mod. From now on, I'm just sticking with the stuff Daniel makes. O0
-
after you set up the defaults in Add/Edit/Delete Items (drop down list of shop items), you or a member would find in "Buy Stuff" an Item called "Lottery Ticket".
for the drawing, you would setup a cron or manually run the file to complete the lottery
I think its a very good mod, I havent tried to "Un Install" it as it works great for me.
I have modified a few of the variables to suite my needs
What I would like, and I have asked the author, is for the lottery to choose only from the numbers entered, so I will always have a winner :)
-
I actually thought of looking for it in the items drop down list, but not until after I uninstalled it. You see, that's something that should be included in the FAQs page, in my opinion. I mean, come on... there's only 2 questions there, lol. Thanks for the reply. Maybe I'll try reinstalling it, since I haven't completed the manual uninstall yet.
-
ve got no admin feature that I can find for the lottery (it is showing in the shop fine, but I dont have anything in the shop admin for me to configure with regards to percentage etc......any suggestions?
-
login as admin
in the shop administration choose Add/Edit/Delete Items.
if you haven't already, from drop down menu choose Lottery Ticket by YamiKaitou, from there you can configure the mod.
other wise you will have a list of items in the shop, again you can edit any of them after adding them
-
thank you Andy...not the most obvious way to find it, but its all sorted now and we are sooooo loking forward to the new edition! :D
(incidentally, many apologies for scanning this thread and not noticing you already mentioning how to find my requested info.....me bad :-[
Thanks again :smitten:
-
no problem
Daniel is a very intelligent young man and Yami did a nice job on the lottery mod ;)
-
Is a newbie question :)
How buy a ticket? :S
-
you need to use the BUY ITEM feature in the shop like you do for other items. Once bought it puts it into YOUR INVENTORY where it will stay until you use it. Once you use it, it will ak you to choose your numbers and enter it into the next draw
HTH :-*
-
Information
Project Name: SMF Lottery System
Author: Yami Kaitou
Version: 1.0.1
Features
-Range of the balls (example 1-10)
Excellent system! I've got it installed & working but I can't find a place to set the range of balls in the item. It's got 4 balls and nowhere I can see to change the setting. I'm sure I'm just missing it somewhere.
Any advice?
-
Wow, this thread got popular in the time that I spent not here. Anyways, the forums have changed. Main post updated with new stuff (switched to vB, but still plan on doing 1 or 2 things for SMF and maybe even adding a few features to this mod).
Remember, if you need to ask me something, best way to contact me is via email, PM, or on my site.
-
YamiKaitou, can you post your site addy?
-
Website
http://forums.projectyami.com/forumdisplay.php?f=17
It is in the first post, lol
-
I just registered in your site but can post.
I have a question, do I need to set up a cron job for 1.0.1?
Thanks, and if I do am I supposed to do it daily or weekly?
Thanks again.
-
i dont see any of this:
Special page within main shop for the lottery
-Allows users to see the tickets they have entered for the current drawing
-Allows users to see their previously entered tickets and whether they have won or not
-Allows users to see previous drawings and the winners
^its not showing on my 1.1.5
-
Ok people, a n00b at forum stuff, so i was wandering if anyone could help me set up when the lottery drawings are ... i dont have a clue how to do this!
any help is appreciated, many thanks
damo3933
-
lol the website got shutdown. any1 have 1.01?
-
lottery drawing balls are going in numeric order.. if someone picks balls 5,3,6,2 it will take it as 2,3,5,6. Same thing for the winning balls.. if it was actually 8,5,9,2 it would set the winning balls as 2,5,8,9... any way to fix this?
-
why does it matter, the person will still win.... its something that should not matter...
-
why does it matter, the person will still win.... its something that should not matter...
Umm... because it's not going in the order that they pick them in.. nor is it going in the order it is drawn in = not like a lottery at all..
-
why does it matter, the person will still win.... its something that should not matter...
Umm... because it's not going in the order that they pick them in.. nor is it going in the order it is drawn in = not like a lottery at all..
I understand what you are saying, but i thinks its something that should not matter, maybe its cause of the array... So from what i can understand about PHP
Look for this
// Sort array
array_multisort($winning,SORT_ASC);
and do this
// Sort array
//array_multisort($winning,SORT_ASC);
----------------------
that above code will cancel out the sort. I have not tested this yet.
-
Stupid question:
Where do I start the drawing?
-
must use a crons job
-
Is there a way to make it so that there is a winner all the time.
something like if there is no winner, then draw again till winner appears
-
when the lottery and has just one member receives the credits?
-
eu gostava de saber quando a lotaria acaba! e há um vencedor! Estou a testar ma não vejo maneira de ela acabar e eleger um vencedor! obrigado!
I wonder just when the lottery! and there is a winner! I do not see the test ma way to stop it and elect a winner! thanks!
-
I wonder just when the lottery! and there is a winner! I do not see the test ma way to stop it and elect a winner! thanks!
:-X
-
for the drawing, you would setup a cron or manually run the file to complete the lottery
Could someone tell me how to manually run the file?
Thanks! :)
-
I need to know how I can make it too :-\
Looooooooooooool! Never Mind!!!! :D ;D :uglystupid2: :2funny:
-
for the drawing, you would setup a cron or manually run the file to complete the lottery
Could someone tell me how to manually run the file?
Thanks! :)
I am interested in this too.... THANKS
-
To run it manually, you only need to open the file LotteryDraw.php
-
Hello.. i hve one error.
My members bought ticket and submit numbers. Every week end (at Friday) . whenever i draw the ticket and found member submit member but system show Nobody won.
How can i fix?
-
is there a way to edit the amount of prize manually not going to the database?
-
how do i open the LotteryDraw.php file
-
This is a pretty good mod.. but no one seems to know how to explain the little cron job thing so I have no choice but to stop using it.
-
How do you install this mod?
-
Dearest programmer,
I've looked true your entire topic but didn't found the following:
I'm using SMF 1.1.10 with TinyPortal (latest) and SMF Shop (latest)
I've tried to install SMF Pets but failed, and now that I have Lottery installed the link didn't show up in the shop menu, so I placed it there myself. Now what are the links to the admin section of the lottery so I can adapt that as well?
- Thanks in advance
-- iShot
-
This is a pretty good mod.. but no one seems to know how to explain the little cron job thing so I have no choice but to stop using it.
I think the cron job should look like this:
Command entry to run: /usr/bin/php -q /home/YOURINFO/public_html/Sources/shop/LotteryDraw.php > /dev/null
(http://i75.photobucket.com/albums/i283/BassChick98208/lotteryCron.jpg)
-
I installed the mod like a month ago, and no drawings haev occured. the mod files have not been modified, so they should be happening every 6 days, but they wont..... Why can this be?
-
Hi?
-
as I install it on smf 2.0 rc3
-
I'm afraid there may not be support left for this addition. I had this going on my forum, but members weren't interested, now they are, so I re-Installed it, but getting this error when going to the Lottery section in Shop.
Database Error
Table 'brawldom_website.smf_lottery_win' doesn't exist
File: /home/brawldom/public_html/Sources/shop/Shop-Lottery.php
Line: 32
I'm lost on what to do.
-
Using this with the latest edition of the shop and SMF 2.0 RC5 (emulating RC3).
I see Error: Could not create instance of 'Lottery' item!
How do I fix said error? Thanks in advance!
Fixed the error!
-
When I run the file manually, I get this damn error:
Warning: require_once(SSI.php) [function.require-once]: failed to open stream: No such file or directory in /home/biologyf/public_html/Sources/Load.php(2021) : eval()'d code on line 3
Fatal error: require_once() [function.require]: Failed opening required 'SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/biologyf/public_html/Sources/Load.php(2021) : eval()'d code on line 3
Address: http://biology-forums.com/Sources/shop/LotteryDraw.php
What the hell does this mean and how do I correct it?
-
projectyami is down.can anybody give me a direct download link?
-
Good evening everyone...
I'm currently attempting to install SMF Lottery Mod 1.0.1, using SMF Shop v.3.2. My SMF forum that I'm using for testing purposes before putting any changes into production is version 2.0.2. The only other mods I currently have installed are SimplePortal 2.3.5 and Member Awards 2.2.3.
When attempting to install the lottery mod, this is the error I encounter:
Fatal error: Call to undefined function db_query() in /home/.../public_html/izukoislandweyr/Packages/temp/LotterySQL.php on line 17
I have some familiarity with coding, but it's mostly limited to CSS and JavaScript. However, looking over the source code in LotterySQL.php, I don't know why it's throwing this error when attempting to install the mod. I've attempted to uninstall the mod, cleared my browser cache, even went so far as to try this from two different computers but still no go.
Attached is the exact copy of my LotterySQL.php for review. I figure I could use an extra set of eyes to look this over, and I would be grateful for the help.
Thanks in advance...
-
Hello:
When they updated SMF 1.x to SMF 2.0.2 they changed the core of how SMF works. The designers of SMF created a variant off some of the database code, and you now how to use that instead of the basic php/mySeql code we all know and love. It's been driving me crazy this new design. The worst part is they have not documented exactly what the new changes do. Some of the mod developers are working on a manual now.
How do I know this? Simple I have been working on a mini gallery and graphic items for the shop mod to work with smf 2.0.2. I have been driving all the coders crazy asking questions and getting help from who I can. If you want the lottery mod/plugin to work your going to have to post the database code on SMF comunity and ask for help in changing it.
On the plus side I am almost finished designing the new min gallery code and should have something cool to use next week.
Dumb as it sounds the SMF Hacks Team updated the shop mod, but did not update any of the items/plugins.
I hope this helps.
Wiz
-
Hello:
When they updated SMF 1.x to SMF 2.0.2 they changed the core of how SMF works. The designers of SMF created a variant off some of the database code, and you now how to use that instead of the basic php/mySeql code we all know and love. It's been driving me crazy this new design. The worst part is they have not documented exactly what the new changes do. Some of the mod developers are working on a manual now.
How do I know this? Simple I have been working on a mini gallery and graphic items for the shop mod to work with smf 2.0.2. I have been driving all the coders crazy asking questions and getting help from who I can. If you want the lottery mod/plugin to work your going to have to post the database code on SMF comunity and ask for help in changing it.
On the plus side I am almost finished designing the new min gallery code and should have something cool to use next week.
Dumb as it sounds the SMF Hacks Team updated the shop mod, but did not update any of the items/plugins.
I hope this helps.
Wiz
Incidentally, one of the regulars over on SMF indicated this mod was probably for 1.1.x and was never upgraded for 2.0.x. I was hoping that the original author of this script was still providing support, but that no longer appears to be the case. Hopefully, one of the SMF Hacks Team can take a look and update this for 2.0.x, but otherwise I suppose I may not have any other alternative BUT to post the source code - as you suggested - and try to get help in making the necessary updates.
-
Links broken. Anyone have a working link? That would help.
-
Link broken..
-
Links broken!!!
-
I often get this error. It's not scary! Good luck)
1-855-865-9553 (http://reachcustomerservicenumber.com/sprint-customer-service/)