Exemple #1
0
                $wpdb->query("UPDATE `" . $wpdb->prefix . "product_order` SET `order` = (`order` - 1) WHERE `category_id` IN('{$position_cat_id}') AND `product_id` NOT IN('{$position_prod_id}') AND `order` > '" . $current_order_row['order'] . "'");
            }
            break;
        default:
            break;
    }
}
/*
 * Adds new products
 */
if ($_POST['submit_action'] == 'add') {
    // well, there is simply no way to do this other than the blatantly obvious, so here it is
    if (!is_callable('getshopped_item_limit') || @getshopped_item_limit() !== false) {
        //Allen's Change for Google base
        if (isset($_GET['token']) || isset($_SESSION['google_base_sessionToken'])) {
            $sessionToken = exchangeToken($_GET['token']);
            $_SESSION['google_base_sessionToken'] = $sessionToken;
            if (isset($_SESSION['google_base_sessionToken'])) {
                $sessionToken = $_SESSION['google_base_sessionToken'];
            }
            postItem($_POST['name'], $_POST['price'], $_POST['description'], $sessionToken);
        }
        //Google base change ends here
        $file_name = null;
        if ($_POST['file_url'] != null) {
            $url_array = array_reverse(explode("/", $_POST['file_url']));
            if (is_file(WPSC_FILE_DIR . $url_array[0])) {
                $file_name = $url_array[0];
            }
        }
        $thumbnail_image = '';
Exemple #2
0
/**
 * We arrive here after the user first authenticates and we get back
 * a single-use token.
 * @return void
 */
function showFirstAuthScreen()
{
    $singleUseToken = $_GET['token'];
    $sessionToken = exchangeToken($singleUseToken);
    if (!$sessionToken) {
        showIntroPage();
    } else {
        $tableTitle = "Here's your <b>single use token:</b> " . "<code>{$singleUseToken}</code><br/>" . "\n" . "And here's the <b>session token:</b> <code>{$sessionToken}</code>";
        showMainMenu($tableTitle, $sessionToken);
    }
}
Exemple #3
0
function set_gdata_token()
{
    global $cfg;
    $site = $_SERVER['SERVER_NAME'];
    $self = $_SERVER['PHP_SELF'];
    $loc = "http://" . $site . $self . "?loc=options";
    $token = $_GET['token'];
    $newToken = exchangeToken($token);
    set_config("<?PHP\n");
    set_config('$GDATA_TOKEN="' . $newToken . "\";\n");
    echo "<html>\n<body>\n<head>\n<title>PWA + PHP Setup: Step 2 of 3</title>\n</head>\n";
    echo "Done.  Token retrieved and saved in config file '{$cfg}'.<br />";
    echo "Continue to <a href='{$loc}'>Step 3</a>...\n";
    echo "</body>\n</html>";
}
function wpsc_send_to_google_base($product_data)
{
    require_once 'google_base_functions.php';
    if (strlen(get_option('wpsc_google_base_token')) > 0) {
        $token = get_option('wpsc_google_base_token');
        // 		if (isset($_SESSION['google_base_sessionToken'])) {
        // 			$sessionToken = $_SESSION['google_base_sessionToken'];
        // 		} else {
        $sessionToken = exchangeToken($token);
        // 			$_SESSION['google_base_sessionToken'] = $sessionToken;
        // 		}
        postItem($product_data['name'], $product_data['price'], $product_data['description'], $sessionToken);
    }
}
/**
 * We arrive here after the user first authenticates and we get back
 * a single-use token.
 */
function showFirstAuthScreen()
{
    $singleUseToken = $_GET['token'];
    $sessionToken = exchangeToken($singleUseToken);
    if (!$sessionToken) {
        showIntroPage();
    } else {
        $tableTitle = 'Here\'s your <b>single use token:</b> <code>' . $singleUseToken . '</code>' . "\n" . '<br>And here\'s the <b>session token:</b> <code>' . $sessionToken . '</code>';
        showMainMenu($tableTitle, $sessionToken);
    }
}