PHP Coders... by SkY2k 2015/09/01 18:25
We're you'll at?...I need some ideas from you guys on a project I'm currently busy with :)

Sorry if I posted in the wrong forum as I cannot find a suitable forum to post this...many thanks...
jaQui 2015/09/01 18:31
How can i assist you.?
NinthElement 2015/09/01 18:37
Quote: sky2k: We're you'll at?...I need some ideas from you guys on a project I'm currently busy with /smiley

Sorry if I posted in the wrong forum as I cannot find a suitable forum to post this...many thanks...
This is the right forum /smiley Let me know what advice you need.

SkY2k 2015/09/01 18:45
The code I'm trying to figure out is how to create levels...for example there is 10 items for sale...but only item 1 is viewable cos the others are locked...now the person has to has to play the unlocked item like 20 times until he gets to the next level...but he wouldn't unlock the next item in level 2 cos only when he makes enough points then the next item will unlock...well I know how to code the points to unlock the next item but I'm struggling with the level system atm....any ideas?
NinthElement 2015/09/01 20:09
Quote: sky2k: The code I'm trying to figure out is how to create levels...for example there is 10 items for sale...but only item 1 is viewable cos the others are locked...now the person has to has to play the unlocked item like 20 times until he gets to the next level...but he wouldn't unlock the next item in level 2 cos only when he makes enough points then the next item will unlock...well I know how to code the points to unlock the next item but I'm struggling with the level system atm....any ideas?
Assuming you just want to test for entitlement it sounds like you simply want a column on your users table for the total sales and level, then after each sale call those values.

And then

if (*level less than 2 && sales > 19 )
mysql_query( "update users set level =2" );

Or if the levels are going to be predetermined by sales anyway you can just use the total sales variable to define the level on the sales page

if (*sales >19) *level =2;
if (*sales > 39) *level =3;
etc

I hope I understood what you wanted correctly.

SkY2k 2015/09/01 20:19
Quote: Ragnorak: Assuming you just want to test for entitlement it sounds like you simply want a column on your users table for the total sales and level, then after each sale call those values.

And then

if (*level less than 2 && sales > 19 )
mysql_query( "update users set level =2" );

Or if the levels are going to be predetermined by sales anyway you can just use the total sales variable to define the level on the sales page

if (*sales >19) *level =2;
if (*sales > 39) *level =3;
etc

I hope I understood what you wanted correctly.


Sure bro,you just opened my brain now,gonna try this tomorrow, many thanks /smiley

EpIcInCoGnItO 2015/09/02 13:15
I think and as Liam bro correctly said it has to be with if and else statement, you could create a variable for the levels though, it has to be if and else or if else.
Quote: sky2k:

Sure bro,you just opened my brain now,gonna try this tomorrow, many thanks /smiley

EpIcInCoGnItO 2015/09/02 13:16
/smiley Spot on. In my case I coded the level on the profile but I am also thinking it to add it to the column on users.
Quote: Ragnorak: Assuming you just want to test for entitlement it sounds like you simply want a column on your users table for the total sales and level, then after each sale call those values.

And then

if (*level less than 2 && sales > 19 )
mysql_query( "update users set level =2" );

Or if the levels are going to be predetermined by sales anyway you can just use the total sales variable to define the level on the sales page

if (*sales >19) *level =2;
if (*sales > 39) *level =3;
etc

I hope I understood what you wanted correctly.

#69 Phones/PCs/Apps
For phones, computing, consoles, gadgets, & internet talk, plus share apps & other files.
Forums