PDA

View Full Version : Store addon: Staff discount


Dark Jim
18 Jan 2003, 17:10
With this hack you can change the costs of the store items depending on usergroups. For example you can set the cost to 25% for administrators, 50% for moderators and 100% for regular members.

Update 1/19/03: Fixed an error. Step 7 was wrong.
Update 1/18/03: Fixed an error. The final step was wrong.

Dark Jim
18 Jan 2003, 17:14
I may add more options if I can think of some. Also here's a screenshot when you edit a usergroup.

Graphics
18 Jan 2003, 17:18
Wow sweet man! Nice hack! :p I'll use this.

* Graphics clicks install

Mr. Brian
18 Jan 2003, 17:44
Yo! Nice one indeed. :p

Neo
18 Jan 2003, 18:26
HAHAH cool, but you think being a staff member you would get those items for free.

lordofgun
18 Jan 2003, 19:10
Originally posted by Neo
HAHAH cool, but you think being a staff member you would get those items for free.

Well you could just set the % to 0 and they WOULD get it for free. :D

Mr. Brian
18 Jan 2003, 19:17
Hi darkjim,

Is it possible to removed the 'Points' and replaced by something else?

E.g: Money, Golds, ect..


Thanks in advance.

Dark Jim
18 Jan 2003, 19:44
This has to do with the store hack in general, not just this addon. But you can change the name in the store config options. Just edit the field "Points Name".

Dean C
18 Jan 2003, 20:39
Wow this has to be the best idea for a store-addon

I think i'll install this one :)

Thanks

- miSt

NTLDR
18 Jan 2003, 20:55
I don't use the store hack, but this is a good idea :)

Link14716
18 Jan 2003, 22:10
DAMNIT! THIS WAS MY IDEA!

Well, figuring I never even said anything about it, it's amazing how people have the same ideas as me at almost the same time. Well, it saves me the trouble of making it. :)

Dark Jim
18 Jan 2003, 22:38
Please redownload the file and redo the last step. I made a mistake.

Ember
18 Jan 2003, 23:00
Wow, impressive idea! I will definatly be installing this one in the morning! :)

a43079
19 Jan 2003, 02:48
I installed it and i get this error

Fatal error: Unsupported operand types in C:\Program Files\Apache Group\Apache2\htdocs\forums\store.php on line 113

line 113 is $costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
$aw[costs] = round($aw[costs] * ($costpercent/100));

EchoHype.com
19 Jan 2003, 05:08
this is awesome dude

thanks!

Dark Jim
19 Jan 2003, 12:42
Originally posted by a43079
I installed it and i get this error

Fatal error: Unsupported operand types in C:\Program Files\Apache Group\Apache2\htdocs\forums\store.php on line 113

line 113 is $costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
$aw[costs] = round($aw[costs] * ($costpercent/100));

Gah another stupid mistake. Fixed on my own forums but put it wrong here. :confused:

To fix change ($costpercent/100) to ($costpercent[storecost]/100)
Instructions updated.

rjpa
19 Jan 2003, 14:26
Okey, thnx mate

Graphics
19 Jan 2003, 14:50
can this work with the itemshop?

Dark Jim
19 Jan 2003, 16:05
Originally posted by Graphics
can this work with the itemshop?
This hack will not work with the itemshop but I guess it is possible to make something like this for it. I won't be doing that though as I don't have the itemshop.

mx3
23 Jan 2003, 03:02
sounds good i might install later

Vile
24 Jan 2003, 22:47
Lol, cool idea, like an employee discount :D
I'll be installing this :)

Thanks.

LOD-squa
24 Jan 2003, 23:20
Thanks mate. ^^; now I have everything for free and mods 50% off.

sabret00the
23 Feb 2003, 18:30
great hack, well done for making it, i'll install it later

sonic3d
04 Mar 2003, 03:39
ne1 up to the challenge to make it work for the itemshop?

l8er
sonic

gerlando
01 May 2003, 16:04
I think this hack has an error with the give someone else a custom title. My users are getting a "not enough points" error even though they clearly DO have enough points. I think the store may be looking at the other users usergroupid to determine the price of the custom title. Anyone care to fix that? :)

gerlando
02 May 2003, 06:43
Ok, I figured out how to fix the error with giving other users custom titles.

Look for:
$checkcost=$contest[costs];

Change to:
$checkcost=round($contest[costs] * ($costpercent[storecost]/100));

Also, a little clean up. You could/should declare the $costpercent variable as a global.

Look for:
global $points, $usertitle, $username, $userid, $storename, $pointname, $glow, $italic;

Change to:
global $points, $usertitle, $username, $userid, $storename, $pointname, $glow, $italic, $costpercent;

then look for:
$username=$user++++[username];

and add BELOW:
$costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");

then remove all other instances of:
$costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");


since they're not needed. I hope that helps.

ImportPassion
06 Jul 2003, 00:31
i was looking for the code $username=$user++++[username];
and couldn't find it and realized that ++++ replaced shit
nice code, couldn't have used userstuff, or userinfo.

THanks for the fix gerlando!

D

tpearl5
02 Mar 2004, 23:55
Anyone have an update for v3.0 store hack for this

$cost=$contest[costs];

isn't in v3

Gio~Logist
26 Dec 2004, 18:11
Yea I Know!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!