I am trying to build my first Drupal directory. Building a basic directory using CCK and Views seems easy enough. I am have trouble with figuring out the best way to charge users to post certain nodes.
What I ideally want is for some users to be able to pay to get their entry to the top of the list. So, this would mean that the node would become "sticky" once the user has paid a fee. I can't seem to figure out a way to do that.
I have tried LM Paypal + CCK + user access control. I created two types of content using CCK. They were exactly the same (fields for all the necessary directory info) except that one was set to "sticky". I created a "premium" role and then in LM Paypal set it so that a user would get the "premium" role if they pay a fee. Then, I simply used access control so that normal users can create a normal directory entry, and "premium" members can create a directory entry that is "sticky".
This is ok, and at least does half the job. But there are two problems with it:
1) A premium user can create as many sticky nodes as he/she wants. Ideally, I would like to restrict it to a node by node basis.
2) If a member decides to be a normal user (ie, not pay), and then upgrades later to become a premium member, he/she would need to add their directory listing using the second content type.
I have tried pay per node, but seem to be going around in circles trying to get that to do anything useful.
Any ideas? It seems that what I am trying to achieving should be standard with any business directory, so hopefully we can figure out how to do this properly. But right now I am spending a lot of time trying to figure it would and I seem to have hit a brick wall!

