Skip to Content Skip to Menu

Delimeter field expiration

  • cte2087
  • cte2087
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 3 months ago #169616 by cte2087
Delimeter field expiration was created by cte2087
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.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
13 years 3 months ago #169627 by nant
Replied by nant on topic Re: Delimeter field expiration

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 describe exactly what you want to accomplish as CBSubs 1.2 might be able to support with its new features.

Please Log in or Create an account to join the conversation.

  • cte2087
  • cte2087
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 3 months ago #169640 by cte2087
Replied by cte2087 on topic Re: Delimeter field expiration
Nick,
I have 2 types of "coupons" that are really a set of delimeter fields on a tab. The standard coupons should have a mandatory expiration of 30 days. The is an admin setting, the member cannot control or even really see this.

The custom coupon has an extra delimeter field for uploading a custom image. The custom "coupon" needs to have the ability for the member to set the expiration date of the coupon. This is where I would image the date range field to come into play??

Once the coupon expires, I am not sure of how to "reset" the delimeters or if that is the method that needs to be used?

I could use another person's help looking at the logic of this thing.

Thanks,
CTE2087

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
13 years 3 months ago #169653 by nant
Replied by nant on topic Re: Delimeter field expiration
Ok, my memory is kicking in finally.

For others reading, these coupons have nothing to do with CBSubs coupons.

If I recall, a coupon in your case is just an image (or some other data) that the profile user uploads through his profile. This coupon data is displayed on the user's profile through the use of delimiter fields that use substitution logic to only show the coupon for up to 30 days.

I recall we gave you some specific delimiter code, can you please post it here so we can see and comment?

Please Log in or Create an account to join the conversation.

  • cte2087
  • cte2087
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 3 months ago #169667 by cte2087
Replied by cte2087 on topic Re: Delimeter field expiration

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.


There is also the plugin.foundation.php file attached. I have really not taken the full time to experiment with this as there were so many other issues the client wanted accomplished.

Thanks for taking a look.

CTE2087

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
13 years 3 months ago #169670 by krileon
Replied by krileon on topic Re: Delimeter field expiration
You need to replace the existing plugin.foundation.php file as it contains a fix not provided in CB 1.4 (will be with next release). Once done you'll need to install CB Query Field provided to you (or obtained from incubator). Now create a new field from field management of type query. Supply the query provided to you and save the field. You can now use that field in your substitutions to compute the day difference between the field cb_ad1date and now.

The provided instructions are exactly as to what is necessary for now until next release where only the CB Query Field usage would be necessary.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum