How do I hide the event description within template of The Events Calenar using Ultimate Member shortcode?

OK, so the goal is to hide the event description with Ultimate Member shortcode [um_loggedin].

I tried doing echo do_shortcode but it’s not working…

This is the code I used within wp-content/themes/hello-elementor/tribe-events/single-event.php:

<?php echo do_shortcode('[um_loggedout]'."Sorry, but only loggedin users are allowed to access the details".'[/um_loggedout]');?>

<?php echo do_shortcode('[um_loggedin]'.the_content().'[/um_loggedin]');?>

Is it legal to use the APIs of Meetup.com, Eventbrite etc, to aggregate their event data into one place, similar to Google?

I have a predicament. I’m trying to build a platform that will basically be a place where all events, online/offline, are listed.

Initially – my platform will obviously have zero events, because nobody knows about it. And for anyone to use it – there needs to be events on there – classic chicken and egg scenario.

My thought was to aggregate events on to my platform (and link to their source), whilst also allowing users to create events on MY platform. Eventually, I’d be able to not bother listing events from other sources if mine gains enough traction. So, I am definitely competing with these sites.

Google is pulling data from many different events sources, and displaying it on their pages like so – https://www.google.com/search?q=events+in+london+meetup&rlz=1C5CHFA_enUA720GB740&oq=events+&aqs=chrome.0.69i59l3j69i60l3j69i65l2.4289j1j9&sourceid=chrome&ie=UTF-8&ibp=htl;events&rciv=evn&sa=X&ved=2ahUKEwiYtuPx2bLuAhU3REEAHaRkCZ0Q5rwDKAJ6BAgNEA4&sxsrf=ALeKk03Uj9jeI8lTj0__V-UWcgcv_pdFew:1611427139353#htivrt=events&htidocid=L2F1dGhvcml0eS9ob3Jpem9uL2NsdXN0ZXJlZF9ldmVudC8yMDIxLTAyLTAzfDE2ODA2NzEwNzgyNjAxNDg4MTQ2&fpstate=tldetail

The difference is, Google, I assume (?), is probably scraping the data rather than using APIs.

In the Meetup API Terms, it states:-

"Not use the Meetup API for any commercial purpose without the express written consent of Meetup;

Not undermine our commercial interests or make unreasonable commercial uses of the Meetup API, such as by substantially replicating our Platform or significant aspects of the Platform, to be determined in Meetup’s sole discretion;

While you may charge for any application you develop (subject to Meetup’s consent), you may not sell, lease, or sublicense the Meetup API;"

I know aggregating is a bit of a legal grey area but I wanted to ask for opinions on whether or not this would be legal, and if not – how the hell do I get any traction and users without having any content?

Note: This is in the UK.

Adding Facebook Pixel Event results in error

I’m trying to create a Facebook Pixel Event, however I get an error on my site, every time I try to add it. The error states: "Request could not be processed: We could not process your request. Please try again." on the page where I want to add the pixel.

The error appears on my website on the subpage where I want to add the event. It’s a Facebook Event Manager error, as it seems. This is what it looks like on my page (it’s in German though) enter image description here

My website is a WordPress website and I added the Pixel via Google Tag Manager. The pixel itself seems to be working fine.

I googled a lot but didn’t find anything related to this. The Facebook Pixel Helper Chrome plugin shows that the Pixel is correctly installed and working. When I look at the Chrome developer console I see this error however: "Error: Invalid data".

What could be causing this problem? There is literally NO INFORMATION on this kind of error on the web, so I’m really helpless here.

I cleared all caches, tried using other browsers that I never use but that didn’t help either. The weird thing is, it did work only 1 hour ago and now it suddenly stopped working.

Getting meta in editor plugin, and event triggering issue

I have a Custom Post Type defined with custom-fields support. I then registered a meta field.

The first issue is that select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles always returns undefined on first call (before being updated by dispatch( 'core/editor' ).editPost). Also, when I save the Custom post Type the value isn’t modified in the database.

The other issue is, when check any of the checkboxes, on first click, isChecked() is properly called, on next clicks it doesn’t happen, but updateMeta() is triggered. If I fold/unfold the control or uncheck a checkbox, all the checkboxes do get updated by calling isChecked():

animation example of second issue

Here is my code:

class Metaboxes extends Base {      /**      * Setup user.      */     public function setup() {         add_action('init', [$  this, 'init'] );     }      public function init () {         register_post_meta(             'vaenc_actu',             '_vaenc_actu_roles_scope_roles',             [                 'show_in_rest' => true,                 'single'       => true,                 'type'         => 'array',                 'default'       => [],                 'auth_callback' => function() {                     return current_user_can( 'edit_posts' );                 }             ]         );     } } 

My javascript is like so:

