meta_query order by date present -> future then show null

Thanks for taking the time to read this. I’ve been struggling with a meta_query for an events site I’m working on.

I have used ACF to create a field for date start and date end, but not all events will have a date.

What I’m trying to achieve, is when you go to the archive or tax view, the first thing you see are the posts that have a date assigned, in order from today’s date into the future. Then after those dated events have been output, to cycle through all empty date posts.

So far I have the below in my functions.php file. This kind of works, but in the wrong order. So the correct events that are dated are output and in the right order. But only after the null valued items have output. I thought that may be because of the ordering in the arrays themselves, so moved the date ordered array to the end. That had no effect.

$  query->set( 'post_type', 'courses' ); $  query->set( 'meta_query', array(     'relation' => 'OR',     array(         'key'        => '_course_date_from',         'compare'    => '=',         'value'      => '',     ),     array(         'key'     => '_course_date_from',         'compare' => '>=',         'value'   => date('Ymd'),     ) ) ); $  query->set( 'orderby', 'meta_value title' ); $  query->set( 'order', 'ASC' ); 

Thanks for your time. Ben.

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

How would pre-galifar texts and observers date major events like the War of the Mark?

Running the adventure in "Eberron: Rising from the Last War", there’s a ghost of a gnome that died during the War of The Mark, which takes place at roughly -500 YK. The ghost still thinks he’s in that time period, and provides the players with information about the city based on that.

Clearly someone living 500 years before Galifar was founded wouldn’t describe the year using the YK scale. Is there an easy way to get across to the players that the ghost believes himself to be living in the past?

How to show price update date in product single page?

I wanted to show price update date in Woocommerce product single page after add to cart button. something like this: ” Price updated at 5/6/2020 “

I tried to research but I did not find a good response. Thanks for helping.

https://wordpress.stackexchange.com/a/216653/189455 this is also a good reference but I could not figure it out how to use and do what he said in code.

MySQL Date insert

I have a date for example in the following format in column A

03/03/2020 01:48:18 pm (Currently Month, Day, Year and 12 hour format for time)

I would like to read the date in Column A and insert into Column B into the following format

2020/03/03/ 13:48:18( Need format Year, Month, Day and 24 hour format)

Would like a query to search for all records in Column A and insert into Column B , row for row

2checkout pay date?

Hey

I recently got accepted by 2checkout. Its been two days and I have made $ 100 worth of sales. I know that the payout is at $ 300 and they pay weekly. So, will they send money via bank transfer as soon as I hit $ 300 or is there a fixed payout day every week? I am based in India.

Secondly, my 2checkout is integrated wtih bigcommerce. Earlier, I did a test payment before allowing my ecommerce site to go live. I tried numerous time but I see that the checkout did not display paypal option….

2checkout pay date?

Can name and date of birth be hashed somehow to generate a secure identifier?

I’m working on a project which we intend to launch for developing countries, and, as a result, want to limit the amount of information needed for login and identification, while still maintaining individual privacy and security.

Speaking to the team, it became clear that passwords are a no-go, as users may end up accessing the service only when they have a third-party providing the opportunity to access the internet (once or twice a year even). Remembering passwords, using emails, or anything of the sort would not work in that scenario.

The whole thing is I need to store some data about each user, and I don’t wanna have any idea whose data it is. It isn’t especially sensitive data, but I’m trying to build something that preserves privacy as much as possible.

I’m therefore wondering how to identify users with information they know and do not need to put any extra effort into remembering.

As a result, we’ve narrowed usable information down to: Full Name and Date of Birth (even DoB can be a problem for some). Intuitively, it doesn’t look like one could build something very secure with that data. One key flaw with name and DoB is that one can easily go through all combinations for “John Smith” with all possible dates of birth and find a matching hash.

Therefore, a rough solution we have in mind is to hash name and DoB and use as “username” (all happening in the background of course). Some additional measures would be to scramble the date of birth and add a salt to the hash.

The authentication would then happen via facial recognition. The idea is to encrypt a picture of the user with some combination of the name and DoB as well, so at least it isn’t as easily accessible to the database admin.

A user would log in only with their name, DoB and picture, in a system that would first search through the hashes until it finds a match, then decrypt the corresponding picture and compare the two pictures to allow login or not.

In summary, the user credentials would be something like:

SHA256(NAME + SCRAMBLED_DOB + SALT) => AES(PICTURE_DATA, (NAME+SCRAMBLED_DOB)) 

The salt could also be added to the encryption of the picture, such that, at login:

  1. All potential versions of the SCRAMBLED_DOB are tested with multiple salts until a hash contained in the database is found
  2. That specific hash and sequence of digits from the DoB found from Step 1 are used to decrypt the image
  3. Image is compared with the image submitted at login, which is then discarded

This process could get long, but depending on how long, it may be acceptable in the name of privacy.

So, essentially, what I’m wondering is:

  1. Would SHA256(NAME + SCRAMBLED_DOB + SALT) be safe enough, given the requirements of the project?
  2. Any suggestions for a better way to encrypt the picture?
  3. Any suggestions for this system overall?

Thanks in advance!

Maximize rental income given a set of date intervals

Suppose you have 1 room that you want to rent out. (AirBnb style) You want to maximize profits that you will get by renting it out.

For example: Given intervals: [[1, 10], [2, 5], [7, 20], [23, 30]] – you could rent it out [2, 5], [7, 20] and [23, 30]

Another example: ([[1, 2], [1, 11], [5, 8], [4, 33], [18, 72]]) = 66

Note: Start and end times of the interval are inclusive

I implemented a brute force solution to this problem. First I sort by start time, then I create all possible subsets and take the longest possible value. This works. But I want to do this using Dynamic programming.

This problem screams DP, but I am not able to figure out if this has an optimal substructure.

My recurrence relation: f(i, j) = f(i + 1, j) or f(i + nums[i], j) if nums[i].start > f[i].end

Can someone help me figure out the thought behind the dp solution for the sub-problem?

Note: this problem is slightly different from job scheduling.