Jeff VIP
Total posts: 745
26 Feb 2015 04:02

Hi,

There is something I want to achieve and I was wondering if anyone has some best practice suggestions. I have a directory where people and businesses can post their articles.

  1. I need 2 directories: an article directory and a business directory.
  2. Business owners can show their logo in their articles by purchasing a subscription.
  3. I want business owners to enter their details only once (logo, url, short description).
  4. A business owner's logo is automatically shown in all his articles if he has a valid subscription.
  5. A business owner's logo is automatically hidden once his subscription has been expired.
  6. A hit counter for the number of times the logo has been clicked.

I was thinking of creating two different sections: articles and businesses, but I'm not sure how to implement point 4 and 6. Is there a simple solution for this? Any hints are much appreciated.

Best regards, Jeff

Last Modified: 25 Apr 2015

Comments have been disabled for this article and works only in read only mode.

Jeff VIP
Total posts: 745
26 Feb 2015 06:36

Second thought

Since I use Easy Profile as a member system, I might even consider putting all business info in the user profile and use it for the business directory. I think it is the most logical place to put that info anyway.

Then I could add some code in the record template to check wether the author has a valid subscription and use Easy Profile's content plugin to show specific profile fields.

To create a click/hit counter I might use a script like http://www.phpjunkyard.com/php-click-counter.php

What do you think?


Sergey
Total posts: 13,748
27 Feb 2015 05:16

It is very easy to check. For example create a text field and protect with subscription. DO not allow to add or edit this field but view and display. In custom output template insert your user details. ANd to show field or not will be automaticaly handled by Cobalt.


pepperstreet VIP
Total posts: 3,837
27 Feb 2015 06:55

Jeff 6.) A hit counter for the number of times the logo has been clicked.

If the image has a link to article full view... you could use the regular build-in "hits".

What is point 7.)? ;)


Jeff VIP
Total posts: 745
27 Feb 2015 08:21

Sergey It is very easy to check. For example create a text field and protect with subscription. DO not allow to add or edit this field but view and display. In custom output template insert your user details. ANd to show field or not will be automaticaly handled by Cobalt.

Yes, I understand. But if I use a Cobalt field, the user has to fill in his business info (logo,link,description) on each of his articles. Think of the horror if some day one of his business details changes!


Jeff VIP
Total posts: 745
27 Feb 2015 08:27

pepperstreet If the image has a link to article full view... you could use the regular build-in "hits".

Yes, I know. Does the hit counter also work if I put info from a user profile inside the link?

pepperstreet What is point 7.)? ;)

Huh, point 7.? ;-)


pepperstreet VIP
Total posts: 3,837
27 Feb 2015 08:30

Jeff But if I use a Cobalt field, the user has to fill in his business info on each of his articles

What about using Relation fields? Outsource the business profile info. Then it is stored and edited in one location only.


Jeff VIP
Total posts: 745
04 Mar 2015 03:53

pepperstreet What about using Relation fields? Outsource the business profile info. Then it is stored and edited in one location only.

At third thought I think you are right, pepperstreet. I played a bit with Relation field Records and set it to display a single user item.

I created a new business section where business owners are permitted to submit only one item. This item contains all their business information like name, address, website, logo, etc. In the article section only the business logo is shown which is linked to the full info in the business directory.

This construction solves all my needs including the click counter. :-)

Powered by Cobalt