Comments
An Update
I am making quite a lot of progress on my business directory using the following modules:
My ideal user experience is for users to add all of their directory info as they sign up, rather than the traditional sign up and then "create content". I have used Nodeprofile and CCK to achieve this. I have created a content type (using CCK) which has all of the necessary fields and then selected that as "Use this content type as a nodeprofile for users" (from Nodeprofile). You can then click on a new tab called "Node profile" and set it to ask the question from this content type during sign up.
I have used LM Paypal to create "premium" members. When someone subscribes and pays the fee, their role changes to "premium". I have used Views to create two seperate Views. One is to show all nodes (which is the profile of the user which has all the directory info) where the author is not a premium member (just authenticated member) and the other is to show nodes from authors that are premium. I then used View Fusion to join the two views together, the the "premium" view being on top, so that directory items from premium members are shown first. The big advantage here being that the profile is the same, it is just the role that changes. So a member can sign up as a basic member and enter their directory info and then decide later to become a premium member. He/she does not need to add the info again into a new content type, he/she just needs to pay and then his/her profile will appear at the top automatically because he/she will become a premium member.
The next phase is to allow premium members to add additional content that basic members can not. I think Michelle is doing this as well on another thread. This is proving to be a bit of a headache with the modules that I have selected. I have tried nodefamily and pageroute but have been unsuccessful so far. Essentially I want the additional fields to be part of the members profile and only premium members would be able to add this content. I have tried created a seperate "content type "(CCK) for this with the additional fields and then attaching it to the profile using nodefamily, but it did not work.
I'll keep playing with this, but if anyone has any suggestions, I would be most grateful.
Another option might be to not have additional fields, but allow premium members to do something that free/basic members can not, like have a blog or something.
--
BeFused - Drupal tutorials | Twitter @blairwadman
Thanks for giving some
Thanks for giving some insight into what you're doing here.
I especially like that your users are able to create a user profile that becomes their directory listing (my users have both, and some people get very confused by that).
Views Fusion being used like this is interesting. I'm not sure it would work for me as I have several different levels of subscriptions, plus I reward loyal customers with higher rankings (I have a printed version of my directory too, and each time they renew their printed listing, their ranking goes up - which is very manual at the moment).
That would be the Field Permissions module I think. From my understanding, if you're using CCK for your user profile node, then the Field Permissions should do exactly what you want.
You could do that, but I will need to have fields restricted to different roles too, and may others, so hopefully we can solve this problem without too much drama.
I'm obviously interested in how you did this, and whether it was easy or difficult (I haven't yet signed up for paypay, but I'm interested in the ease of integration).
Looks like you've been working hard.
I hope to be some more help further down the track.
Cheers,
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
tys
Tyswan
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
Thanks for your comments
Thanks for your comments Tys.
I will take a look at Field Permissions. Thanks for pointing that out.
I'm obviously interested in how you did this, and whether it was easy or difficult (I haven't yet signed up for paypay, but I'm interested in the ease of integration).
It took a lot of playing around to figure out how to do it and I tried Pay per node first, without luck. But now that I have done it, I can explain it to you quite easily. The LG Paypal module is actually quite easily to use. I'll write a tutorial on how to do it at some stage.
--
BeFused - Drupal tutorials | Twitter @blairwadman
Additional content for premium members
I'm working on a directory project as well and I created business profiles with about 5 different CCK content types combined by Pagerout and Nodefamily. When you do that, make sure additional content types are limited to 1 for each user and they are all child nodes of the main node that is chosen as node profile.
If you worked out role sponsorship, than why don't you let "basic" role have access to edit only main profile and "premium" have access to the rest of the profile which defined by other content types? It should be easy to do.
Also, I have a few questions:
About top placement of the "premium" roles: Let's say all records in the directory are categorized (doesn't matter by taxonomy or location), but we can not place unlimited amount of premium members to the top... even major search engines limit top placements to 3-4 listings. So, how this limitation can be implemented on per category bases? Let's say we defined 4 top spots per category... "premium" sponsorship for each particular category should be available until all spots are sold out. Any ideas?
Has anyone figured how to present their directories in DMOZ format?
I like using locations module to create simple geographic directory... combined with taxonomy terms it can be expanded into categories and geo-location.. the only problem right now I'm having is that Location module doesn't output provinces into the breadcrumbs, so breadcrumbs are broken. I also tried the Directory module... it's okay, but than you have to create a huge vocabulary that will have correct hierarchy of categories and locations in the same vocabulary... this makes vocabulary enormously huge and using this long taxonomy on the node edit page sucks... plus using location module + location category sounds like duplication of terms anyway.
I appreciate any suggestions.
Thanks!
Better breadcrumbs
I'm using the custom breadcrumbs module, which is nice, but it would be much better if someone could do this FR: http://drupal.org/node/149245 . Using the location module data in breadcrumbs in interesting... If that could be put in a token, then it would work with custom breadcrumbs.
Speaking of location, you guys might be interested in http://groups.drupal.org/node/6089 .
Michelle
Thanks for the link to the
Thanks for the link to the mapping group. BTW I just submitted a feature request for the Token module a few days ago
http://drupal.org/node/174154
Cool!
That would probably be easier for them than my feature request. Unfortunately, I suspect it may be the location module that needs to provide something to token, and getting ankur to do anything in the issue queue is like pulling teeth. :(
Michelle
Gemini, Your first question
Gemini,
Your first question is a good one. I am not sure of the answer though! My approach was simply going to be that premium member's listing get placed above free members. But this is far from ideal, especially if there are quite a few premium members.
One approach could be to have different levels and use the "Weight" module to weight the nodes dependent on the level. But I am not sure how one would restrict the number of members per level. Will have to give that one some thought.
--
BeFused - Drupal tutorials | Twitter @blairwadman
I was wondering about
I was wondering about Organic Groups module... I'm not familiar with it, but if it has limitations on the amount of people that can be in a group... this could be the answer. In this case there should be a group per category. It's all pretty vague to me right now.. I guess I'll look into it sometime. Or we could write a simple module that would count how many users with "premium" role in a particular category. That would be much easier.
P.S. not sure how useful is the weight module... in my current non-Drupal directory I have 4 top sponsored positions and 2 a the bottom of the page (of course top and the bottom are priced differently). Also the premium listings appear on every page of the category they belong to... this is in case if a particular category has multiple pages (pagination). Seams like with weight module you can only achieve top positioning and that would be only for the first page. The structure like I'm using could be done with 3 views all on the same page - 1 for top positions (limited to 4 w/o pagination), 2 for regular listings (limited to 10 with pagination), 3 for the bottom listings (limited to 2 w/o pagination).
Hiya Blairski, I had some
Hiya Blairski,
I had some suggestions for you earlier, but didn't have a chance to post them. It looks like some of these comments may no longer be relevant, but here they are anyway...
I'm glad you've worked out the Paypal/role assignment. I'll be looking at that in the next few months (probably November).
I'm not entirely sure of what you're trying to achieve here in terms of limiting the number of sticky nodes. Do you mean limiting by content-type?
In my system, each member can only create a single "directory profile" node.
I use UserNodes, to restrict the number of nodes of any given content-type. Unfortunately the module doesn't restrict by role and restrictions are across the board (for example I would like Admins to be able to create an unlimited number of nodes of any type).
Rather than having different content types for premium and non-prem users (which is what I have currently), I'd suggest you go down the path that Michelle has used and use a single content type, and try the CCK Field permissions module. I haven't used it, but Michelle might be able to give you some advice.
The reason I suggest this is that it will make your life a lot easier (honestly, I know by experience). At the end of the day, the two types of listings want to be treated as the same from a business model perspective, it's just that one is enhanced. Once you create two different content types, then reporting can become a nightmare (using custom queries, unions and the like - although you're using ViewsFusion, so that would overcome some of the problems I had with Unions), as well as the issue you've brought up about upgrading users.
Also, in terms of "sticky" nodes, you might want to experiment with the Node Weight module, which is what I use. You can rank nodes in any order, and with any "range" you'd like (I think the default is -20 to 20). This could make expansion of your subscription system easier if you want to add subscription levels. Just a thought.
Cheers,
--
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
tys
Tyswan
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
The Node Weight module looks
The Node Weight module looks interesting. I'll take a look at that. That should definitely help with having different subscription levels.
I'm not entirely sure of what you're trying to achieve here in terms of limiting the number of sticky nodes. Do you mean limiting by content-type?
By that I meant that I wanted users to be able to pay to have one premium node, rather then paying to become a premium member with the ability to create unlimited premium nodes. But it doesn't matter now that it is profile driven.
Something else I am looking at at the moment is using Organic Groups for premium members. So a premium member can add a blog and by using organic groups, it is grouped with the members directory listing (profile node). I can't seem to restrict access to organic groups to a particular role, but I can restrict the ability to create a blog to a role.
Organic Groups seems to be a great way to give premium members some real added benefits.
--
BeFused - Drupal tutorials | Twitter @blairwadman
Premium fields
I haven't tried it, yet, but I plan to make an admin-only field "Expanded". With this field, I can control the fields that show on the input form as well as the display of the node. To begin with, I'll manually set the field myself but I hope to automate it eventually.
Michelle