topitoconnectey
Forum Replies Created
-
Forum: Plugins
In reply to: [Page scroll to id] Smooth scroll not working on ajax loaded contentThank you very much for a quick and useful answer ! ?? I’m adding the class back on AJAX request success.
Since this class is added automatically by Page Scroll To Id, can I suggest you could plan in a future update to fix it ?
I assume that by creating a “instanciating” function that adds all relevant classes and so on, and calling that function ondocument.ready
,ajaxComplete
, and making it accessible for people to use in other use cases ?I tried to “translate” the query. It’s returning 0 results but I’m not sure if it comes from me “translating” badly, or if the database structure is not made in a way that allows me to query those events like this ?
if (is_user_logged_in()) { global $wpdb; // find out what private groups they belong to, and don't show private group events not in their memberships $group_ids = BP_Groups_Member::get_group_ids(get_current_user_id()); if ($group_ids['total'] > 0) { // $conditions['group_privacy'] = "(<code>event_private</code>=0 OR (<code>event_private</code>=1 AND (<code>group_id</code> IS NULL OR <code>group_id</code> = 0)) OR (<code>event_private</code>=1 AND <code>group_id</code> IN (".implode(',',$group_ids['groups']).")))"; $meta_query = array( 'relation' => 'OR', array( 'relation' => 'OR', array( 'key' => 'event_private', 'value' => 0, 'compare' => '=', ) , array( 'relation' => 'AND', array( 'key' => 'event_private', 'value' => 1, 'compare' => '=', ) , array( 'relation' => 'OR', array( 'key' => 'group_id', 'compare' => 'NOT EXISTS', 'value' => 'null', ) , array( 'key' => 'group_id', 'compare' => '=', 'value' => '0', ) , ) , ) , ) , array( 'relation' => 'AND', array( 'key' => 'event_private', 'value' => 1, 'compare' => '=', ) , array( 'key' => 'group_id', 'value' => $group_ids['groups'], //array 'compare' => 'IN', ) , ) , ); } else { // find out what private groups they belong to, and don't show private group events not in their memberships // $conditions['group_privacy'] = "(<code>event_private</code>=0 OR (<code>event_private</code>=1 AND (<code>group_id</code> IS NULL OR <code>group_id</code> = 0)))"; $meta_query = array( 'relation' => 'OR', array( 'key' => 'event_private', 'value' => 0, 'compare' => '=', ) , array( 'relation' => 'AND', array( 'key' => 'event_private', 'value' => 1, 'compare' => '=', ) , array( 'relation' => 'OR', array( 'key' => 'group_id', 'compare' => 'NOT EXISTS', 'value' => 'null', ) , array( 'key' => 'group_id', 'compare' => '=', 'value' => '0', ) , ) , ) , ); } }
Oh that’s a shame, I feel really close to the solution but can’t seem to find it. But I understand your position.
On StackOverflow, someone suggested to “translate” the
SQL
query into aWP_Query
'meta_query'
, only if the information is saved in the certain way in the database.Could you confirm that if I use nested meta_queries like this, it could work ?
$meta_query = array( 'relation' => 'OR', array( 'key' => 'event_private', 'value' => '0', 'compare' => '=', ), );
Thank you and sorry for asking too many questions
Forum: Plugins
In reply to: [Page scroll to id] Smooth scroll not working on ajax loaded contentOf course !
Here is the relevant page:
https://dev.lesdeuxvagues.com/abdp/artistes
Please note that the smooth scroll works perfectly (on the letters) on page load, but when clicking the filters, it doesn’t work anymore !If I purchase a pro license, could you provide me with a little more details ? The function you gave me is an SQL query and i’m not sure how to use it with WP_Query.
It’s honestly not such a big issue as it’s something you’ve already done.Hope you can help, thank you ??
I will look into it, thank you.
But could you still tell me what would be the WP_query argument that equals to group=’my’ ?Oh yes this is closer to what i’m trying to do ! Using the group attribute with the ‘my’ is exactly what I need ! Thank you.
What does the event_list shortcode output ? Is it an array of posts or is there also an HTML structure ? Because I need to keep a specific HTML structure, I was trying to use a query. If the shortcode returns an array I think I’ll be fine.
What would be the WP_query argument that equals to group=’my’ ?
Forum: Plugins
In reply to: [The Events Calendar] Query featured eventsNevermind. I replaced
'tax_query' => array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => 'featured', 'operator' => 'IN' ), ),
by
'featured' => true
By I get one of the event as duplicate, why ?
- This reply was modified 7 years, 5 months ago by topitoconnectey.
I’m not sure you understood my question correctly ? Because single_template seems to display an event as a page ?
If I can explain again :
– I have buddypress groups, that are all private.
– Each event is assigned to a group and should only be visible to the group users.
– I created a custom page template to display a list of events (copied from the way my theme shows news), but it displays all of the event to every users, regardless of the groups they are in.I think this is a normal feature from EM to display events only to the right users no?
This is how I query the events for the page template, where I’m probably wrong ?
$args = apply_filters('woffice_blog_query_args', array( 'post_type' => 'event', 'orderby' => 'meta_value', 'meta_key' => '_event_start_date', 'paged' => $paged, 'posts_per_page' => $posts_per_page ), $paged, $posts_per_page);
Ok thank you !
If I understand correctly, here this is the function that checks whether the user is a part of the group and should see the event or not : function `bp_em_private_event_check($template){
global $post, $wpdb, $wp_query, $bp;
if( $post->post_type == EM_POST_TYPE_EVENT ){
$EM_Event = em_get_event($post);
//echo “<pre>”; print_r($EM_Event); echo “</pre>”; die();
if( !empty($EM_Event->event_private) && !empty($EM_Event->group_id) ){
if( is_user_logged_in() ){
//make sure user is a member of this group, whether private or not, private groups just aren’t shown to non-members of a group
$id_lookup = $wpdb->get_var( $wpdb->prepare( “SELECT m.group_id FROM {$bp->groups->table_name_members} m WHERE m.group_id = %s AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0”, $EM_Event->group_id, get_current_user_id() ) );
if($id_lookup != $EM_Event->group_id){
unset($post);
$wp_query->set_404();
$template = locate_template(array(‘404.php’),false);
}
}else{
unset($post);
$wp_query->set_404();
$template = locate_template(array(‘404.php’),false);
}
}
}
return $template;
}`What is ‘
$template
‘ and how can I use the function in another page template ?Turns out, as I have regular posts and events mixed in the same slider, that {{event_start_date}} displays as is on posts, but displays the date on events.
Do you know how to fix it ? It’s weird because {{meta:_event_start_date}} displays only on posts !
Nevermind, I just found another meta : {{event_start_date}} which does exactly the right formatting ! Great plugin ! ??
Forum: Plugins
In reply to: [Contact Form 7] No javascript supportthat’s weird! my site redirects to a 404 error page, but I don’t have any conflict in my input names (i looked at the docs).
https://lesdeuxvagues.com/demo/ do you know where that can come from?
Thank you for the incredibly quick reply too, by the way !
Thanks !
I ended up adding this in archive.php<NOSCRIPT> <div class="row"> //my container <?php while ( have_posts() ) : the_post(); ?> //my repeater template <?php endwhile; ?> </div> </NOSCRIPT>