const {registerPlugin}                              = wp.plugins; const {PluginDocumentSettingPanel}                  = wp.editPost; const {PanelBody, CheckboxControl}                  = wp.components; const {useSelect, select, withSelect, withDispatch} = wp.data; const {Fragment, useState}                          = wp.element; const {__}                                          = wp.i18n; const {compose}                                     = wp.compose;  const RolesControl = ( {isChecked, updateMeta} ) => {     return (         <>             <Fragment intialOpen={true}>                 <CheckboxControl                     label={__( "PRI", "vae" )}                     checked={isChecked( 'vae-pri' )}                     onChange={( value ) => updateMeta( 'vae-pri', value )}                 />                 <CheckboxControl                     label={__( "PRC", "vae" )}                     checked={isChecked( 'vae-prc' )}                     onChange={( value ) => updateMeta( 'vae-prc', value )}                 />                 <CheckboxControl                     label={__( "Certificateurs", "vae" )}                     checked={isChecked( 'vae-certif' )}                     onChange={( value ) => updateMeta( 'vae-certif', value )}                 />             </Fragment>         </>     ) }  const RolesField = compose( [     withSelect( () => {         return {             actu_scope_meta: select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles,         };     } ),     withDispatch( ( dispatch ) => ({         isChecked ( prop ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( meta ) {                 return meta.includes( prop );             }             return false         },         updateMeta ( prop, value ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( !meta ) meta = []              if ( meta.includes( prop ) && !value ) {                 meta = meta.filter( arrayItem => arrayItem !== prop );             } else if ( !meta.includes( prop ) ) {                 meta.push( prop );             }              dispatch( 'core/editor' ).editPost( {meta: {_vaenc_actu_roles_scope_roles: meta}} );         },     }) ), ] )( RolesControl );  const Render = () => {     const postType = useSelect( select => select( 'core/editor' ).getCurrentPostType() );     if ( 'vaenc_actu' !== postType ) {         return null;     }      return (         <>             <PluginDocumentSettingPanel                 name="vae-role-scope-sidebar"                 title={__( 'Restrictions', 'vae' )}             >                 <RolesField/>             </PluginDocumentSettingPanel>         </>     ) }  registerPlugin( 'vae-role-scope-sidebar', {     render: Render } )  

MySQL event scheduler waiting on empty queue since server restarted 12 days ago

I noticed a process on the server which has been running for more than 12 days, which I think coincides with the last time MySQL was restarted.

mysql> SHOW FULL PROCESSLIST;  +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ | Id      | User            | Host      | db   | Command | Time    | State                  | Info                  | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ |       5 | event_scheduler | localhost | NULL | Daemon  | 1098372 | Waiting on empty queue | NULL                  | | 1774483 | root            | localhost | NULL | Query   |       0 | starting               | SHOW FULL PROCESSLIST | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ 2 rows in set (0.00 sec) 

There are no events, and I haven’t attempted to created any.

mysql> SELECT * FROM information_schema.EVENTS;  Empty set (0.00 sec) 

This is actively using up to 8% of my server’s CPU.

Is there a way of determining what this is, or why it was started? Will this try to run every time I restart MySQL? If so, what is it ‘waiting’ for and do I need to tweak my configuration at all to prevent this?

MySQL 8.0.21

Conditionally enqueue a stylesheet based off of a javascript click event

I would like to use a different ccs file based on a javascript click event. The user will have a choice of color themes by clicking one of the colored buttons on the screen. I originally have it working by providing the linked css with an id that can be targeted with javascript. The link is in the HTML head tag of course. In WordPress though we enqueue the css file in the functions.php file and so I am not sure how to give the css file an ID to target it with the javascript. If anyone can help me out or point me in the right direction I will really appreciate it. I am open to all possibilities and I thank you all in advance. if you need me to elaborate more feel free to let me know.

facebook customer chat for website – button click event help need

Dear friends, I need a help. I am facing a problem;

I have setup facebook customerchat in my site. It appear at the bottom-right corner of the page. When clicked on the green round button it open.

View attachment 255988
# I wish to add another option on it, so that I can also open this chat clicking another button/ image/ text also. Suppose see the attchment, if I click on "Chat with us" or the female face image, it will open the customer chat same way.

Optional:
Also can I add…

facebook customer chat for website – button click event help need

Distributed predicate computation on event stream

My question is actually a request for papers, articles, texts or books on the problem that I’m trying to solve on my work.

I’m working on a program that computes a predicate value (true or false) for a given object in a distributed system in which there is a stream of events that can change the object’s attributes and, consequentially, the predicate value. Whenever the predicate value changes, the program must send a notification about this change.

For example, consider that there is an object A which has an attribute called name and consider that there is a predicate P which is true when the object’s name is equal to Jhon. Each event in the stream has a timestamp and a value for the attribute name. So consider the following sequence of events:

