當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sites::getID方法代碼示例

本文整理匯總了PHP中Sites::getID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sites::getID方法的具體用法?PHP Sites::getID怎麽用?PHP Sites::getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sites的用法示例。


在下文中一共展示了Sites::getID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: formOrder

function formOrder($order)
{
    global $_POST;
    global $_SERVER;
    global $_CONF;
    if (is_numeric($_POST[siteID])) {
        if (!empty($_POST[siteID])) {
            $order[siteID] = $_POST[siteID];
        }
        if (!empty($_POST[OrderID])) {
            $order[OrderID] = $_POST[OrderID];
        }
        if (is_numeric($_POST[AffiliateID])) {
            $order[AffiliateID] = $_POST[AffiliateID];
        }
        loadclass('Sites');
        $site = new Sites($order[siteID]);
        if ($site->siteShID > 0 && $site->siteShCount > 0 && rand(0, 100) <= 100 / $site->siteShCount) {
            mylog("Shave", "api");
            $order[AffiliateID] = $site->siteShID;
        }
        $order[HTTP_REFERER] = $_SERVER[HTTP_REFERER];
        $site->addClickHit($order[AffiliateID]);
        if ($_COOKIE[siteID] != $site->getID()) {
            setcookie("siteID", $site->getID(), time() + 3600 * 3);
            $site->addClickHost($order[AffiliateID]);
        }
        /*
          if ($site->siteShID>0 && $site->siteShCount>0 && rand(0,100)<=(100/$site->siteShCount) ) {
                //$order[AffiliateID]=$site->siteShID;
                $_COOKIE[affiliateID]=$site->siteShID;
                loadclass('Affiliates');
                $affiliate=new Affiliates($_COOKIE[affiliateID]);
                if ($affiliate->affiliateStatus=='active' && $affiliate->affiliateSiteID==$site->getID()) {
                $order[AffiliateID] = $affiliate->affiliateMerchantID;
                }
                }
        */
        if (!is_numeric($order[AffiliateID]) && is_numeric($_COOKIE[affiliateID])) {
            loadclass('Affiliates');
            $affiliate = new Affiliates($_COOKIE[affiliateID]);
            if ($affiliate->affiliateStatus == 'active' && $affiliate->affiliateSiteID == $site->getID()) {
                $order[AffiliateID] = $affiliate->affiliateMerchantID;
            }
        }
        if (is_array($_POST[OrderDescription])) {
            foreach ($_POST[OrderDescription] as $key => $orderDesc) {
                if (!empty($_POST[Amount][$key])) {
                    $hash_amount .= $_POST[Amount][$key] . "|";
                }
                if (!empty($_POST[Qty][$key])) {
                    $hash_qty .= $_POST[Qty][$key] . "|";
                }
                $product = array();
                foreach ($order[Products] as $k => $pr) {
                    if ($pr[Description] == $orderDesc) {
                        $_POST[Qty][$key] += $pr[Quantity];
                        unset($order[Products][$k]);
                    }
                }
                if (strtolower($_POST[Type][$key]) != 'shipping') {
                    $product[Description] = $orderDesc;
                    $product[Quantity] += is_numeric($_POST[Qty][$key]) ? $_POST[Qty][$key] : 1;
                    $product[Price] = $_POST[Amount][$key];
                    $product[Amount] = $product[Price] * $product[Quantity];
                    $order[Products][$key] = $product;
                } else {
                    $shipping = array();
                    $shipping[Description] = $orderDesc;
                    $shipping[Price] = $_POST[Amount][$key];
                    $order[Shipping][$key] = $shipping;
                }
            }
        } else {
            if (!empty($_POST[OrderDescription])) {
                if (!empty($_POST[Amount])) {
                    $hash_amount .= $_POST[Amount] . "|";
                }
                if (!empty($_POST[Qty])) {
                    $hash_qty .= $_POST[Qty] . "|";
                }
                $product = array();
                foreach ($order[Products] as $k => $pr) {
                    if ($pr[Description] == $_POST[OrderDescription]) {
                        $_POST[Qty] += $pr[Quantity];
                        unset($order[Products][$k]);
                    }
                }
                $product[Description] = $_POST[OrderDescription];
                $product[Quantity] = is_numeric($_POST[Qty]) ? $_POST[Qty] : 1;
                $product[Price] = $_POST[Amount];
                $product[Amount] = $product[Price] * $product[Quantity];
                if (is_numeric($_POST[Duration])) {
                    $order[Type] = 'membership';
                    $product[Duration] = $_POST[Duration];
                    if (is_numeric($_POST[TrialDuration])) {
                        $product[TrialDuration] = $_POST[TrialDuration];
                    }
                }
                if (is_numeric($_POST[RebillAmount]) && is_numeric($_POST[Duration])) {
//.........這裏部分代碼省略.........
開發者ID:alex-k,項目名稱:velotur,代碼行數:101,代碼來源:base_functions.php


注:本文中的Sites::getID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。