Start a new topic
Answered

How to add additional information to the search results that show only for specific membership levels

How can I add additional information (fields, columns, text) to the search results that show only for specific membership levels. In my case, I want to show some additional information that will only show for paying members.


Please see the video below for a quick explanation if in doubt:


Video 1http://screencast.com/t/dahyyx3N 


Video 2http://screencast.com/t/Z0H7Hjxu2tq


Video 3http://screencast.com/t/qcmClrUKRra


- Original Question & Videos by Samuel


Best Answer

Hi Samuel, I have updated this post to merge and / or separate the questions made on each video. So with that in mind, here I go:


Video 1http://screencast.com/t/dahyyx3N 


My recommended simple way would be, on your Admin Panel Dashboard:


1. Go to Members -> Membership Features


2. Find the Listing Feature and click on Edit


3. Grab a cold beer and prepare for an amazing thrilling ride!! .... geek style :)


4. On your Listing Feature edit page, go to the Search Results Settings Section.


5. Once in this section, find the text area that says Page Loop.


6. Go to around Line 22 (This can vary), the line should say something along the lines of <td class="info">


7. Inside this <td> we can add an example field, for example let's add some text that shows depending on the level of the specific  member's membership level. My example code is this:


    

<td class="info">
    <? if ($user_data[quote]!="") { ?>
	<p><?=$user_data[quote]?></p>
    <? } else if ($profileservices!="") { ?>
	<p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
    <? } 
    $userInformation = getUser($_COOKIE[userid],$w);
    if ($userInformation[subscription_id] == '4') {
        echo "This Text can only be seen by a Free Member";
    } else { 
       echo "CONGRATULATIONS!! You are an awesome paying member. Girls love you, Men wanna be just like you and I will name my baby after you."; 
    }
    ?>
   <table>.......

    

This would simply show a text on each search result that will see if the member is a particular membership level and if yes, add some text to it.


Now, after testing this code and seeing how it works and adjusting it to your needs, you can go one step forward and simply visually show the text ONLY, if the logged in user has a specific membership level. This can be done by changing the $user_data[subscription_id] part of the code to getUser($_COOKIE[userid],$w). This way, you will grab not the membership level of the already registered members but the membership levels of the client viewing the content.



Video 2http://screencast.com/t/Z0H7Hjxu2tq


For the 2nd video, The best and easy way of doing it is this:


1. On your back-end, Go to Toolbox -> Form Manager and select the Listing Contact Form.

2. Inside the Listing Contact Form, click on the Add New Field button and create a new field. This new field should have the column header's name from your CSV the same as the variable name input box, so for example, if the new column on your CSV is called Delivery Mode, you need to rename it to deliverymode and also name the variable name field in the form as deliverymode (No spaces, preferably lower case).

The end result should be that the name of the header on your CSV for that specific field is deliverymode, and the variable name for that field in the form should also named that way. Here is an image of an example for it:



In the image above I have circled in red where the variable name is. This should be EXACTLY the same as the header of your new columns. In your video example, you have Delivery Mode and Financial Aid. They should be renamed to something like "deliverymode" and "financialaid". You also need to add as many fields as new columns there are in your CSV. So in this case, you need to add another Field to the form, for the Financial Aid column on your CSV.


4. Save the form after adding all fields needed by your CSV.


5. After the CSV has the correct header names for the new columns, you can simply import it to your system. The BD system will know where to send the extra columns because it will look into all variables of the system and see for example, that your deliverymode header on your CSV is the same name as the deliverymode field variable on your Listing Contact form.


6. After importing your new information we can proceed on adding it to your system's result page. By reusing the answer i gave to Video 1, we can simply call the value for that new field like this:

 

 $userInformation[deliverymode];

 

So for example, you could show the new field like this:


 

<td class="info">
    <? if ($user_data[quote]!="") { ?>
	<p><?=$user_data[quote]?></p>
    <? } else if ($profileservices!="") { ?>
	<p>Specialties: <?= $userInformation[deliverymode];?></p>
    <? } ?>
   <table>.......

 

In this example, in the Specialties parragraph, you would see the information for the deliverymode.


Now in regards to what information you wish to show, in what order you wish to show it and any other customization, you can simply edit the order in which they appear in the PHP code mentioned above. For example, here are 2 codes:


  

