Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] GroupJive Event expiration

  • mjplowcha
  • mjplowcha
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
11 years 8 months ago - 11 years 8 months ago #221124 by mjplowcha
[SOLVED] GroupJive Event expiration was created by mjplowcha
Hello. I recently tested a few events out on my test site set to expire on 2/14 and they are still showing as upcoming events on my CB GroupJive 'scheduled events' module today (2/16).

I double checked my server time was set correctly. Any thoughts as to where I might have my settings incorrect to make this event expire / unpublish automatically?

Thanks!
Last edit: 11 years 8 months ago by krileon.

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

  • mjplowcha
  • mjplowcha
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
11 years 8 months ago #221125 by mjplowcha
Replied by mjplowcha on topic GroupJive Event expiration
After taking a closer look at the module ($mode==12), I don't see any type of IF statement that sets the event date expiration = current date. I would like to add this into the code, but I am not familiar with how to make the IF GJ event date is equal to the server time. Would you please let me know what those variables are or do you have any tips for me to help me get started customizing this?

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

  • mjplowcha
  • mjplowcha
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
11 years 8 months ago - 11 years 8 months ago #221130 by mjplowcha
Replied by mjplowcha on topic GroupJive Event expiration
Nevermind. I figured it all out. I ended up adding in a few extra lines here...
Roughly lines 444 - ELSE (There are no events scheduled)

ADD before..
if ( $rows ) foreach ( $rows as $row ) {
Code:
$nowdate= date("m/d/Y");


ADD before...
$return = **existing code***
Code:
$datemix = $row->getDate("m/d/Y"); if ($nowdate < $datemix ) {

ADD after the /div and before the next ELSE statement
Code:
} else { echo ""; }


Needs some tweaking still, but overall it makes past events disappear from the module mod_cbgroupjive.php when using the setting for 'scheduled events'
Last edit: 11 years 8 months ago by mjplowcha.

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

  • mjplowcha
  • mjplowcha
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
11 years 8 months ago #221135 by mjplowcha
Replied by mjplowcha on topic GroupJive Event expiration
Along the same lines, I also want to filter out to show only events for the current user. In other word, convert this to an 'upcoming events' module to show only the events for the person logged in only.

I was able to filter out the dates as noted previously. However I can't seem to figure out how to call the 'attending' data from the $row.

If you can help me echo the 'attending' data from the row, I can probably figure out the rest. Currently my data keeps coming up blank as noted below..
Code:
echo "attending = ". $row->getAttending;

Results are displayed as "attending ="

I tried running a foreach loop to break down the keys and values as suggested in w3schools (here in example 3: www.w3schools.com/php/func_array.asp )and I was able to see a value for 'attending'. I just don't understand where I am going wrong trying to only pull the attending data.

Thanks!
Mike P

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

  • mjplowcha
  • mjplowcha
  • OFFLINE
  • Posts: 30
  • Thanks: 1
  • Karma: 0
11 years 8 months ago - 11 years 8 months ago #221155 by mjplowcha
Replied by mjplowcha on topic GroupJive Event expiration
Moving forward, I can't figure out how to call the groupjive_users => 'group'

I just can't seem to figure out how to check to see if the current logged in user ($currentuser =& JFactory::getUser();) belongs to a gj group and then filter out the data so that Currentuser only sees the events for the groups he belongs to and not everyone.

As previously noted, I was able to filter out past events from this module. I just don't know how to retrieve this data so I can start filtering it out.

My thinking is along these lines, but I know it needs work...
Code:
$currentuser =& JFactory::getUser(); $isgroupmember = ??? get=>groupid for $currentuser ??? If $isgroupmember == (true) {...follow these instructions....)
**obviously not the correct code, but is my best guess as to what I want to accomplish without the correct data to work with.

Can anyone help? :blink:
Last edit: 11 years 8 months ago by mjplowcha.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago - 11 years 8 months ago #221201 by krileon
Replied by krileon on topic GroupJive Event expiration
You can establish current CB user object using the API detailed in the below tutorial.

www.allmysocials.com/directory/tutorials/item/232-establishing-user-object

GJ Events display doesn't hide expired, it simply orders them last. So if you only have 2 events and both are expired it'll show both. If you add a new event it'll show that new event above those 2 expired, etc.. The Group tab works the same. You can easily filter them out by editing the data laer API with extended where statement to filter out dates. Example as follows.
Code:
$include_exclude[] = array( 'date', '>=', $_CB_framework->now() ); $rows = cbgjEventsData::getEvents( array( array( 'grp_access', 'events_show' ), $user, null, true ), $include_exclude, null, $display );


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.
Last edit: 11 years 8 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum