当前位置: 首页>>代码示例>>PHP>>正文


PHP BitBase类代码示例

本文整理汇总了PHP中BitBase的典型用法代码示例。如果您正苦于以下问题:PHP BitBase类的具体用法?PHP BitBase怎么用?PHP BitBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BitBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: verifyPayment

 function verifyPayment(&$pPaymentParameters, &$pOrder)
 {
     global $gCommerceSystem;
     unset($_SESSION[$this->code . '_error']);
     if (!empty($pPaymentParameters['cc_ref_id'])) {
         // reference transation
         $this->cc_ref_id = $pPaymentParameters['cc_ref_id'];
     } elseif (empty($pPaymentParameters['cc_number'])) {
         $this->mErrors['number'] = tra('Please enter a credit card number.');
     } elseif ($this->verifyCreditCard($pPaymentParameters['cc_number'], $pPaymentParameters['cc_expires_month'], $pPaymentParameters['cc_expires_year'], $pPaymentParameters['cc_cvv'])) {
         if (empty($pPaymentParameters['cc_owner'])) {
             $this->mErrors['owner'] = tra('Please enter the name card holders name as it is written on the card.');
         } else {
             $this->cc_owner = $pPaymentParameters['cc_owner'];
         }
         if (preg_match('/^37/', $pPaymentParameters['cc_number']) && BitBase::getParameter($pOrder->info, 'currency', $gCommerceSystem->getConfig('DEFAULT_CURRENCY')) != 'USD') {
             $this->mErrors['number'] = tra('American Express cannot process transactions in currencies other than USD. Change the currency in your cart, or use a different card.');
         }
     }
     $this->saveSessionDetails();
     if ($this->mErrors) {
         $_SESSION[$this->code . '_error'] = $this->mErrors;
     }
     return count($this->mErrors) === 0;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:25,代码来源:CommercePluginPaymentCardBase.php

示例2: load

 /**
  * Load the data from the database
  * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash
  **/
 function load()
 {
     if ($this->verifyId($this->mBitForumTopicId) || $this->verifyId($this->mContentId)) {
         // LibertyContent::load()assumes you have joined already, and will not execute any sql!
         // This is a significant performance optimization
         $lookupColumn = $this->verifyId($this->mBitForumTopicId) ? 'bitforum_topic_id' : 'content_id';
         $bindVars = array();
         $selectSql = $joinSql = $whereSql = '';
         array_push($bindVars, $lookupId = @BitBase::verifyId($this->mBitForumTopicId) ? $this->mBitForumTopicId : $this->mContentId);
         $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars);
         $query = "SELECT bft.*, lc.*, uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name {$selectSql} \n\t\t\tFROM `" . BIT_DB_PREFIX . "bitforums_topics` bft \n\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON( lc.`content_id` = bft.`content_id` ) {$joinSql}\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON( uue.`user_id` = lc.`modifier_user_id` )\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON( uuc.`user_id` = lc.`user_id` )\n\t\t\tWHERE bft.`{$lookupColumn}`=? {$whereSql}";
         $result = $this->mDb->query($query, $bindVars);
         if ($result && $result->numRows()) {
             $this->mInfo = $result->fields;
             $this->mContentId = $result->fields['content_id'];
             $this->mBitForumTopicId = $result->fields['bitforum_topic_id'];
             $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user'];
             $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'];
             $this->mInfo['display_url'] = $this->getDisplayUrl();
             $this->mInfo['parsed_data'] = $this->parseData();
             LibertyAttachable::load();
         }
     }
     return count($this->mInfo);
 }
开发者ID:bitweaver,项目名称:forums,代码行数:29,代码来源:BitForumTopic.php

示例3: expunge

 /**
  * expunge 
  * 
  * @param numeric $pContentId 
  * @access public
  * @return ADO result set on success, FALSE on failure
  */
 function expunge($pContentId)
 {
     if (@BitBase::verifyId($pContentId)) {
         $query = "DELETE FROM `" . BIT_DB_PREFIX . "semaphore` WHERE `content_id` = ?";
         $this->mDb->query($query, array($pContentId));
     }
 }
开发者ID:bitweaver,项目名称:semaphore,代码行数:14,代码来源:Semaphore.php

示例4: load

 function load($pGmapId = NULL)
 {
     global $gBitSystem;
     if (!empty($this->mOverlaySetId) || !empty($this->mContentId)) {
         $lookupColumn = !empty($this->mOverlaySetId) ? 'set_id' : 'content_id';
         $bindVars = array();
         $selectSql = '';
         $joinSql = '';
         $whereSql = '';
         array_push($bindVars, $lookupId = @BitBase::verifyId($this->mOverlaySetId) ? $this->mOverlaySetId : $this->mContentId);
         if (!empty($pGmapId) && is_numeric($pGmapId) && $this->mOverlaySetType != NULL) {
             $selectSql = ", osk.*";
             $joinSql = "LEFT JOIN `" . BIT_DB_PREFIX . "gmaps_sets_keychain` osk ON ( osk.`set_id` = os.`set_id` )";
             $whereSql = "AND osk.`gmap_id` = ? AND osk.`set_type` = ?";
             $bindVars = array_merge($bindVars, array($pGmapId, $this->mOverlaySetType));
         }
         $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars);
         $query = "select os.*, lc.*,\n\t\t\t\t\t  uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name,\n\t\t\t\t\t  uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name {$selectSql}\n\t\t\t\t\t  FROM `" . BIT_DB_PREFIX . $this->mOverlaySetTable . "` os\n\t\t\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON (lc.`content_id` = os.`content_id`) {$joinSql}\n\t\t\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON (uue.`user_id` = lc.`modifier_user_id`)\n\t\t\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON (uuc.`user_id` = lc.`user_id`)\n\t\t\t\t\t  WHERE os.`{$lookupColumn}`=? {$whereSql}";
         $result = $this->mDb->query($query, $bindVars);
         if ($result && $result->numRows()) {
             $this->mInfo = $result->fields;
             $this->mInfo['gmap_id'] = $pGmapId;
             $this->mOverlaySetId = $result->fields['set_id'];
             $this->mContentId = $result->fields['content_id'];
         }
     }
     return count($this->mInfo);
 }
开发者ID:bitweaver,项目名称:gmap,代码行数:28,代码来源:BitGmapOverlaySetBase.php

示例5: data_toc

/**
 * Load Function
 */
function data_toc($pData, $pParams)
{
    include_once LIBERTY_PKG_PATH . 'LibertyStructure.php';
    global $gStructure, $gContent, $gBitSmarty;
    if (is_object($gStructure) && $gStructure->isValid()) {
        $struct =& $gStructure;
    } elseif (@BitBase::verifyId($pParams['structure_id'])) {
        $struct = new LibertyStructure($pParams['structure_id']);
        $struct->load();
    } elseif (is_object($gContent)) {
        $structures = $gContent->getStructures();
        // We take the first structure. not good, but works for now - spiderr
        if (!empty($structures[0])) {
            require_once LIBERTY_PKG_PATH . 'LibertyStructure.php';
            $struct = new LibertyStructure($structures[0]['structure_id']);
            $struct->load();
        }
    }
    $repl = ' ';
    if (!empty($struct) && is_object($struct) && $struct->isValid()) {
        if (@BitBase::verifyId($structure_id)) {
            $get_structure = $structure_id;
        } else {
            $get_structure = $struct->mStructureId;
        }
        $tree = $struct->getSubTree($get_structure, !empty($pParams['display']) && $pParams['display'] == 'full_toc');
        $gBitSmarty->assign("subtree", $tree);
        $repl = $gBitSmarty->fetch("bitpackage:liberty/plugins/data_toc.tpl");
    }
    return $repl;
}
开发者ID:kailIII,项目名称:liberty,代码行数:34,代码来源:data.toc.php

示例6: smarty_function_captcha

/**
 * smarty_function_captcha
 */
function smarty_function_captcha($pParams, &$gBitSmarty)
{
    global $gBitSystem, $gBitUser;
    if (!empty($pParams['force']) || empty($_SESSION['captcha_verified']) && !$gBitUser->hasPermission('p_users_bypass_captcha')) {
        $pParams['size'] = !empty($pParams['size']) ? $pParams['size'] : '5';
        $pParams['variant'] = !empty($pParams['variant']) ? $pParams['variant'] : 'condensed';
        if (!empty($pParams['errors'])) {
            $gBitSmarty->assign('errors', $pParams['errors']);
        }
        if ($gBitSystem->isFeatureActive('liberty_use_captcha_freecap')) {
            $pParams['source'] = UTIL_PKG_URL . "freecap/freecap.php";
        } else {
            $getString = 'size=' . $pParams['size'];
            if (@BitBase::verifyId($pParams['width'])) {
                $getString .= '&width=' . $pParams['width'];
            }
            if (@BitBase::verifyId($pParams['height'])) {
                $getString .= '&height=' . $pParams['height'];
            }
            $pParams['source'] = USERS_PKG_URL . "captcha_image.php?{$getString}";
        }
        $gBitSmarty->assign('params', $pParams);
        print $gBitSmarty->fetch("bitpackage:kernel/captcha.tpl");
    }
}
开发者ID:kailIII,项目名称:themes,代码行数:28,代码来源:function.captcha.php

示例7: load

 /**
  * Load an IRList content Item
  *
  * (Describe IRList object here )
  */
 function load($pContentId = NULL)
 {
     if ($pContentId) {
         $this->mContentId = (int) $pContentId;
     }
     if (@$this->verifyId($this->mIRId) || @$this->verifyId($this->mContentId)) {
         $lookupColumn = @$this->verifyId($this->mIRId) ? 'ir_id' : 'content_id';
         $bindVars = array();
         $selectSql = '';
         $joinSql = '';
         $whereSql = '';
         array_push($bindVars, $lookupId = @BitBase::verifyId($this->mIRId) ? $this->mIRId : $this->mContentId);
         $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars);
         $query = "select ir.*, lc.*,\r\n\t\t\t\tuue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name,\r\n\t\t\t\tuuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name,\r\n\t\t\t\tuux.`login` AS closed_user, uuc.`real_name` AS closed_real_name\r\n\t\t\t\t{$selectSql}\r\n\t\t\t\tFROM `" . BIT_DB_PREFIX . "irlist_secondary` ir\r\n\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON ( lc.`content_id` = ir.`content_id` ) {$joinSql}\r\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON (uue.`user_id` = lc.`modifier_user_id`)\r\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON (uuc.`user_id` = lc.`user_id`)\r\n\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uux ON (uux.`user_id` = ir.`closed_user_id`)\r\n\t\t\t\tWHERE ir.`{$lookupColumn}`=? {$whereSql}";
         $result = $this->mDb->query($query, $bindVars);
         if ($result && $result->numRows()) {
             $this->mInfo = $result->fields;
             $this->mContentId = (int) $result->fields['content_id'];
             $this->mIRId = (int) $result->fields['ir_id'];
             $this->mIRName = $result->fields['title'];
             $this->mInfo['creator'] = isset($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user'];
             $this->mInfo['editor'] = isset($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'];
             $this->mInfo['display_url'] = $this->getDisplayUrl();
         }
     }
     LibertyContent::load();
     return;
 }
开发者ID:bitweaver,项目名称:irlist,代码行数:33,代码来源:IRList.php

示例8: attachment_filter_expunge

/**
 * attachment_filter_expunge 
 * 
 * @param string $pString 
 * @param array $pFilterHash 
 * @access public
 * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
 */
function attachment_filter_expunge($pString, &$pFilterHash)
{
    global $gBitSystem;
    if (@BitBase::verifyId($pFilterHash['content_id'])) {
        $gBitSystem->mDb->query("DELETE FROM `" . BIT_DB_PREFIX . "liberty_attachment_usage` WHERE `content_id` = ?", array($pFilterHash['content_id']));
    }
}
开发者ID:kailIII,项目名称:liberty,代码行数:15,代码来源:filter.attachment.php

示例9: storePayment

 function storePayment(&$pParamHash)
 {
     $this->StartTrans();
     if ($this->verifyPayment($pParamHash)) {
         if (@BitBase::verifyId($pParamHash['commissions_payments_id'])) {
             $this->mDb->associateUpdate(TABLE_COMMISSIONS_PAYMENTS, $pParamHash['payment_store'], array('commissions_payments_id' => $pParamHash['commissions_payments_id']));
         } else {
             $pParamHash['commissions_payments_id'] = $this->mDb->GenID('com_commissions_payments_id_seq');
             $pParamHash['payment_store']['commissions_payments_id'] = $pParamHash['commissions_payments_id'];
             $this->mDb->associateInsert(TABLE_COMMISSIONS_PAYMENTS, $pParamHash['payment_store']);
         }
         switch ($pParamHash['payment_store']['payment_method']) {
             case 'storecredit':
                 if ($this->mDb->getAssoc("SELECT * FROM " . TABLE_COUPON_GV_CUSTOMER . " WHERE `customer_id`=?", array($pParamHash['payment_store']['payee_user_id']))) {
                     $this->mDb->query("UPDATE " . TABLE_COUPON_GV_CUSTOMER . " SET `amount`=`amount`+? WHERE `customer_id`=?", array($pParamHash['payment_store']['payment_amount'], $pParamHash['payment_store']['payee_user_id']));
                 } else {
                     $this->mDb->query("INSERT INTO " . TABLE_COUPON_GV_CUSTOMER . " (`amount`,`customer_id`) VALUES (?,?)", array($pParamHash['payment_store']['payment_amount'], $pParamHash['payment_store']['payee_user_id']));
                 }
                 break;
             default:
                 break;
         }
         $this->CompleteTrans();
     } else {
         $this->mDb->RollbackTrans();
     }
     return count($this->mErrors) == 0;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:28,代码来源:CommerceCommissionBase.php

示例10: expunge

 /**
  * Delete entry(ies) from liberty_content_role_map table with content_id.
  * 
  * @param object $pContent 
  */
 function expunge($ContentId = NULL)
 {
     $ret = FALSE;
     if (@BitBase::verifyId($ContentId)) {
         $this->mDb->query("DELETE FROM `" . BIT_DB_PREFIX . "liberty_content_role_map` WHERE `content_id`=?", array($ContentId));
     }
     return $ret;
 }
开发者ID:bitweaver,项目名称:protector,代码行数:13,代码来源:LibertyProtector.php

示例11: currency_yahoo_quote

function currency_yahoo_quote($code, $base = DEFAULT_CURRENCY)
{
    global $gYahooCurrencies;
    $ret = FALSE;
    if (empty($gYahooCurrencies)) {
        currency_yahoo_load($base);
    }
    return BitBase::getParameter($gYahooCurrencies, strtoupper($base . $code));
}
开发者ID:bitweaver,项目名称:commerce,代码行数:9,代码来源:localization.php

示例12: feed_get_status

function feed_get_status($pListHash)
{
    global $gBitDb;
    $whereSql = '';
    $bindVars = array();
    $statuses = array();
    BitBase::prepGetList($pListHash);
    if (!empty($pListHash['user_id'])) {
        $whereSql = " WHERE lal.user_id = ? ";
        $bindVars[] = $pListHash['user_id'];
    } else {
        $whereSql = "WHERE 1=1 ";
    }
    $query = "SELECT lal.content_id, lal.user_id, lal.log_message, MAX(lal.last_modified) AS last_modified, lc.data, uu.login, uu.real_name, uu.email\n\t\t\t  FROM liberty_action_log lal\n\t\t\t  INNER JOIN liberty_content lc ON (lc.content_id=lal.content_id)\n\t\t\t  INNER JOIN liberty_comments lcs ON (lcs.content_id = lc.content_id)\n\t\t\t  INNER JOIN users_users uu ON (uu.user_id=lal.user_id)\n\t\t\t  {$whereSql} AND lc.content_type_guid = 'feedstatus'\n\t\t\t  GROUP BY lal.content_id, lal.user_id, uu.login, uu.real_name, uu.email, lal.log_message,lc.data\n\t\t\t  ORDER BY MAX(lal.last_modified) DESC";
    $res = $gBitDb->query($query, $bindVars, $pListHash['max_records']);
    $user = new BitUser($pListHash['user_id']);
    $user->load();
    while ($status = $res->fetchRow()) {
        $avatarUrl = $user->getThumbnailUrl();
        if (empty($avatarUrl)) {
            $avatarUrl = USERS_PKG_URI . "icons/silhouette.png";
        }
        $status['feed_icon_url'] = $avatarUrl;
        $comment = new LibertyComment(NULL, $status['content_id']);
        $replies = $comment->getComments($status['content_id'], null, null, 'commentDate_asc');
        $status['replies'] = $replies;
        foreach ($status['replies'] as &$reply) {
            $replyUser = new BitUser($reply['user_id']);
            $replyUser->load();
            $replyAvatarUrl = $replyUser->getThumbnailUrl();
            if (empty($replyAvatarUrl)) {
                $replyAvatarUrl = USERS_PKG_URI . "icons/silhouette.png";
            }
            $reply['feed_icon_url'] = $replyAvatarUrl;
        }
        //after loading up the thumbnails in the prior array layout for ease, we break up the array to split long comment threads
        $MAX_SHOWN_REPLIES = 3;
        if (count($status['replies']) > $MAX_SHOWN_REPLIES) {
            $maxIteration = count($status['replies']) - $MAX_SHOWN_REPLIES;
            $i = 0;
            foreach ($status['replies'] as $excess) {
                if ($i < $maxIteration) {
                    $status['replies_excess'][$excess['content_id']] = $excess;
                    //use content_id to index for consistency with normal replies array
                    unset($status['replies'][$excess['content_id']]);
                    //remove from the normal replies array
                } else {
                    break;
                }
                $i++;
            }
        }
        $statuses[] = $status;
    }
    return $statuses;
}
开发者ID:bitweaver,项目名称:feed,代码行数:56,代码来源:feed_lib.php

示例13: existing_files_store

function existing_files_store(&$pStoreRow)
{
    global $gBitSystem, $gContent;
    if (@BitBase::verifyId($gContent->mContentId)) {
        // Update the attachments content_id
        $query = "UPDATE `" . BIT_DB_PREFIX . "liberty_attachments` SET " . "content_id = ? WHERE attachment_id = ?";
        $result = $gContent->mDb->query($query, array($gContent->mContentId, $pStoreRow['attachment_id']));
    }
    return TRUE;
}
开发者ID:kailIII,项目名称:liberty,代码行数:10,代码来源:storage.existing.php

示例14: getProductObject

 function getProductObject($pProductsMixed)
 {
     $productsId = zen_get_prid($pProductsMixed);
     if (BitBase::verifyId($productsId)) {
         if (!isset($this->mProductObjects[$productsId])) {
             if ($this->mProductObjects[$productsId] = bc_get_commerce_product($productsId)) {
                 $ret =& $this->mProductObjects[$productsId];
             }
         }
     }
     return $this->mProductObjects[$productsId];
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:12,代码来源:CommerceOrderBase.php

示例15:

 function __construct($pUprn)
 {
     parent::__construct();
     if (is_numeric($pUprn)) {
         $this->mUprn = $pUprn;
     }
 }
开发者ID:bitweaver,项目名称:nlpg,代码行数:7,代码来源:NlpgProperty.php


注:本文中的BitBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。