<td class="info">
			<?php $userInformation = getUser($_COOKIE[userid],$w); ?>
                        <? if ($user_data[quote]!="") { ?>
                            <p><?=$user_data[quote]?></p>
                            <? } else if ($profileservices!="") { ?>

                            <p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
			    <p>Tags: <?=$userinformation[metatags]?></p>
                            <? } 
                            ?>

  

In this example, a Field called Tags is shown after the Specialties.


 

<td class="info">
			<?php $userInformation = getUser($_COOKIE[userid],$w); ?>
                        <? if ($user_data[quote]!="") { ?>
                            <p><?=$user_data[quote]?></p>
                            <? } else if ($profileservices!="") { ?>
			    <p>Tags: <?=$userinformation[metatags]?></p>
                            <p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
                            <? } 
                            ?>

 

In this example, a Field called Tags is shown before the Specialties. This gives an idea on how we can show the information, in what order, how we can call it and more.


Video 3http://screencast.com/t/qcmClrUKRra


In regards to the 3rd video, here is my coding recommendation:


1. Create an array that has the id value of the member you wish to personalized and the messages you wish to add to their results when found. For example:


 

    $customizedMessage = array( "452" => "Best Member Award", "122" => "Australian Coding Partner", "334" => "Blue Ribbon Member", "76" => "Gold Hobbit Member");

 


2. Using the $user_data[subscription_id] I mentioned above, you can do an IF statement where, if the client IS that particular ID in the array above, then change the text you wish to show with the specific text in the Array. For example if the user ID is 122 then the text displayed would be "Australian Coding Partner".


3. This can then be extended to any amount of premium members and even extended to show to only specific members, membership levels and more.



Let me know if this helped you Samuel and as always, I am glad to give you a helping hand. Big hugs buddy. 


Answer

Hi Samuel, I have updated this post to merge and / or separate the questions made on each video. So with that in mind, here I go:


Video 1http://screencast.com/t/dahyyx3N 


My recommended simple way would be, on your Admin Panel Dashboard:


1. Go to Members -> Membership Features


2. Find the Listing Feature and click on Edit


3. Grab a cold beer and prepare for an amazing thrilling ride!! .... geek style :)


4. On your Listing Feature edit page, go to the Search Results Settings Section.


5. Once in this section, find the text area that says Page Loop.


6. Go to around Line 22 (This can vary), the line should say something along the lines of <td class="info">


7. Inside this <td> we can add an example field, for example let's add some text that shows depending on the level of the specific  member's membership level. My example code is this:


    

<td class="info">
    <? if ($user_data[quote]!="") { ?>
	<p><?=$user_data[quote]?></p>
    <? } else if ($profileservices!="") { ?>
	<p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
    <? } 
    $userInformation = getUser($_COOKIE[userid],$w);
    if ($userInformation[subscription_id] == '4') {
        echo "This Text can only be seen by a Free Member";
    } else { 
       echo "CONGRATULATIONS!! You are an awesome paying member. Girls love you, Men wanna be just like you and I will name my baby after you."; 
    }
    ?>
   <table>.......

    

This would simply show a text on each search result that will see if the member is a particular membership level and if yes, add some text to it.


Now, after testing this code and seeing how it works and adjusting it to your needs, you can go one step forward and simply visually show the text ONLY, if the logged in user has a specific membership level. This can be done by changing the $user_data[subscription_id] part of the code to getUser($_COOKIE[userid],$w). This way, you will grab not the membership level of the already registered members but the membership levels of the client viewing the content.



Video 2http://screencast.com/t/Z0H7Hjxu2tq


For the 2nd video, The best and easy way of doing it is this:


1. On your back-end, Go to Toolbox -> Form Manager and select the Listing Contact Form.

2. Inside the Listing Contact Form, click on the Add New Field button and create a new field. This new field should have the column header's name from your CSV the same as the variable name input box, so for example, if the new column on your CSV is called Delivery Mode, you need to rename it to deliverymode and also name the variable name field in the form as deliverymode (No spaces, preferably lower case).

The end result should be that the name of the header on your CSV for that specific field is deliverymode, and the variable name for that field in the form should also named that way. Here is an image of an example for it:



In the image above I have circled in red where the variable name is. This should be EXACTLY the same as the header of your new columns. In your video example, you have Delivery Mode and Financial Aid. They should be renamed to something like "deliverymode" and "financialaid". You also need to add as many fields as new columns there are in your CSV. So in this case, you need to add another Field to the form, for the Financial Aid column on your CSV.


4. Save the form after adding all fields needed by your CSV.