e1 = { name: Jhon, timestamp: 1 } e2 = { name: Jhon, timestamp: 2 } e3 = { name: Peter, timestamp: 3 } e4 = { name: Doug, timestamp: 4 } e5 = { name: Jhon, timestamp: 5 } 

Now, the events don’t necessarily show up in the stream in the correct order and, even worst, there are multiple computers parallelly processing this stream of events. However, for simplicity, I’ll go further in this example considering only one computer.

If the events arrive and are processed in the order described above, then the notifications sent should be:

P(A) = true when e1 arrives P(A) = false when e3 arrives P(A) = true when e5 arrives. 

That is the correct sequence of notifications. Now, imagine that the computer receives the events in the following order:

e1, e5, e2, e4, e3 

A naive algorithm which doesn’t consider the event’s timestamp would send an incorrect sequence of notifications:

P(A) = true when e1 arrives P(A) = false when e4 arrives 

The algorithm that I’m working on considers the timestamps and infers when a notification should have been sent but was not. So when e3 arrives it will notice that the notification P(A) = true for e5 was not sent. This feels a bit like reinventing the wheel, though I’m not aware of any reading about this problem. I would like some references to this problem or to something similar, like some papers dealing with this kind of problem.

The real problem is quite more complex since it involves storing the predicate $ \times$ object state in a database that works as a shared state between the computers processing the stream and I’m talking about thousands of events arriving per second so it’s not possible to keep all events stored in some database.

Compute duration of an event based on consecutive values in another column

I need to compute the sum of durations of multiple events based on consecutive values in another column.

             ts             | w ----------------------------+---  2020-07-27 15:40:04.045+00 | t  2020-07-27 15:41:04.045+00 | t  2020-07-27 15:41:14.045+00 | f  2020-07-27 15:42:14.045+00 | t  2020-07-27 15:43:14.045+00 | t 

The event is considered being active as long as the column w has a consecutive value of true.

The duration of the first event would be 60 seconds. '2020-07-27 15:41:04.045+00' - 2020-07-27 15:40:04.045+00. The second event has the same duration. The sum of both would be 120 seconds.

What would be the best/most performant approach to computing these values? The longest time range we’ll be looking at will probably be half a year involving about 30 million rows.

I wrote a custom aggregate function that computes the duration but it takes about 16 seconds for only 1.5 million rows.

 Aggregate  (cost=444090.03..444090.04 rows=1 width=4) (actual time=16290.826..16290.828 rows=1 loops=1)    ->  Seq Scan on discriminator0  (cost=0.00..57289.03 rows=1547203 width=9) (actual time=0.016..1723.178 rows=1547229 loops=1)  Planning Time: 0.196 ms  JIT:    Functions: 3    Options: Inlining false, Optimization false, Expressions true, Deforming true    Timing: Generation 0.889 ms, Inlining 0.000 ms, Optimization 0.508 ms, Emission 6.472 ms, Total 7.870 ms  Execution Time: 16291.836 ms 

I’m new to SQL and basically just got this working through trial and error, so I’m sure there is room for improvement. Maybe even a whole different approach. Here’s a fiddle with the aggregate function.

I’m not sure if i should include the code because it’s quite long

Add post meta data date to event

I created a post metabox that uses the datepicker to pick a date value. I got as far as adding the metabox and getting the datepicker to work but other than that im struggling to get the data saved to the post. This is my code in my functions.php:

//Add date picker css function admin_styles() {     if ( 'events' === get_current_screen()->id ) {         wp_enqueue_style( 'jquery-ui-smoothness', // wrapped for brevity             '//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css', [], null );     } } add_action('admin_print_styles', 'admin_styles'); //Activate function function admin_scripts() {     if ( 'events' === get_current_screen()->id ) {         wp_enqueue_script( 'admin', get_template_directory_uri() .'/js/admin.js', [ 'jquery-ui-datepicker' ] );     } } add_action( 'admin_enqueue_scripts', 'admin_scripts' );  //Add date meta-boxes  function post_date_field($  post) {    echo '<input type="text" id="jquery-datepicker" name="entry_post_date" value="' . get_post_meta( $  post->ID, 'entry_post_date', true ) . '">'; } function post_date_meta_box() {   add_meta_box('entry_post_date', 'Date', 'post_date_field', 'events', 'side', 'high'); } add_action('add_meta_boxes', 'post_date_meta_box');  //Save Data function save_date_meta_box($  post_id){     global $  post;     if( $  post->post_type == "events"){         if (isset($  _POST)){             update_post_meta( $  post_id, 'entry_post_date', strip_tags( $  _POST['entry_post_date'] ) );         }     } } 

After publishing or updating the post I dont think the date value is saved