Webmasterpals  

Go Back   Webmasterpals > Webmasterpals Network > PHP Login Script v2.0

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2012, 05:04 PM
JimEdub JimEdub is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
JimEdub is on a distinguished road
Default Unlimited User Levels?

I'm trying to use this script to sell content and want to create a userlevel for each product. So, when user pays for product A, he can access product A page. If he buys product A and B, he can access A and B page. That too far from this scripts capabilities?

Last edited by JimEdub : 02-08-2012 at 05:05 PM. Reason: changes
Reply With Quote

DirTimes Web Directory - Premium General web directory of quality websites. Submit today!

Premium Web Directory - Premium general web directory. Submit your site for Inclusion

  #2  
Old 02-08-2012, 05:46 PM
Wombat76 Wombat76 is offline
Senior Member
 
Join Date: Mar 2011
Location: UK
Posts: 1,049
Wombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond reputeWombat76 has a reputation beyond repute
Default Re: Unlimited User Levels?

Quote:
Originally Posted by JimEdub View Post
I'm trying to use this script to sell content and want to create a userlevel for each product. So, when user pays for product A, he can access product A page. If he buys product A and B, he can access A and B page. That too far from this scripts capabilities?
Maximum number of products?
Reply With Quote
  #3  
Old 02-08-2012, 08:17 PM
weekendrockstar weekendrockstar is offline
Member
 
Join Date: Feb 2012
Posts: 74
weekendrockstar is on a distinguished road
Default Re: Unlimited User Levels?

I can think of a full work around while I'm at work this evening. One problem I foresee with your idea is that the system is designed to have one user level per member which would be a problem if one member paid for multiple products because then you would have to not only create a new level for each product but then you would need to create one for every single possible combination of multiple products being bought which would grow exponentially with each new product that you add.

The other method I can think of that works with how the script already works is to assign the user that paid for a product to the proper level and if they purchase more than one product that you'd have to reassign them to the user level for each other product that they bought. But this would cause a lot of back-and-forth communication. It won't be in a timely manner and end up being a huge headache for yourself and those purchasing your products which won't help you out. And it is generally a good idea to keep downloads available should a customer's hard drive fail or something and they lose the product which they paid for. They would have to contact you again about going through the process again to get what they paid for again.

Again, I will try to think of a workaround. This script works VERY well at what it does which is allow registration/activation of new members and force members to be logged in to view pages that you specify. But there are a lot of things people want it for that it simply cannot do without a good amount of modification.

I am currently working on several 'add ons' which use the framework set up by the Login Script so will be seamlessly integrated in any site using it for user management and password protection but will increase what one can do with the script as a whole. I am working on several features specifically for my own site but I will be packaging them up and offering them as add ons where you can pick and choose what, if any, you'd like to use.

For your case I think another column in the users database table would be necessary and it can contain the ID numbers of the products which they've purchased. Maybe make another form linked from admin.php where you can select a user and they'll be vertical list of all the available products with a checkbox for each product. You can check the boxes for whichever product(s) they have purchased. Then maybe off of myaccount.php have a section where a download link is created for each product whose ID you selected for that member. This would also help in the scenario I mentioned above regarding keeping downloads available for customers who purchased them in the event of catastrophic loss.

I am sure that I could code everything that I mentioned here but I am already working on a few that I need and will be offering to everyone. I'd have to wait until I got done programs that are necessary for me before I can put the time into something specific for one person. But you can keep in touch if interested and someone doesn't come up with an easier idea that you can work with.
Reply With Quote
  #4  
Old 02-09-2012, 05:15 AM
JimEdub JimEdub is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
JimEdub is on a distinguished road
Default Re: Unlimited User Levels?

I guess I was considering comma separated values (userlevels) they could access in the DB. So can use the same database column, but if it had 1,3,6,10 in it, user could access all pages that are restricted to those users and none else. (I'm not sure if this is possible within a db column?) I'm also unsure how to grant admin access to all of them in this scenario.

I do not have a big budget, but am willing to pay to customize this thing for my needs. Including comments, and ability to grant access to specific pages/products the way I"m suggesting.
Reply With Quote
  #5  
Old 02-09-2012, 07:38 AM
weekendrockstar weekendrockstar is offline
Member
 
Join Date: Feb 2012
Posts: 74
weekendrockstar is on a distinguished road
Default Re: Unlimited User Levels?

Technically you can use a comma delimited column however MySQL won't understand it as separate numbers of course and will treat it as one string. But with PHP you can use explode to split the string at the commas. However explode will take whatever is between each sets of commas and put it into an array. And it could be coded so that an the array can be broken down into each specific piece however you'd have to code for each individual item in the array. Which would be feasible if you're looking at, at most, 5 to 10 possibilities. But if in the long run you were to offer 300 products and someone purchased the right to download 298...you'd have to code for the eventuality of someone having access to every possible download. Which would then also mean that you would have to alter the array code every time you added another product for download.
Reply With Quote
  #6  
Old 02-10-2012, 01:34 PM
JimEdub JimEdub is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
JimEdub is on a distinguished road
Default Re: Unlimited User Levels?

yeah, I just want to add a product/userlevel, set a page only viewable to those who have been granted access to that product/userlevel, (preferably by adding the userlevel to the users in admin). So am I hearing it's not possible with this script?
Reply With Quote
  #7  
Old 02-10-2012, 02:09 PM
weekendrockstar weekendrockstar is offline
Member
 
Join Date: Feb 2012
Posts: 74
weekendrockstar is on a distinguished road
Default Re: Unlimited User Levels?

Well...yes, in theory it is possible as I'd mentioned before but it could cause quite a headache for you depending on how many products you're looking at. It can be implemented very simply as long as you keep the have only ONE level number per user. Problem with that would be like such:

With only three products to sell:
Lvl 1: product one
lvl 2: product two
lvl 3: product three
lvl 4: products one and two
lvl 5: products one and three
lvl 6: products two and three
lvl 7: products one, two and three.

Now with a fourth product added:
lvl 8: one and four
lvl 9: two and four
lvl 10: three and four
lvl 11: one, two and four
lvl 12: one, three and four,
lvl 13: one, two, three and four

So that's with only 4 products. Imagine if you plan to have 200+ products in your system at some point. But if you did that method you'd just have to add more options to the Lvl dropdown box in admin.php..just another 'option' for each level you need to have available. The form and database will be able to handle it fine otherwise.

And when you run page_protect on a page, even one you create, it will make the user's level available at which point you tell the script by way of code code what the user can do/be shown. Coding what they're able to do based on their user level is the tougher part.

But for selling products and making links available to users based upon specific product(s) purchased I would advise a different solution. Simply because if you try to stuff all product id's into the user level box then you run into the commas issue I discussed last. If you do it the way I suggested above..it would work very easily within the script but on whatever page where you want links to be shown to those that purchased them...you'd have to write A LOT of code as you have to tell the script what can be shown with EACH possible user level that it will pull out of a database. You'd also have to add even more code whenever you want to add another product.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 08:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Webmasterpals.com (c) 2008 - All Rights Reserved