5. After the CSV has the correct header names for the new columns, you can simply import it to your system. The BD system will know where to send the extra columns because it will look into all variables of the system and see for example, that your deliverymode header on your CSV is the same name as the deliverymode field variable on your Listing Contact form.


6. After importing your new information we can proceed on adding it to your system's result page. By reusing the answer i gave to Video 1, we can simply call the value for that new field like this:

 

 $userInformation[deliverymode];

 

So for example, you could show the new field like this:


 

<td class="info">
    <? if ($user_data[quote]!="") { ?>
	<p><?=$user_data[quote]?></p>
    <? } else if ($profileservices!="") { ?>
	<p>Specialties: <?= $userInformation[deliverymode];?></p>
    <? } ?>
   <table>.......

 

In this example, in the Specialties parragraph, you would see the information for the deliverymode.


Now in regards to what information you wish to show, in what order you wish to show it and any other customization, you can simply edit the order in which they appear in the PHP code mentioned above. For example, here are 2 codes:


  

<td class="info">
			<?php $userInformation = getUser($_COOKIE[userid],$w); ?>
                        <? if ($user_data[quote]!="") { ?>
                            <p><?=$user_data[quote]?></p>
                            <? } else if ($profileservices!="") { ?>

                            <p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
			    <p>Tags: <?=$userinformation[metatags]?></p>
                            <? } 
                            ?>

  

In this example, a Field called Tags is shown after the Specialties.


 

<td class="info">
			<?php $userInformation = getUser($_COOKIE[userid],$w); ?>
                        <? if ($user_data[quote]!="") { ?>
                            <p><?=$user_data[quote]?></p>
                            <? } else if ($profileservices!="") { ?>
			    <p>Tags: <?=$userinformation[metatags]?></p>
                            <p>Specialties: <?=$service[service_name]?> <?=$profileservices?></p>
                            <? } 
                            ?>

 

In this example, a Field called Tags is shown before the Specialties. This gives an idea on how we can show the information, in what order, how we can call it and more.


Video 3http://screencast.com/t/qcmClrUKRra


In regards to the 3rd video, here is my coding recommendation:


1. Create an array that has the id value of the member you wish to personalized and the messages you wish to add to their results when found. For example:


 

    $customizedMessage = array( "452" => "Best Member Award", "122" => "Australian Coding Partner", "334" => "Blue Ribbon Member", "76" => "Gold Hobbit Member");

 


2. Using the $user_data[subscription_id] I mentioned above, you can do an IF statement where, if the client IS that particular ID in the array above, then change the text you wish to show with the specific text in the Array. For example if the user ID is 122 then the text displayed would be "Australian Coding Partner".


3. This can then be extended to any amount of premium members and even extended to show to only specific members, membership levels and more.



Let me know if this helped you Samuel and as always, I am glad to give you a helping hand. Big hugs buddy. 

Hi Luis,

Thank you very much for your detailed response. It was extremely helpful and I will make good use of your answer.

I attempted to give 2 parts to my question and you answered 1 part perfectly.


Please see the 2 videos which addresses the 2nd part of my question.

Any help on this will be greatly appreciated.


http://screencast.com/t/Z0H7Hjxu2tq


http://screencast.com/t/qcmClrUKRra


I look forward to hearing from you,


Thanks again buddy,

Samuel

Thank you Samuel, It might be because I only saw the first video (shy face hehe). Gonna have a look at the 2nd one.


EDIT: Hi Samuel just watched your second video. I provided an answer to it on the original post above. Your ideas are great btw. That can surely be extended a lot.

Hi Luis, Thanks for your message. My apologies! I should have been more clear and mentioned that my last message included 2 new videos and didn't include the first video. So that's a total of 3 videos Sorry if I confused you. Best regards, Samuel

Hi Samuel, I have updated your question and my answer. I will do some research to give you the best optimized solution and avoid several issues that could happen. See you soon buddy.

Hi Luis! ! Thank you for your message. I can't wait to see your optimized solution. I will also organize a training session so that I can have a better understanding of your awesome answers.. Thanks again buddy Samuel

Hi Samuel, I have provided a fairly easy answer. The system has some cool features I did not know about. Very flexible with stuff like this. Hope this helps solve your doubt.

Luis,
Thank you soo much!!
What a great answer!...
I've been very impressed with your assistance.
Take care buddy,
Samuel
 




 

Hi Luis,
I just have a minor question about your previous answer.
Please see video question.
http://screencast.com/t/LWNidVkqr8DT

Kind regards,
Sam