• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BitBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了BitBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: mime_pbase_store

/**
 * Store the data in the database
 * 
 * @param array $pStoreRow File data needed to store details in the database - sanitised and generated in the verify function
 * @access public
 * @return TRUE on success, FALSE on failure - $pStoreRow[errors] will contain reason
 */
function mime_pbase_store(&$pStoreRow)
{
    global $gBitSystem;
    $ret = FALSE;
    if (@BitBase::verifyId($pStoreRow['pbase_id'])) {
        // add the data into liberty_attachments to make this file available as attachment
        $storeHash = array("attachment_id" => $pStoreRow['attachment_id'], "content_id" => $pStoreRow['content_id'], "attachment_plugin_guid" => PLUGIN_MIME_GUID_PBASE, "foreign_id" => $pStoreRow['pbase_id'], "user_id" => $pStoreRow['user_id']);
        $gBitSystem->mDb->associateInsert(BIT_DB_PREFIX . "liberty_attachments", $storeHash);
        $ret = TRUE;
    } else {
        $pStoreRow['errors']['pbase_id'] = "No valid PBase ID given.";
    }
    return $ret;
}
开发者ID:kailIII,项目名称:liberty,代码行数:21,代码来源:mime.pbase.php


示例16: mime_flash_store_preferences

/**
 * mime_flash_store_preferences 
 * 
 * @param array $pFileHash Flash information
 * @access public
 * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
 */
function mime_flash_store_preferences(&$pFileHash)
{
    $ret = FALSE;
    if (@BitBase::verifyId($pFileHash['attachment_id'])) {
        list($pFileHash['preferences']['width'], $pFileHash['preferences']['height'], $type, $attr) = getimagesize(STORAGE_PKG_PATH . $pFileHash['upload']['dest_branch'] . $pFileHash['upload']['name']);
        // store width of video
        if (!empty($pFileHash['preferences']['width'])) {
            LibertyMime::storeAttachmentPreference($pFileHash['attachment_id'], 'width', $pFileHash['preferences']['width']);
        }
        // store height of video
        if (!empty($pFileHash['preferences']['height'])) {
            LibertyMime::storeAttachmentPreference($pFileHash['attachment_id'], 'height', $pFileHash['preferences']['height']);
        }
        $ret = TRUE;
    }
    return $ret;
}
开发者ID:kailIII,项目名称:liberty,代码行数:24,代码来源:mime.flash.php


示例17: getLibertyObject

 /**
  * Given a content_id, this will return and object of the proper type
  *
  * @param integer content_id of the object to be returned
  * @param string optional content_type_guid of pConId. This will save a select if you happen to have this info. If not, this method will look it up for you.
  * @param call load on the content. Defaults to true.
  * @returns object of the appropriate content type class
  */
 public static function getLibertyObject($pContentId, $pContentGuid = NULL, $pLoadContent = TRUE)
 {
     $ret = NULL;
     global $gLibertySystem, $gBitUser, $gBitSystem;
     if (BitBase::verifyId($pContentId)) {
         // remove non integer bits from structure_id and content_id requests
         // can happen with period's at the end of url's that are email'ed around
         $pContentId = preg_replace('/[\\D]/', '', $pContentId);
         if (empty($pContentGuid)) {
             $pContentGuid = $gLibertySystem->mDb->getOne("SELECT `content_type_guid` FROM `" . BIT_DB_PREFIX . "liberty_content` WHERE `content_id`=?", array($pContentId));
         }
         if (!empty($pContentGuid) && isset($gLibertySystem->mContentTypes[$pContentGuid]) && ($typeClass = $gLibertySystem->getContentClassName($pContentGuid))) {
             $creator = new $typeClass();
             $ret = $creator->getNewObject($typeClass, $pContentId, $pLoadContent);
         }
     }
     return $ret;
 }
开发者ID:kailIII,项目名称:liberty,代码行数:26,代码来源:LibertyBase.php


示例18: getProductHistory

 function getProductHistory($pListHash)
 {
     $whereSql = '';
     $bindVars = array();
     if (@BitBase::verifyId($pListHash['products_id'])) {
         $whereSql = 'cop.`products_id`=?';
         $bindVars[] = $pListHash['products_id'];
     }
     if (@BitBase::verifyId($pListHash['user_id'])) {
         $whereSql = 'lc.`user_id`=?';
         $bindVars[] = $pListHash['user_id'];
     }
     if ($whereSql) {
         $sql = "SELECT cop.`orders_products_id` AS `hash_key`, co.*, cop.*," . $this->mDb->SQLDate('Y-m-d H:i', 'co.`date_purchased`') . " AS `purchase_time` \n\t\t\t\t\tFROM " . TABLE_ORDERS . " co \n\t\t\t\t\t\tINNER JOIN " . TABLE_ORDERS_PRODUCTS . " cop ON(co.`orders_id`=cop.`orders_id`)\n\t\t\t\t\t\tLEFT OUTER JOIN " . TABLE_PRODUCTS . " cp ON(cp.`products_id`=cop.`products_id`)\n\t\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON(lc.`content_id`=cp.`content_id`)\n\t\t\t\t\tWHERE {$whereSql}\n\t\t\t\t\tORDER BY co.`orders_id` DESC";
         $ret = $this->mDb->getAssoc($sql, $bindVars);
     }
     return $ret;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:18,代码来源:CommerceOrderManager.php


示例19: smarty_function_displayname

function smarty_function_displayname($pParams, &$gBitSmarty)
{
    global $gBitUser;
    if (!empty($pParams['hash'])) {
        if (is_array($pParams['hash'])) {
            $hash = array_merge($pParams, $pParams['hash']);
            unset($hash['hash']);
            // if the hash only has a user_id, we need to look up the user
            if (@BitBase::verifyId($hash['user_id']) && empty($hash['user']) && empty($hash['email']) && empty($hash['login'])) {
                $lookupHash['user_id'] = $hash['user_id'];
            }
        } else {
            // We were probably just passed the 'login' due to legacy code which has yet to be converted
            if (strpos('@', $pParams['hash'])) {
                $lookupHash['email'] = $hash;
            } elseif (is_numeric($pParams['hash'])) {
                $lookupHash['user_id'] = $hash;
            } else {
                $lookupHash['login'] = $hash;
            }
        }
    } elseif (!empty($pParams['user_id'])) {
        $lookupHash['user_id'] = $pParams['user_id'];
    } elseif (!empty($pParams['email'])) {
        $lookupHash['email'] = $pParams['email'];
    } elseif (!empty($pParams['login'])) {
        $lookupHash['login'] = $pParams['login'];
    } elseif (!empty($pParams['user'])) {
        $lookupHash['login'] = $pParams['user'];
    } elseif (empty($pParams)) {
        global $gBitUser;
        $hash = $gBitUser->mInfo;
    }
    if (!empty($lookupHash)) {
        $hash = $gBitUser->getUserInfo($lookupHash);
    }
    if (!empty($hash)) {
        $displayName = BitUser::getDisplayNameFromHash(empty($pParams['nolink']), $hash);
    } else {
        // Now we're really in trouble. We don't even have a user_id to work with
        $displayName = "Unknown";
    }
    return $displayName;
}
开发者ID:kailIII,项目名称:themes,代码行数:44,代码来源:function.displayname.php


示例20: bit_files_store

function bit_files_store(&$pStoreRow)
{
    global $gBitSystem, $gBitUser;
    $ret = NULL;
    // we have been given an attachment_id but no foreign_id. we will make a last attempt to see if this is an update or an insert
    if (@BitBase::verifyId($pStoreRow['attachment_id']) && !@BitBase::verifyId($pStoreRow['foreign_id'])) {
        $pStoreRow['foreign_id'] = $gBitSystem->mDb->getOne("SELECT `foreign_id` FROM `" . BIT_DB_PREFIX . "liberty_attachments` WHERE `attachment_id` = ?", array($pStoreRow['attachment_id']));
    }
    if (@BitBase::verifyId($pStoreRow['foreign_id'])) {
        $sql = "UPDATE `" . BIT_DB_PREFIX . "liberty_files` SET `file_name`=?, `mime_type`=?, `file_size`=? WHERE `file_id` = ?";
        $gBitSystem->mDb->query($sql, array($pStoreRow['upload']['name'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $pStoreRow['foreign_id']));
    } else {
        $pStoreRow['foreign_id'] = $gBitSystem->mDb->GenID('liberty_files_id_seq');
        $sql = "INSERT INTO `" . BIT_DB_PREFIX . "liberty_files` ( `file_name`, `file_id`, `mime_type`, `file_size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
        $userId = !empty($pStoreRow['upload']['user_id']) ? $pStoreRow['upload']['user_id'] : $gBitUser->mUserId;
        $gBitSystem->mDb->query($sql, array($pStoreRow['upload']['name'], $pStoreRow['foreign_id'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $userId));
    }
    return $ret;
}
开发者ID:kailIII,项目名称:liberty,代码行数:19,代码来源:storage.bitfile.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BitmapHandler类代码示例发布时间:2022-05-23
下一篇:
PHP Bin_Query类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap