Please Log in or Create an account to join the conversation.
cte2087 wrote: Hello,
I am using a Joomla 1.5.23 build, CB 1.4, CB subs 1.2 (I think)
I would like to know if I would be able to set a date expiration for members who enter in delimeter field. The field is being used like a coupon to offer a special deal to viewers. Depending on their level, the member either gets a 30 day "coupon/delimeter field" or they can set the expiration of the delimeter field display.
Nick/Nant gave me an example of how I might be able to set the 30 day expire (I am a bit lost on this implementation method), but would it be possible to set up a member controlled expiration date range too?
Thanks,
CTE2087
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The process I followed is:
over-write existing plugin.foundation.php file located in your root -> administrator -> components -> com_comprofiler folder with that same named file attached to this email. This patched file will be included in next CB release so you can rest that upgrade will not mess up your feature.
I have also attached the cbqueryfield plugin (offered to professional members) just in case you do not have access to it.
You need to install this via CB Plugin manager and publish it.
For simplicity I have created the following use case (assuming one ad per profile) that you can adjust to your needs:
1. I have created a new CB Tab called 'My Ads'
2. I have created a new CB text field called cb_ad1txt1 with title 'Ad1 Text 1' and placed it on the 'My Ads' tab. This text field will hold the ad payload for the user.
3. I have created a new CB date field called cb_ad1date with title 'Ad1 Start Date' and placed it on the 'My Ads' tab. This will hold the start date for the ad. I user can decide to schedule the start date in the future or the past but the delimiter field that will be created to display the ad will only display it if less than 30 days have elapsed from the start date. After that the user will need to manually modify the start date to make the ad appear again.
4. I have created a new CB Query field called cb_ad1getdays with title 'Days after start date for Ad1' and also placed it on the 'My Ads' tab. This field is configured as:
SELECT DATEDIFF( NOW(), `cb_ad1date` ) FROM `#__comprofiler` WHERE `id` = [user_id]
What it does is to return the number of days between the cb_ad1date field and now, so if the start date is set to March 1 and today is March 10, then this should return 9. This can also be a negative number (if the start date is set in the future).
5. I have created a delimiter field called cb_ad1del with title 'Ad1 Display' and the following content:
[cb:if user="#displayed" cb_ad1getdays<"30" AND cb_ad1getdays>"0"]Start of ad-> [cb_ad1txt1] <-End of ad[/cb:if]
You can adjust the above to your specific needs.
Some suggestions:
There is no need to show the query field in frontend. You can create a backend tab and place it there.
There is no need to show the ad delimiter field in the same tab as the ad specification tab. You can place this field anywhere you want (in the portait tab or user status tab for example).
Hope the above is understandable.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.