Blog post:
get_row("select * from ".$wpdb->prefix."_3xs_settings where id = 1"); $activated = false; $activation_error = null; if (isset($settings->app_key)){ $email = $_POST['licence_email']; $licence_key = $_POST['licence_key']; $product_id = $_POST['licence_type']; $args = array( 'wc-api' => 'software-api', 'request' => 'check', 'email' => $settings->app_email, 'licence_key' => $settings->app_key, 'product_id' => $settings->licence_type ); $target_url = create_url( $args ); // echo $target_url; $data = wp_remote_get( $target_url ); $result = json_decode($data['body']); if (isset($result->success)) if ($result->success){ $activated = true; } else { // var_dump($result); $activation_error = $result->error; } } if ($activated){ $myposts = get_posts(array('post_status' => 'publish future', 'numberposts' => -1)); $myaccouts = $wpdb->get_results("SELECT * FROM `" . $this->tbl_account_sets . "`", ARRAY_A); //echo var_dump($myaccouts); $current_post = null; if (isset($_GET['post_id'])){ $current_post = get_post(intval($_GET['post_id'])); } $fb_ac = $wpdb->get_results("SELECT * FROM `" . $this->tbl_fb_accounts . "`", ARRAY_A); $selected = isset($_GET['account_set']) ? $wpdb->get_row("SELECT * FROM `" . $this->tbl_account_sets . "` where id=".$_GET['account_set']) : null; if (!$selected) $selected = $wpdb->get_row("SELECT * FROM `" . $this->tbl_account_sets . "` where `default`=true"); $post_date = null; if ($current_post && $current_post->post_status == 'future'){ $post_date = new DateTime($current_post->post_date); $timestamp = mktime($post_date->format('H'), $post_date->format('i'), $post_date->format('s'), $post_date->format('m'), $post_date->format('d'), $post_date->format('Y')); $timestamp += 5*60; $post_date = new DateTime(date('Y-m-d H:i:s',$timestamp)); } function scheduleInputs($type,$post_date){ $month = $post_date ? $post_date->format('n') : date('n',current_time('timestamp',0)); $day = $post_date ? $post_date->format('d') : date('d',current_time('timestamp',0)); $year = $post_date ? $post_date->format('Y') : date('Y',current_time('timestamp',0)); $hour = $post_date ? $post_date->format('G') : date('G',current_time('timestamp',0)); $minute = $post_date ? $post_date->format('i') : date('i',current_time('timestamp',0)); echo " , @ :
Blog post:
Account sets: