vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Lottery Addon For The Store Hack (https://vborg.vbsupport.ru/showthread.php?t=40056)

Lesane 08-13-2002 11:32 AM

Quote:

Originally posted by Mist
is there any way of changing the amount a ticket costs?

Thanks in Advance

- Mist

You can do that by going to the "Lottery" action.

Lesane 08-13-2002 11:37 AM

Quote:

Originally posted by xxxsaint
I am having the same problem that another guy posted on here , everything installed just fine, and when I created my lottery in admin cp it went just fine , but when I try to purchase a ticket all I get is a white page and no ticket is purchased. Please help :D
Did you changed anything? Upgraded to an other vbulletin version?

xxxsaint 08-13-2002 11:41 AM

no sir , 2.2.6 all the way , no other changes

www.tdleague.com/forums

Lesane 08-13-2002 11:51 AM

Quote:

Originally posted by BluSmurf


I'm having problem with this, I placed $jackpot in forumhome template but on the index page it didn't show up. Any help?

Put this code in index.php:

PHP Code:

if ($lot=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber='1'")) {
  
$jackpot="Current Lottery Fund is now: $lot[jackpot]";
} else {
$jackpot="";


You can put it before:

PHP Code:

//Most Popular Thread by Replies 

And don't forget to put $jackpot in the forumhome template. That should work.

Lesane 08-13-2002 11:51 AM

Quote:

Originally posted by DestyNova


Me either, it didnt show up.

Lesane, Do I have to put your jackpot codes in right place or? since I dont know which so I put it below ?> in index.php but it doesnt work anyway

Any idea?

Look the post above this one. :)

Lesane 08-13-2002 11:55 AM

Quote:

Originally posted by BluSmurf
no one can figure out why we're having blank pages?
Did you changed anything, like a vbulletin upgrade or did you host upgraded to a new php/mysql version?

xxxsaint 08-13-2002 11:59 AM

no new host upgrades either :(

Lesane 08-13-2002 12:11 PM

Look if you have these 2 templates:

store_lottery_error

And:

store_lottery

xxxsaint 08-13-2002 12:15 PM

yes i have

store_lottery
store_lottery_error
store_lottery_updated

Lesane 08-13-2002 12:19 PM

Send me your store.php by pm and could u give me the result of this query:

PHP Code:

SELECT FROM storelottery WHERE lotnumber='1' 


xxxsaint 08-13-2002 12:39 PM

sent the store.php and the result of running that query in php my admin is

http://www.tdleague.com/images/sql.jpg

Lesane 08-13-2002 12:56 PM

I checked your store.php and you don't even have the lottery code in it.

You forget the most important step in the instruction file:

PHP Code:

**********************************
Open fileroot/store.php
**********************************
--------
Find(on the end of the file):
--------

?>

--------
Add BEFORE it:
--------

// ###################### Start Lottery #######################
if ($action=="lottery") {

  $lott = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
  $storeid=$lott[id];
  $cost=$lott[costs];
  $need=$points - $cost;
  
if ($cost>$points) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}

if ($reet=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber='2' AND userid='$bbuserinfo[userid]'")) {
       eval("standarderror(\"".gettemplate('store_lottery_error')."\");");
       } else {
eval("dooutput(\"".gettemplate("store_lottery")."\");");
}
}

// ###################### Start Lottery Update #######################
if ($action=="lotteryupdate") {

if ($reet=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber='2' AND userid='$bbuserinfo[userid]'")) {
       eval("standarderror(\"".gettemplate('store_lottery_error')."\");");
       }

$contest = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
$checkcost=$contest[costs];
if ($checkcost != $cost) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}

if ($checkcost>$points) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}

$addlot = $DB_site->query("INSERT INTO storelottery (id,lotnumber,lotname,jackpot,startdate,enddate,userid,username) VALUES (NULL,'2','0','0','0','0','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."')");
$changeusernow = $DB_site->query("UPDATE user SET storep=storep-$cost WHERE userid='$bbuserinfo[userid]'");
$changestorenow = $DB_site->query("UPDATE store SET sold=sold+1 WHERE id=$storeid");
$updatelottery = $DB_site->query("UPDATE storelottery SET jackpot=jackpot+$cost WHERE lotnumber='1'");
$storequant = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
if ($storequant[quantity]=='0') {
$ilove++++++s="";
} elseif ($storequant[quantity]=='1') {
$closequan = $DB_site->query("UPDATE store SET quantity='0', ok='N' WHERE id=$storeid");
} else {
$updatequan = $DB_site->query("UPDATE store SET quantity=quantity-1 WHERE id=$storeid");
}
$moneycheck = $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$money = $moneycheck[storep];
eval("dooutput(\"".gettemplate("store_lottery_updated")."\");");
}

