Example #1
0
         $hide_voting = 1;
     }
     if ($user->ID == $comment->user_id) {
         $hide_voting = 1;
     }
 }
 $link = '';
 if ((int) $comment->user_id > 0) {
     $user = get_user_by('id', $comment->user_id);
     if (is_object($user) && isset($user->data->user_login)) {
         $link = '<a href="' . get_bloginfo('url') . '/?p=' . get_option('viewprofile_page_id') . '&profile=' . $user->data->user_login . '">' . $user->data->display_name . '</a>';
     } else {
         $link = $user->data->display_name;
         //sprintf(__( get_comment_author_link() ));
Example #2
0
                $GLOBALS['posts'] = (int) $_POST['posts'][$c];
            }
            autoposting_exec(array('campaign_id' => $c, 'app_id' => $_POST['autoposting_stack_id']));
            $_SESSION['postnow']['campaign_' . $c]['posts'] = $posts;
        }
        wp_safe_redirect("?page=themefurnace#/post-now");
        exit;
    }
}
if (!empty($_POST['autoposting_site'])) {
    global $wpdb, $table_prefix;
    $table_name = $table_prefix . 'autoposting_campaigns';
    if ($_GET['campaign'] == 'new') {
        $wpdb->query("insert into " . $table_name . " \r\r            (campaign_name, search_term, site, interval_days, interval_hours, category_id, post_status, enabled)\r\r            \r\r            values (\r\r            '" . $_POST['autoposting_campaign_name'] . "', '" . $_POST['autoposting_search_term'] . "', '" . $_POST['autoposting_site'] . "',\r\r            '" . (int) $_POST['autoposting_interval_days'] . "', '" . (int) $_POST['autoposting_interval_hours'] . "', '" . $_POST['autoposting_category'] . "',\r\r            '" . $_POST['autoposting_post_status'] . "', '" . $_POST['autoposting_campaign_enabled'] . "'\r\r            )\r\r        ");
        $id = $wpdb->insert_id;
    } else {
        $id = (int) $_GET['campaign'];
        $wpdb->query("update " . $table_name . " set\r\r            campaign_name='" . $_POST['autoposting_campaign_name'] . "',\r\r            search_term='" . $_POST['autoposting_search_term'] . "', \r\r            site='" . $_POST['autoposting_site'] . "', \r\r            interval_days='" . (int) $_POST['autoposting_interval_days'] . "', \r\r            interval_hours='" . (int) $_POST['autoposting_interval_hours'] . "', \r\r            category_id='" . $_POST['autoposting_category'] . "',\r\r            post_status='" . $_POST['autoposting_post_status'] . "', \r\r            enabled='" . $_POST['autoposting_campaign_enabled'] . "'\r\r            \r\r            WHERE id='" . $id . "'\r\r        ");
    }
    // add/modify scheduled task for enabled campaign
    if ($_POST['autoposting_campaign_enabled'] == '1') {
        // check if we should exec it
        $interval = make_post_interval($_POST['autoposting_interval_days'], $_POST['autoposting_interval_hours']);
        $last_update = $wpdb->get_col("select last_post_time from " . $table_prefix . "autoposting_status where campaign_id='" . $id . "'");
        if (empty($last_update) || $last_update[0] + $interval >= time()) {
            // autoposting_exec(array('campaign_id' => $id, 'app_id' => $_POST['autoposting_stack_id']));
        }
    }
    // unset post for upthemes
    $_POST = array();
    if ($_GET['campaign'] == 'new') {