SELECT e.* FROM `#__groupjive_plugin_events` AS e JOIN `#__groupjive_plugin_events_attendance` AS a on a.`user_id` = '[user_id]' AND a.`event` = e.`id` JOIN `#__groupjive_groups` AS b ON b.`id` = e.`group` AND ( b.`category` = '13' OR b.`id` = '56' ) ORDER BY e.`params`ASC
$marketevents = $action->string( $user,'[var1_params_event]');
if ($marketevents > 0) {
$db = JFactory::getDbo();
$query = $db->getQuery();
$query="SELECT id FROM `yq0g1_groupjive_plugin_events_attendance` WHERE `user_id` = ".$user_id." AND `event` = ".$marketevents;
$db->setQuery($query);
$eventat = $db->loadResult();
if ($eventat) {
$query = "SELECT * FROM `yq0g1_groupjive_plugin_events` WHERE `id` =". $marketevents;
$db->setQuery($query);
$event=$db->loadObject();
print_r($event);
$displayevent = $event->event;
//Choose the right category if it's for individuals or pros.
$cat = null;
$cats = json_decode($event->params);
$cat = $cats->drophscat;
// print_r($cat);
if ($cat == '10') $value = "Professionnels";
if ($cat == '20') $value = "Particuliers";
if ($cat == '30') $value = "Tout public";
if ($cat == '50') $value = "Campagnes souhaitées";
//set multiplier to default or check fo display
$groups = JAccess::getGroupsByUser($event->user_id);
if (in_array(18, $groups) && $event->group != 56){
$mfl = $cbUser->replaceUserVars ('[cb:userdata field="cb_marketing_multiplier" user="' . $event->user_id . '" /]');
} else $mfl = 2;
}
}
<div class="row">
<div class="col col-sm-11 col-md-10 col-lg-8 mx-auto mt-0 mb-5">
<div class="mx-1">
<?php
//run the content through the onContentPrepare Joomla event,
$params = new JRegistry();
$params->loadString("");
$content = new StdClass;
$content->text = $event->event;
JFactory::getApplication()->triggerEvent('onContentPrepare', array("", &$content, &$params, 0));
echo $content->text;
//echo $event->text;
?>
</div>
</div>
</div>
Please Log in to join the conversation.
I think here at Joomlapolis we've done that beyond what anyone else has and can provide, but there's always going to be a limit. You're trying to add an entirely new functionality to CB Activity. That's something I've always created a new plugin to do, because there isn't any other way to do it cleanly. It's not possible to create an entire CB plugins structure from CB Auto Actions yet. It just hasn't reached that level of potential yet, but it is going to continue to grow and improve over the years. Its rewrite for CB 3.x I am hoping to have a drag and drop interface to allow for "visual scripting", but that's a long way off.Well, that’s a pity because your whole system and auto actions typically would bring low tech users like me to develop small things easily with some kind of bricks brought together.
You need the activity object because the gallery entries ids will be stored in its params as an array. You will not be able to get that information with a substitution since it's just an array of data. You need to use the API so you need the activity object. If you have the activity object then you'd access it with the following.Starting from this point, how can I retrieve the first linked multimedia file added in the related activity to the event chosen instead of using the event content ?
$uploads = cbToArrayOfInt( $row->params()->getRaw( 'gallery', array() ) );
Please Log in to join the conversation.