**********************************
Save file: root/store.php
********************************** 

You have the action code "lotteryupdate" in it but u don't have the action code "lottery" in it.

xxxsaint 08-13-2002 01:01 PM

WHOOOOHOOOOO!!!!!

man ty ty ty

I looked and looked and looked but since i'm a noobie i didn't catch that , thanks so much for all your time and support !!!!

xxxsaint 08-13-2002 01:04 PM

man we have been wanting that hack to work so bad , where do you vote around here for hacker of the year , this guy gets my vote , he even came to my forums and checked it out.

awesome job :D :D :D :D

Dean C 08-13-2002 01:07 PM

Quote:

Originally posted by Lesane


You can do that by going to the "Lottery" action.

where?

Lesane 08-13-2002 01:16 PM

Quote:

Originally posted by xxxsaint
WHOOOOHOOOOO!!!!!

man ty ty ty

I looked and looked and looked but since i'm a noobie i didn't catch that , thanks so much for all your time and support !!!!

You're Welcome :bunny:

Lesane 08-13-2002 01:17 PM

Quote:

Originally posted by xxxsaint
man we have been wanting that hack to work so bad , where do you vote around here for hacker of the year , this guy gets my vote , he even came to my forums and checked it out.

awesome job :D :D :D :D

haha :D

Lesane 08-13-2002 01:18 PM

Quote:

Originally posted by Mist


where?

Admincp -> Veb Store -> View/Modify Actions -> Lottery -> Edit -> Costs

Dean C 08-13-2002 01:37 PM

thanks :D

BluSmurf 08-13-2002 05:51 PM

Hi Lesane,

here's the result of the query
mysql> SELECT * FROM storelottery WHERE lotnumber='1';
Empty set (0.00 sec)

and attachment of my store.php

BluSmurf 08-13-2002 05:53 PM

I've added another lottery and the query result as below
mysql> SELECT * FROM storelottery WHERE lotnumber='1';
+----+-----------+--------------------------------+---------+------------+------------+--------+----------+
| id | lotnumber | lotname | jackpot | startdate | enddate | userid | username |
+----+-----------+--------------------------------+---------+------------+------------+--------+----------+
| 1 | 1 | SoccerMamak Weekend Lottery #2 | 200 | 1029297600 | 1029643200 | 0 | 0 |
+----+-----------+--------------------------------+---------+------------+------------+--------+----------+
1 row in set (0.00 sec)

But I'm still unable to buy a lottery because the page is blank :(

Mr_P 08-13-2002 06:00 PM

Lesane if u do get around to reading this id like to thank you for all teh support u gave in this post but like to know one more thing regarding this hack.

How do we get it to show on main index page how many have been sold for the current draw.

I have on main page how much is in the lottery so the 2 would go nice together.

Anyone got a decent lotto Gif ?????//

DestyNova 08-13-2002 06:20 PM

Quote:

Originally posted by Mr_P
Lesane if u do get around to reading this id like to thank you for all teh support u gave in this post but like to know one more thing regarding this hack.

How do we get it to show on main index page how many have been sold for the current draw.

I have on main page how much is in the lottery so the 2 would go nice together.

Anyone got a decent lotto Gif ?????//

ditto, I want to know how to get that display on forumhome

Mr_P 08-13-2002 06:55 PM

im back again with another small idea - for such a small hack the ideas are endless

Ok on index page how about the winners avator being displayed till the next lottery is won ? where it is then replaced by the new winners and if the winner dont have an avator then we can use a pre made one.

This on front page with money in lottery and how many tickets sold would look smart in a nice little box i got for it.
I mean come on if you won and you got the ugliest avator everyone is forced to see it for a week (hmm and i do have a sense of humour,so is this possible Lesane)

Lesane 08-13-2002 08:23 PM

Quote:

Originally posted by BluSmurf
Hi Lesane,

here's the result of the query
mysql> SELECT * FROM storelottery WHERE lotnumber='1';
Empty set (0.00 sec)

and attachment of my store.php

BluSmurf, you don't have the lottery code in the store.php so it never can function properly. Look on the instructions again.

Lesane 08-13-2002 08:36 PM

Quote:

Originally posted by Mr_P
Lesane if u do get around to reading this id like to thank you for all teh support u gave in this post but like to know one more thing regarding this hack.

How do we get it to show on main index page how many have been sold for the current draw.

I have on main page how much is in the lottery so the 2 would go nice together.

Anyone got a decent lotto Gif ?????//

If you have the code in root/index.php wich i gave before, on this post: https://vborg.vbsupport.ru/showthrea...353#post284353

Then find this line:

PHP Code:

$jackpot="Current Lottery Fund is now: $lot[jackpot]"

And change it to:

PHP Code:

$cost $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
$jackpot="Current Lottery Fund is now: $lot[jackpot]<br>Ticket's sold: $cost[sold]"


Mr_P 08-13-2002 10:29 PM

Excellant and works a treat - wish there was someway to rate a hacker on this board not just for his hacks but also for the feedback they give to other users as theres some good ones on here.

Anyway thanks a million Lesane,it may only have been a small thing but once i did it i seen the amount of tickets sold from 12 to 33.

Goes to show - Its all in the packaging.

Karmed m8 if i could.

tpearl5 08-14-2002 05:06 AM

Quote:

Originally posted by Lesane


Wich mysql version are you using?

http://degster.com/phpinfo.php

3.22.32 :(

I had a feeling it had something to do with that.

Lesane 08-14-2002 09:05 AM

Quote:

Originally posted by tpearl5


http://degster.com/phpinfo.php

3.22.32 :(

I had a feeling it had something to do with that.

You are using an old mysql version wich don't support that way of choosing a random user. Mysql version 3.23+ supports the "order by rand" function.

Try this way:

Open the file: admin/storeadmin.php

Find:

PHP Code:

$findus=$DB_site->query_first("SELECT * FROM user ORDER BY RAND() desc LIMIT 1"); 

And change it to:

PHP Code:

$findus=$DB_site->query_first("select *, rand() as r from user order by r limit 1;"); 


Lesane 08-14-2002 09:07 AM

Quote:

Originally posted by Mr_P
Excellant and works a treat - wish there was someway to rate a hacker on this board not just for his hacks but also for the feedback they give to other users as theres some good ones on here.

Anyway thanks a million Lesane,it may only have been a small thing but once i did it i seen the amount of tickets sold from 12 to 33.

Goes to show - Its all in the packaging.

Karmed m8 if i could.

You're welcome Mr_p :)

tpearl5 08-14-2002 08:40 PM

Quote:

Originally posted by Lesane


You are using an old mysql version wich don't support that way of choosing a random user. Mysql version 3.23+ supports the "order by rand" function.

Yep! that did the trick. Cept I changed it to pick from the storelottery table so it looks like:
PHP Code:

$findus=$DB_site->query_first("select *, rand() as r from storelottery where lotnumber=2 order by r limit 1;"); 

You rawk Lesane! :)

Now I just need to get the display on the main page working. http://degster.com/midi/board/ Nothing shows up? (should be right under member # and above newest member)

Larz 08-25-2002 04:22 PM

Lesane, amazing work man. :) I installed the store yesterday, and my board had over 1000 new posts the same day, that's triple the usual amount. Today is lottery day, and the users are loving it.

I just still (!) can't make the lottery jackpot display on the index.php. I tried every step in this thread, and it just doesn't display.

I am wondering if I'm doing something wrong - I don't have this:
Quote:

//Most Popular Thread by Replies
in my index.php either?

Board is http://gamesdebat.jubii.dk by the way...

Lesane 08-25-2002 04:37 PM

You're welcome.

The forumhome code on this post works great, it's tested.
https://vborg.vbsupport.ru/showthrea...353#post284353

You can add the code before:

PHP Code:

// get newest member 


Larz 08-25-2002 05:18 PM

It still does not work...

Index.php attached.

One other thing, the colors on the page where you're shown the cost of the lottery tickey are off on my board, they're some shade of blue and my board is in grey only.

Lesane 08-25-2002 06:34 PM

2 things:

1. There must be an active lottery.
2. Maybe you forgot to put the variable $jackpot in the forumhome template.

Larz 08-25-2002 06:36 PM

I have a lottery going and about 5 different $jackpots in various places in forumhome, without anything happening. :(

N9ne 08-26-2002 01:32 PM

Hi Lesane, how could I remove the upper limit for the jackpot for the lottery, which is 32000 or something right now?

dgessler 09-01-2002 01:32 AM

Quicky Question: Did anyone figure out how to fix the extra line of space below the username when a user has glow on?

Thanks,
Dan

tpearl5 09-01-2002 01:44 AM

That's related to the store hack itself, but if you put the glow tag in a table than it won't return. i.e. http://degster.com/midi/board/t2604.html

Peace 09-05-2002 04:34 PM

Lesane, how can I change the PM from "Dear Loser" to Dear Member"?


All times are GMT. The time now is 03:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02532 seconds
  • Memory Usage 1,856KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete