Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Listings Manager Add-ons:
Allow Featured Listing for certain users

 

 


BuffaloWeb
User

Apr 14, 2006, 6:42 PM

Post #1 of 4 (5589 views)
Shortcut
Allow Featured Listing for certain users Can't Post

Hi all,

Can anyone think of a creative solution to this? I just installed the signup script add-on for a REalty site, and have that working fine. What I need to do now is to set it up to allow for two distinct user types: one that pays for a basic listing, and one that pays more for a featured listing. (Featured listings will be displayed on the homepage while regular listings are only visible via searches).

I know there is no (easy) way to add fields to users like you would with listing or homepage Setup options. What I was thinking was this:

1. Add a "Featured" field to Homepage Setup

2. Create two copies each of signup.cgi/signup.ini/_signup.html (rename one group to signup2.*). Modify linkages between the files to add the "2" so that the right files talk to the right files, and use signup2 to drive the "Featured User" signup. (I'd have my order form send one of two prices to PayPal, and have Paypal send the user back to either signup.cgi or signup2.cgi depending on the price paid).

** Alternatively, I'd assume that you could just use one file for both signups, and have PayPal pass a variable back that triggeres the desired action, but I just haven't looked into that part yet...

3. Add javascript code to _signup2.html that would take the username (as entered on the signup form by the user) and suffix it with something like "pro" (eg, johndoe --> johndoepro) and use this new string as the user_file (eg, homepage_filename.value = form.login_id.value + "pro"). Now you have a variable that differentiates users.

4. Add javascript to _search_results_featured.html that only displays the featured properties if the user_file placeholder contains the string "pro"



I assure you that this is certainly not elegant, but perhaps someone can come up with a better solution?

Thanks!


ross
Staff / Moderator


Apr 16, 2006, 9:26 AM

Post #2 of 4 (5537 views)
Shortcut
Re: [BuffaloWeb] Allow Featured Listing for certain users [In reply to] Can't Post

Hi.

Thanks for posting!

While there would definitely be some extra work there, I actually like you idea Smile. The signup script, as you have seen, is really setup to handle creating one kind of account at a time so you’ll need to have the two copies of it going.

I am not really a JavaScript guru but it does seem like appending the _pro to the end of the account names should work fine.

One thing I noticed is that you were wondering how to add new fields to your agents page. That’s actually done by editing the Homepage Fields from Setup Options. It sounds like you have already seen this but didn’t quite make the link. Have another look.

Of course, anyone with some details on setting something up like this, it would be great to hear from you Smile.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.




BuffaloWeb
User

Apr 16, 2006, 10:06 AM

Post #3 of 4 (5536 views)
Shortcut
Re: [ross] Allow Featured Listing for certain users [In reply to] Can't Post

Hey Ross,

What I ended up doing was duplicating signup.cgi/signup.ini/_signup.html (creating signup2.cgi/signup2.ini/_signup2.html). If the user signs up as a regular user, PayPal returns them to signup.cgi, if they signup for "Featured" status, PayPal returns them to signup2.cgi. signup.cgi works as it regularly would, but if they get sent to signup2.cgi, the script appends a "*" to the end of their name I had to use the name variable, since that is the only variable that can be manipulated in _signup2.html, and is accessible in search strings (that I could tell anyhow). I then use search strings to display only the listings marked "Yes" for featured AND have a user's name with a "*" in it. So, even if a "regular" user selects Yes for the Featured field, they will not get their listing displayed in the featured listings section since their name does not contain a "*" - pretty cool, eh?

Here's what to do (in case anyone else needs this):

1. Duplicate signup.cgi/signup.ini/_signup.html and save the copies as signup2.cgi/signup2.ini/_signup2.html.

2. Open signup2.cgi and change all occurences of signup.ini and _signup.html to signup2.ini and _signup2.html respectively.

3. Modify signup2.ini to suit any other needs for the "featured" users (eg, you could also use this method to allow signup.ini users to have 1 listing, signup2.ini to have 5 listings, etc... - create as many as you need!)

4. Modify _signup2.html... In the <head> section (you may need to create one, I forget...), add:

<script language="javascript">
var name = "";
var featured = "*";
function InitSaveVariables(form) {
name = form.name.value.replace(/[*]/g,"");
name = name+featured;
}
function NameHomepage(form) {
InitSaveVariables(form);
form.name.value = name;
}
</script>

This first strips out any "*" that the user may have used (eg, trying to trick the system!), and then appends "*" to their name (eg, Roger Smith*).

Modify your submit button to be:

<input type="submit" name="save_user" value="Create Account" onclick="javascript:NameHomepage(this.form);">

(You can modify value="Create Account" to read whatever you want, but NOTHING ELSE.



5. Setup your signup form (a separate html page with your signup form) with the correct PayPal action/parameters, and make sure that the form contains:

<input type="hidden" name="return" value="http://www.yourdomain.com/cgi-bin/listman/exec/signup.cgi"> for regular signups, or:

<input type="hidden" name="return" value="http://www.yourdomain.com/cgi-bin/listman/exec/signup2.cgi"> for "featured" signups

6. In your home page use this to include featured listings:

<!--#include virtual="/cgi-bin/listman/exec/search.cgi?search=1&perpage=6&lfield25_keyword=Yes&user_keyword=*&template=_search_results_featured.html" -->

Note that I am using Featured listings on my home page, and am using an include to do it. The important thing is that wherever/however you intend to display featured listings, you simply add "&lfield25_keyword=Yes&user_keyword=*" to qualify those listings that are set by the user to be featured, AND qualify the search to only return listings from USERS that have the "*".



That's it! So no when a user signs up for the "featured" services, PayPal sends them to signup2.cgi, which in turn appends a "*" to their name, which then allows their featured="Yes" listings to be displayed by including "&lfield25_keyword=Yes&user_keyword=*" in the search string...

Hope someone finds it useful!


ross
Staff / Moderator


Apr 16, 2006, 10:57 AM

Post #4 of 4 (5527 views)
Shortcut
Re: [BuffaloWeb] Allow Featured Listing for certain users [In reply to] Can't Post

Hi again!

Thanks so much for putting in all this extra effort!

I am always amazed at how much help everyone is able to offer in our message boards. Keep me up to date with how you are making out. If there is anything I can lend a hand with, let me know Smile.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4