PDA

View Full Version : Random Group Sort & Store Hack Thing Request


yzztik
08-13-2002, 09:36 PM
Hello, I am a new vb user and have a request for those lovely hack makers out there :)

what I need is a point system, store, groups thing. Read on to see what I mean. I hope one of you kind souls can help me :)

- When a new user signs up, they get randomly placed in 1 of 6 groups.

- Each of these groups would have a special access to a hidden forum, (one hidden forum per group) which should be granted automatically upon being placed in that group.

- individual members earn "money" (points) by "working" (performing actions ... like in the store hack)

- in addition to that, in each group, there needs to be a total ammount of "money" that group has. (aka add up all the "money" from individual users in the group)

- a page that shows how much "money" each group has, the "richest" people, etc.

- a page that alows members to see their "money" and spend it and share it (like the store hack).

- allow admins/mods to give users and groups "money".

OK, I think that's it. Questions? Feel free to ask. Thank you in advance to whomever can help me :)

Xenon
08-13-2002, 10:34 PM
hmm, i think most of this can be done by modifying the store hack...

you can sum the money of a group when you use for example this code:
$group=$DB_site->query_first("SELECT SUM(money) AS summoney FROM user WHERE usergroupid=XX")
then you should be able to use $group[summoney] for groups money..

register in a random group:

open register.php

find:
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signa ture,adminemail,showemail,invisible,usertitle,join date,cookieuser,daysprune,lastvisit,lastactivity,u sergroupid,timezoneoffset,emailnotification,receiv epm,emailonpm,options,birthday,maxposts,startofwee k,ipaddress,pmpopup,referrerid,nosessionhash,avata rid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes(md5($password))."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm',' $options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$avatarid')");


before that add:
$newusergroupid=rand(xx,yy);

replace xx, with usergroupid of lowest group, and yy with id of the upper group (be sure all groups are in a block bigger than 7)

yzztik
08-14-2002, 01:08 AM
Thanks for the quick reply. I got one more question ... Where should I put that first sequence for it to work? Because I just tried and didn't work :(

Link14716
08-14-2002, 01:36 AM
Heh, this sounds interesting ;)

if only my board got more than 2 posts a day :(

yzztik
08-17-2002, 05:58 PM
Ok I got the store working and members having individual money. I also got to automatically place them into groups upon sign on. The only thing I need is a way to display the total money of one group ... aka ... add up all their money and display that. In addition, I would like to be abe to add money to the group and it distribute it evenly to each individual.

Anyone got any ideas?

VirtualHogwarts
11-30-2003, 08:46 PM
BUMP! HOw do you get the ..

$group=$DB_site->query_first("SELECT SUM(money) AS summoney FROM user WHERE usergroupid=XX")

to work what do you find? i have 4 usergroups for it to work with 8 9 10 and 11 ... and then what would I do to post it in like a thread or something? I don't know how to make a php file and im not using the store so it's just the point system but this is perfect for me thanks! I also needed the random registar! and that worked prefect. So ... any ideas on that? (To get group money)

VirtualHogwarts
11-30-2003, 09:03 PM
You helped him with this and I am sure your help was right but where should we put it and can you be a little more detailed to it?

What i got from it is you put this ...

$group=$DB_site->query_first("SELECT SUM(money) AS summoney FROM user WHERE usergroupid=XX")

in store.php somewhere? (but where)

and then change the XX to the usergroup you want to total their points right?

then in a template or whereever in the vB put ...

$group[summoney] and it will what? show all their points put together?

So you could do

Group 1: $group[summoney]
Group 2: $group[summoney] ... ahh ha! Problem .. its only 1 userid so i figured ...

back to this ...


$group=$DB_site->query_first("SELECT SUM(money) AS summoney FROM user WHERE usergroupid=XX")


lets say the usergouws were ... 8 9 10 and 11

$group=$DB_site->query_first("SELECT SUM(money) AS gryffindors FROM user WHERE usergroupid=8")

$group=$DB_site->query_first("SELECT SUM(money) AS slytherins FROM user WHERE usergroupid=9")

$group=$DB_site->query_first("SELECT SUM(money) AS ravenclaws FROM user WHERE usergroupid=10")

$group=$DB_site->query_first("SELECT SUM(money) AS hufflepuffs FROM user WHERE usergroupid=11")

put them somewhere in store and then ... put

$group[hufflepuffs]
$group[ravenclaws]
$group[slytherins]
$group[gryffindors]

right??? or what please either PM me back or reply! Thanks!