473,465 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Program design help

I'm making a site that I'm having trouble wrapping my head around...it
makes sense in my head but I can't seem to figure out the best way to
code it.

Basically, there are different users levels...
beta, free, paid, etc...
and there are different user types
example: gamer, programmer, dog... etc
but each user has his own set of "objects" he can use...for example a
dog would have his bones, collar, etc
a gamer would have his PC, photos, videos etc... a programmer would
have his favorite projects, his current projects, his ideas, and to do
lists etc

and they can pay for new "objects" or "features" basically, I need to
figure out how to keep track of all this in the most optimized way as
possible... here's an example
User level: paid
User type: programmer
because he's a paying user, he gets all the objects for his user type,
make sense? so we need to then ON his "control panel" let him see the
objects he has since he's paid so like in a 3 column layout... blocks
on left and right and then a center column with.. whatever..so example
blocks would be, projects, blog...etc I hope this makes sense. any help
is much appreciated.

May 10 '06 #1
3 1135

bryan wrote:
I'm making a site that I'm having trouble wrapping my head around...it
makes sense in my head but I can't seem to figure out the best way to
code it.

Basically, there are different users levels...
beta, free, paid, etc...
and there are different user types
example: gamer, programmer, dog... etc
but each user has his own set of "objects" he can use...for example a
dog would have his bones, collar, etc
a gamer would have his PC, photos, videos etc... a programmer would
have his favorite projects, his current projects, his ideas, and to do
lists etc

and they can pay for new "objects" or "features" basically, I need to
figure out how to keep track of all this in the most optimized way as
possible... here's an example
User level: paid
User type: programmer
because he's a paying user, he gets all the objects for his user type,
make sense? so we need to then ON his "control panel" let him see the
objects he has since he's paid so like in a 3 column layout... blocks
on left and right and then a center column with.. whatever..so example
blocks would be, projects, blog...etc I hope this makes sense. any help
is much appreciated.


create three session variables

UserType
UserLevel

lets say that UserTyoe=1 is dog

If UserType=1 Then
give access to all dog objects
end if

Now to solve the type and level hieracrhy

If UserLevel=1 then
Case UserType
1: give access to all dog objects
2: give access to all gamer objects
......
End Case
elseif UserType=2 Then
Case UserType
1: give access to all dog objects
2: give access to all gamer objects
......
End Case
.....

and so on
Hope this helps
Zafar
--------------------------------------------------------------
http://www.vbuniverse.com

May 11 '06 #2
Yeah, help a little. THanks.

May 11 '06 #3

bryan wrote:
I'm making a site that I'm having trouble wrapping my head around...it
makes sense in my head but I can't seem to figure out the best way to
code it.

Basically, there are different users levels...
beta, free, paid, etc...
and there are different user types
example: gamer, programmer, dog... etc
but each user has his own set of "objects" he can use...for example a
dog would have his bones, collar, etc
a gamer would have his PC, photos, videos etc... a programmer would
have his favorite projects, his current projects, his ideas, and to do
lists etc

and they can pay for new "objects" or "features" basically, I need to
figure out how to keep track of all this in the most optimized way as
possible... here's an example
User level: paid
User type: programmer
because he's a paying user, he gets all the objects for his user type,
make sense? so we need to then ON his "control panel" let him see the
objects he has since he's paid so like in a 3 column layout... blocks
on left and right and then a center column with.. whatever..so example
blocks would be, projects, blog...etc I hope this makes sense. any help
is much appreciated.

The perfect place to use polymorphism. ;o)

Identify common properties for you users, e.g.

class user
{
var username;
var password;
}

then extend it for each user.

class programmer extends user
{
var favoriteLanguage;
}

class gamer extends user
{
var favoriteGame;
}

class dog extends user
{
var favoriteBone;
}
// store what kind of user they are in the database and at the top of
each page, instatiate that type. Actually, I'd create a "static" method
on user that returns the correct type.

e.g.
$currentUser = user::getUser($dbUserType); // get user return type of
dog, or whatever

Away you go.

Hope that helps.

May 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Nick Evans | last post by:
Hello there, I have been on and off learning to code (with python being the second language I have worked on after a bit of BASIC). What I really want to know is, if you are going to actually...
51
by: John Baker | last post by:
Hi: Some time ago I developed a program in Access, and separated the database and the program itself (using the normal access tools).We have the db on our server and the programin the desktop...
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
23
by: JoeC | last post by:
I am a self taught programmer and I have figured out most syntax but desigining my programs is a challenge. I realize that there are many ways to design a program but what are some good rules to...
13
by: ragtag99 | last post by:
I posted this on comp.lang.asm.x86, alt.os.development, comp.arch, comp.lang.c++ Im working with windows xp professional, NTFS and programming with MASM, c++ (free compiler) or visual basic 6.0...
6
by: phkram | last post by:
Hello everybody... i find this place very helpful. anyone who can help me solve the following problems? Thank you very much for helping me.. 1. Build a header file that consists of a class...
3
by: googlinggoogler | last post by:
Hi This should all be pretty standard C stuff, but I'm going to use terms like mouse callback to communicate what Im tyring to do. Basically I have my program whirling around in an infinite...
1
by: Readon Shaw | last post by:
I am planning a program using several types of data model. they share the same UI & logic. how to design such a program? is there any reference?
2
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
5
by: istillshine | last post by:
Particularly for medium-sized (10,000 ~ 20,000 lines) programs, what are useful strategies to design them before coding? My strategies are: 1. Imagine what the final program would look like....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.