We need to create a different type of online subscription: instead of all subscribers receiving the same publication/access at the same time, every new subscriber will first receive edition #1, then edition #2 the following week, then edition #3 and so on. Sort of like serialized book chapters or training sessions. So my recent discovery of Ubercart was like a godsend, with its support for subscriptions, files and roles. What I can't work out is how to manage roles so that each group of subscribers (based on when they sign up) can access only the editions they are entitled to. For example, a subscriber in week one of their subscription will receive edition #1 at the same time that a subscriber in week two will receive edition #2, and so on. Well, I can work out how to manage the roles manually, but that's going to get messy. At least the editions will finish at #52, but even so that's a lot of roles to deal with. Oh yeah, and there will be two types of subscriptions: six-monthly and annual. Any pointers, anyone? I'd be extremely grateful for any ideas on how to automate this as much as possible.
Sequential subscriptions
|
|
Seems it might be a bit complicated, but I imagine a custom node that creates a table, which tracks your users' uid, their role and their nodes. The module would need to invoke Cron and during the cron-run, go user-by-user to discover what node is next to unlock for each specific user (or maybe more efficiently, start each user as owning "Node 1" (or whatever the first publication would be).. and then during the cronrun you would just increment the available nid by 1.
Then with an invocation of hook_nodeapi(), in the "view" case, first check that the node is of the node type you've created, and then check to see if the user is allowed access to that node (by way of your custom module's table I mentioned in the previous paragraph). At that point it's easy enough to deny a user access to the node, if the node's nid is not associated with their uid; or to allow them access if the opposite is true.
That's how I'd approach it, but there might be more succint ways to go about it 
EDIT: Thinking about it again, I'm not sure if Cron is the best way to go - since hooking into the subscriptions module might be better and cleaner. Unfortunately I don't have any experience in that module yet, perhaps someone who has could shed more light on it.
Yeah, I didn't think there would be an out-of-the-box solution. I've also considered an LMS like Moodle (with Moodle/Drupal or Moodle/Joomla bridge to handle blog, forums and the rest of the site). But I'd much prefer to stay with module like Ubercart which is more elegant and tightly integrated with Drupal. Anyway, thanks for your quick response, Dalton. I'll try your first idea, unless someone else can help with Dalton's second idea (hooking into the subscriptions module)?
Don't know whether this will work, but you might play around with Workflow-ng and see if that gets you anywhere. The initial role granted upon purchase could give permission to access edition #1 - this initial role would be set to expire in 1 month. A Workflow-ng condition could be set up to grant a NEW role (with permission to access edition #2) upon expiration of the first role. Etc. This method can even be used to send automatic e-mails notifying the customer of the availability of the new edition.
|
|




Joined: 04/29/2008