本文整理汇总了PHP中bpBase::loadModel方法的典型用法代码示例。如果您正苦于以下问题:PHP bpBase::loadModel方法的具体用法?PHP bpBase::loadModel怎么用?PHP bpBase::loadModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bpBase
的用法示例。
在下文中一共展示了bpBase::loadModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createSitemap
function createSitemap($type, $showMessage = 1)
{
$sitemapConfig = loadConfig('sitemap');
$articleCount = $sitemapConfig['articleCount'] ? $sitemapConfig['articleCount'] : 500;
$ucarCount = $sitemapConfig['ucarCount'] ? $sitemapConfig['ucarCount'] : 500;
$datas = array();
switch ($type) {
default:
case 'news':
$article_db = bpBase::loadModel('article_model');
$articles = $article_db->select(array('ex' => 0), 'link,time,title,keywords', '0,' . $articleCount, 'time DESC');
if ($articles) {
foreach ($articles as $a) {
if (!strExists($a['link'], 'http://')) {
$a['link'] = MAIN_URL_ROOT . $a['link'];
}
if ($a['keywords'] == ',') {
$a['keywords'] = '';
}
array_push($datas, array('url' => $a['link'], 'time' => $a['time'], 'keywords' => $a['keywords']));
}
}
break;
}
$this->_createSitemap($type, $datas, $showMessage);
}
示例2: __construct
function __construct() {
parent::__construct();
$this->exitWithoutAccess('template','manage');
$this->template_db = bpBase::loadModel('template_model');
$this->templateClass=bpBase::loadAppClass('template','template');
$this->cats=$this->templateClass->cats();
if (isset($_GET['siteid'])&&intval($_GET['siteid'])!=$this->siteid){
exit();
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
/***********uid*******************/
$uid = isset($_GET['uid']) && intval($_GET['uid']) > 0 ? intval($_GET['uid']) : 0;
//设置uid为request的数值
$uid = $uid > 0 ? $uid : $this->uid;
$this->assign('uid', $uid);
if (!$uid) {
header('Location:/');
exit;
}
$thisUser = $this->user;
$this->assign('user', $thisUser);
/**********************************************************/
if ($this->uid == $uid) {
$sub = '我';
$my = 1;
} else {
$sub = '他(她)';
$my = 0;
}
$this->uid = $uid;
$this->assign('sub', $sub);
$this->assign('my', $my);
/*********************判断是不是各种经销商***************************/
$storeUserIndependent = 0;
//经销商用户是否单独建表存储
if (intval(loadConfig('store', 'storeUserIndependent'))) {
$storeUserIndependent = 1;
//经销商用户是否单独建表存储
}
if ($uid == $this->uid) {
$this->assign('canManage', 1);
}
if ($uid == $this->uid && !$storeUserIndependent) {
$store_db = bpBase::loadModel('store_model');
$is4sStore = 0;
if ($store_db->select(array('storetype' => 1, 'uid' => $this->uid))) {
$is4sStore = 1;
}
$this->assign('is4sStore', $is4sStore);
//carRental
$isRentalStore = 0;
if ($store_db->select(array('storetype' => 3, 'uid' => $this->uid))) {
$isRentalStore = 1;
}
$this->assign('isRentalStore', $isRentalStore);
//ucar
$ucar_store_db = bpBase::loadModel('usedcar_store_model');
$thisUcarStore = $ucar_store_db->select(array('uid' => $this->uid));
$this->assign('isUcarStore', $thisUcarStore ? 1 : 0);
}
}
示例4: currentCityInfo
function currentCityInfo()
{
$geoObj = bpBase::loadAppClass('geoObj', 'geo', 1);
$ipGeo = $geoObj->getGeoByIP(ip());
if (!$ipGeo) {
$geo_db = bpBase::loadModel('geo_model');
$defaultChildLocation = $geo_db->getDefaultChildLocation();
$ipGeo = $defaultChildLocation;
}
echo '{"city":[{"name":"' . $ipGeo->name . '","id":"' . $ipGeo->id . '","geoindex":"' . $ipGeo->geoindex . '"}]}';
}
示例5: getValue
function getValue($str = '', $avs, $siteID = 0, $channelID = 0, $contentID = 0)
{
//<stl:***></stl:***>
//properties
$id = $avs['ID'];
$sindex = $avs['index'];
//
$geoid = intval($avs['cityid']);
if (!$site) {
$site = 1;
}
//
$adset_db = bpBase::loadModel('adset_model');
if ($id) {
$thisAdSet = $adset_db->singleADSet($id);
} elseif ($sindex) {
$thisAdSet = $adset_db->singleADSetByIndex($sindex, $site);
$id = $thisAdSet->set_id;
}
//
$str = '';
$ad_db = bpBase::loadModel('ad_model');
$ads = $ad_db->adsOfSet($id, 1, $site, 1, $geoid);
switch ($avs['type']) {
case 'couplet':
$bianju = 26;
//距离浏览器边的宽度
$mtop = 50;
//上边距
//左侧广告
switch ($ads[0]->type) {
case 'flash':
$str .= '<div id="couplet_l" style="position:fixed;top:' . $mtop . 'px;_position:absolute;left:' . $bianju . 'px"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' . $ads[0]->width . '" height="' . $ads[0]->height . '"><param name="movie" value="' . $ads[0]->path . '"><param name="quality" value="high"><embed src="' . $ads[0]->path . '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' . $ads[0]->width . '" height="' . $ads[0]->height . '"></embed></object><div style="cursor:pointer;margin:5px 0 0 0;text-align:right;" onclick="$(\'couplet_l\').dispose()">关闭</div></div>';
break;
case 'image':
$str .= '<div id="couplet_l" style="position:fixed;top:' . $mtop . 'px;_position:absolute;left:' . $bianju . 'px"><a href="' . $ads[0]->link . '" target="_blank"><img src="' . $ads[0]->path . '" width="' . $ads[0]->width . '" height="' . $ads[0]->height . '" border="0" /></a><div style="cursor:pointer;margin:5px 0 0 0;text-align:right;" onclick="$(\'couplet_l\').dispose()">关闭</div></div>';
break;
}
//右侧广告
switch ($ads[1]->type) {
case 'flash':
$str .= '<div id="couplet_r" style="position:fixed;top:' . $mtop . 'px;_position:absolute;right:' . $bianju . 'px"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' . $ads[1]->width . '" height="' . $ads[1]->height . '"><param name="movie" value="' . $ads[1]->path . '"><param name="quality" value="high"><embed src="' . $ads[1]->path . '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' . $ads[1]->width . '" height="' . $ads[1]->height . '"></embed></object><div style="cursor:pointer;margin:5px 0 0 0;text-align:right;" onclick="$(\'couplet_r\').dispose()">关闭</div></div>';
break;
case 'image':
$str .= '<div id="couplet_r" style="position:fixed;top:' . $mtop . 'px;_position:absolute;right:' . $bianju . 'px"><a href="' . $ads[1]->link . '" target="_blank"><img src="' . $ads[1]->path . '" width="' . $ads[1]->width . '" height="' . $ads[1]->height . '" border="0" /></a><div style="cursor:pointer;margin:5px 0 0 0;text-align:right;" onclick="$(\'couplet_r\').dispose()">关闭</div></div>';
break;
}
$str .= '';
break;
}
return $str;
}
示例6: __construct
/**
* 构造函数
*
*/
public function __construct($dbObj = null)
{
if (!$dbObj) {
$this->db = bpBase::loadModel('session_model');
} else {
//autoDB;
$this->db = $dbObj;
$this->oldSys = 1;
$this->table = TABLE_PREFIX . 'session';
}
$this->lifetime = loadConfig('site', 'session_ttl');
$this->lifetime = $this->lifetime == '' ? 3600 : $this->lifetime;
session_set_save_handler(array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc'));
session_start();
}
示例7: getValue
function getValue($str = '', $avs, $csiteID = 0, $thisChannelID = 0, $contentID = 0)
{
//<stl:***></stl:***>
$articleObj = bpBase::loadAppClass('articleObj', 'article');
$site = bpBase::loadAppClass('siteObj', 'site');
$content_db = bpBase::loadModel('article_model');
$totalNum = $avs['totalNum'] ? $avs['totalNum'] : 10;
$cat = $avs['cat'] ? $avs['cat'] : 'news';
$cats = array('video', 'news', 'guide', 'comment', 'market');
if (!in_array($cat, $cats)) {
$cat = 'news';
}
$startNum = $avs['startNum'] ? intval($avs['startNum']) : 1;
$startI = $startNum - 1;
$totalNum = $startI + $totalNum;
$orderBy = $avs['orderBy'] ? $avs['orderBy'] : 'viewcount';
$contents = $articleObj->viewRanksByCat($cat, $totalNum, $orderBy);
$returnStr = '';
if ($contents) {
$i = 0;
$middleStr = parent::getMiddleBody($str, 'articleRanks', $this->gTag);
$tags = array('[stl.content.link]', '[stl.content.title]', '[stl.content.thumb]');
$count = 0;
foreach ($contents as $c) {
if ($i > $startI - 1 && $count < $totalNum) {
$replaces = array($c->link, $c->title, $c->thumb);
$valueStr = str_replace($tags, $replaces, $middleStr);
//time
$valueStr = str_replace('[stl.content.time]', date($avs['dateFormat'], $c->time), $valueStr);
//other thumb
$valueStr = str_replace('[stl.content.thumb2]', str_replace('.jpg', '_small.jpg', $c->thumb), $valueStr);
$valueStr = str_replace('[stl.content.thumb3]', str_replace('.jpg', '_middle.jpg', $c->thumb), $valueStr);
$valueStr = str_replace('[stl.content.thumb4]', str_replace('.jpg', '_big.jpg', $c->thumb), $valueStr);
//num
$valueStr = str_replace('[stl.content.num]', $count + $startNum, $valueStr);
//
$returnStr .= $valueStr;
$count++;
}
$i++;
}
}
return $returnStr;
}
示例8: getValue
function getValue($str = '', $avs, $siteID = 0, $channelID = 0, $contentID = 0)
{
//<stl:***></stl:***>
//properties
$seperator = $avs['separator'];
$linkClass = $avs['linkClass'];
$target = $avs['target'] == null ? '_self' : $avs['target'];
//
$channel = bpBase::loadAppClass('channelObj', 'channel', 1);
$crumbArr = $channel->crumbArr($channelID);
$arrCount = count($crumbArr);
//
$site = bpBase::loadAppClass('siteObj', 'site', 1);
if ($siteID < 100) {
$thisSite = $site->getSiteByID($siteID);
} else {
$special_db = bpBase::loadModel('special_model');
$thisSpecial = $special_db->get($siteID);
$thisSite->main = false;
$thisSite->url = $thisSpecial['url'];
$crumbArr[0]['name'] = '专题:' . $thisSpecial['name'];
}
$currentChannel = $channel->getChannelByID($channelID);
$returnStr = '';
if (intval($thisSite->main)) {
$returnStr .= '<a href="/" class="' . $linkClass . '" target="' . $target . '">' . $crumbArr[0]['name'] . '</a>' . $seperator;
} else {
$returnStr .= '<a href="' . $thisSite->url . '" class="' . $linkClass . '" target="' . $target . '">' . $crumbArr[0]['name'] . '</a>' . $seperator;
}
for ($i = 1; $i < $arrCount; $i++) {
if (strlen($crumbArr[$i]['name'])) {
$returnStr .= '<a href="' . $crumbArr[$i]['link'] . '" class="' . $linkClass . '" target="' . $target . '">' . $crumbArr[$i]['name'] . '</a>' . $seperator;
}
}
$returnStr .= '<a href="' . $currentChannel->link . '" class="' . $linkClass . '" target="' . $target . '">' . $currentChannel->name . '</a>';
return $returnStr;
}
示例9: getValue
function getValue($str = '', $avs, $siteID = 0, $channelID = 0, $contentID = 0)
{
//<stl:***></stl:***>
$articleObj = bpBase::loadAppClass('articleObj', 'article');
$mobileConfig = loadConfig('mobile');
$content_db = bpBase::loadModel('article_model');
$avs['sql'] = str_replace('{sysTime}', SYS_TIME, $avs['sql']);
$contents = $content_db->get_resultsBySql($avs['sql']);
$returnStr = '';
if ($contents) {
$middleStr = parent::getMiddleBody($str, 'groupContents', $this->gTag);
$tags = array('[stl.content.author]', '[stl.content.source]', '[stl.content.thumb]', '[stl.content.content]');
foreach ($contents as $c) {
$title = $c->title ? $c->title : $c->atitle;
$replaces = array($c->author, $c->source, $c->thumb, $c->content);
$valueStr = str_replace($tags, $replaces, $middleStr);
if ($avs['titleLen']) {
$valueStr = str_replace('[stl.content.title]', mb_substr($title, 0, $avs['titleLen'], DB_CHARSET), $valueStr);
if (strlen($c->subtitle)) {
//判断是否有副标题
$valueStr = str_replace('[stl.content.subtitle]', mb_substr($title, 0, $avs['titleLen'], DB_CHARSET), $valueStr);
} else {
$valueStr = str_replace('[stl.content.subtitle]', mb_substr($title, 0, $avs['titleLen'], DB_CHARSET), $valueStr);
}
} else {
if (strlen($c->subtitle)) {
//判断是否有副标题
$valueStr = str_replace(array('[stl.content.title]', '[stl.content.subtitle]'), array($title, $title), $valueStr);
} else {
$valueStr = str_replace(array('[stl.content.title]', '[stl.content.subtitle]'), array($title, $title), $valueStr);
}
}
//other thumb
$valueStr = str_replace('[stl.content.thumb2]', str_replace('.jpg', '_small.jpg', $c->thumb), $valueStr);
$valueStr = str_replace('[stl.content.thumb3]', str_replace('.jpg', '_middle.jpg', $c->thumb), $valueStr);
$valueStr = str_replace('[stl.content.thumb4]', str_replace('.jpg', '_big.jpg', $c->thumb), $valueStr);
//
if ($avs['introLen']) {
$valueStr = str_replace('[stl.content.intro]', mb_substr($c->intro, 0, $avs['introLen'], DB_CHARSET), $valueStr);
} else {
$valueStr = str_replace('[stl.content.intro]', $c->intro, $valueStr);
}
$valueStr = str_replace('[stl.content.link]', $c->link, $valueStr);
$valueStr = str_replace('[stl.content.fullTitle]', $c->atitle, $valueStr);
$valueStr = str_replace('[stl.content.oTitle]', $c->atitle, $valueStr);
$valueStr = str_replace('[stl.content.oSubTitle]', $c->asubtitle, $valueStr);
$valueStr = str_replace('[stl.fullTitle]', $c->atitle, $valueStr);
//手机版链接
if ($c->externallink) {
$articleInfo = $articleObj->getLinkInfo($c->link);
if ($articleInfo) {
switch ($articleInfo['type']) {
case 'content':
$mlink = $mobileConfig['homeUrl'] . '/article/' . $articleInfo['id'];
break;
case 'storeContent':
$mlink = $mobileConfig['homeUrl'] . '/store/' . $articleInfo['storeid'] . '/article/' . $articleInfo['id'];
break;
}
} else {
$mlink = $c->link;
}
} else {
$mlink = $mobileConfig['homeUrl'] . '/article/' . $c->id;
}
$valueStr = str_replace('[stl.content.mlink]', $mlink, $valueStr);
//time
$valueStr = str_replace('[stl.content.time]', date($avs['dateFormat'], $c->time), $valueStr);
//auto info
$autoids = explode(',', $c->autoid);
$firstAutoid = 0;
if ($autoids) {
foreach ($autoids as $autoid) {
if (intval($autoid)) {
$firstAutoid = $autoid;
break;
}
}
}
$valueStr = str_replace('[stl.content.autoID]', $firstAutoid, $valueStr);
if (intval($c->autograde) == 1) {
if (URL_REWRITE) {
$valueStr = str_replace('[stl.content.autolink]', CAR_URL_ROOT . '/brand-' . $firstAutoid . '.html', $valueStr);
} else {
$valueStr = str_replace('[stl.content.autolink]', CAR_URL_ROOT . '/brand.php?id=' . $firstAutoid, $valueStr);
}
} else {
if (URL_REWRITE) {
$valueStr = str_replace('[stl.content.autolink]', CAR_URL_ROOT . '/' . $firstAutoid, $valueStr);
} else {
$valueStr = str_replace('[stl.content.autolink]', CAR_URL_ROOT . '/g3auto.php?id=' . $firstAutoid, $valueStr);
}
}
if ($firstAutoid) {
$valueStr = str_replace('[stl.content.autodisplay]', '', $valueStr);
} else {
$valueStr = str_replace('[stl.content.autodisplay]', ' style="display:none"', $valueStr);
}
//THIS AUTO
if ($firstAutoid) {
//.........这里部分代码省略.........
示例10: __construct
function __construct()
{
$this->article_db = bpBase::loadModel('article_model');
//$this->user_db = bpBase::loadModel('user_model');
}
示例11: delete
/**
* 删除缓存
* @param string $name 缓存名称
* @param array $setting 缓存配置
* @param string $type 缓存类型
* @param string $module 所属模型
* @return bool
*/
public function delete($name, $setting = '', $type = 'data', $module = ROUTE_MODEL)
{
$this->get_setting($setting);
if (empty($type)) {
$type = 'data';
}
if (empty($module)) {
$module = ROUTE_MODEL;
}
$filepath = CACHE_PATH . 'caches_' . $module . '/caches_' . $type . '/';
$filename = $name . $this->_setting['suf'];
if (file_exists($filepath . $filename)) {
if ($module == 'commons' && substr($name, 0, 16) != 'category_content') {
$db = bpBase::loadModel('cache_model');
$db->delete(array('filename' => $filename, 'path' => 'caches_' . $module . '/caches_' . $type . '/'));
}
return @unlink($filepath . $filename) ? true : false;
} else {
return false;
}
}
示例12: M
function M($tablename)
{
return bpBase::loadModel($tablename . '_model');
}
示例13: foreGroundSignin
public function foreGroundSignin($userName, $unencryptPw, $nextUrl, $rememberMe = 1)
{
$systemConfig = loadConfig('system');
$oUserName = $userName;
//判断域名是不是ip
$hostSections = explode('.', $_SERVER['HTTP_HOST']);
//ip
$isIP = 0;
if (count($hostSections) == 4 && intval($hostSections[3])) {
$isIP = 1;
}
//
$sync = 0;
$echoStr = '';
$signSuccess = 0;
//
if ($systemConfig['syncWithUc']) {
$ucenterUserName = $userName;
if (defined('UCENTER_CHARSET') && UCENTER_CHARSET == 'utf-8') {
$ucenterUserName = iconv('gbk', 'utf-8', $ucenterUserName);
}
$sync = 1;
include ABS_PATH . 'uc_client' . DIRECTORY_SEPARATOR . 'client.php';
list($uid, $userName, $password, $email) = uc_user_login($ucenterUserName, $unencryptPw);
if ($uid > 0) {
$ucsynlogin = uc_user_synlogin($uid);
$signSuccess = 1;
//
$echoStr = $ucsynlogin;
}
} elseif ($systemConfig['syncWithPhpwind']) {
$sync = 1;
define('AUTOSYSTEM', '1');
include ABS_PATH . 'pw_api.php';
include ABS_PATH . 'uc_client' . DIRECTORY_SEPARATOR . 'uc_client.php';
$logintype = 0;
//登陆类型 0,1,2分别为 用户名,uid,邮箱登陆
$pw = md5($unencryptPw);
/*
同步登录的返回值
Array {
Status:-1 用户名错误,找不到用户;-2 密码错误;-3 邮箱地址重复;1 正常登陆;
Uid:用户ID
Username:用户名
Synlogin: 同步登陆代码(js)
}
*/
$userArr = uc_user_login($userName, $pw, $checkques = 0, $question = '', $answer = '');
$thisUser = uc_user_get($userName);
$email = $thisUser['email'];
//
$status = $userArr['status'];
$uid = $userArr['uid'];
$userName = $userArr['username'];
if ($status > 0) {
//login success
$signSuccess = 1;
$echoStr = $userArr['synlogin'];
}
}
if (!$sync) {
//if not sync with ucenter or phpwind
$signSuccess = $this->signin($oUserName, $unencryptPw);
$this->uid = $signSuccess;
}
if ($signSuccess > 0) {
//登录成功,设置session和cookies
$u = $this->getUserByUsername($oUserName);
//
if ($u) {
$this->uid = $u->uid;
$uid = $u->uid;
$this->updateIP($u->uid);
$_SESSION['autouid'] = $u->uid;
session_regenerate_id();
if ($rememberMe) {
setcookie('autousername', $oUserName, SYS_TIME + 2592000, '/', DOMAIN_ROOT);
if ($isIP) {
setcookie('autousername', $oUserName, SYS_TIME + 2592000, '/', $_SERVER['HTTP_HOST']);
}
}
unset($_SESSION['autoAdminUid']);
} else {
//ucenter或者phpwind上有此用户而系统内没有,注册到系统
$rt = $this->signup($oUserName, $email, $password);
$this->uid = $rt;
//login
setcookie('autousername', $oUserName, SYS_TIME + 2592000, '/', DOMAIN_ROOT);
if ($isIP) {
setcookie('autousername', $oUserName, SYS_TIME + 2592000, '/', $_SERVER['HTTP_HOST']);
}
}
//next url
if (!strlen($nextUrl)) {
$nextUrl = '/';
}
//检查是不是经销商
$store_db = bpBase::loadModel('store_model');
$storeUserIndependent = 0;
//经销商用户是否单独建表存储
//.........这里部分代码省略.........
示例14: __construct
function __construct()
{
$this->site_db = bpBase::loadModel('site_model');
}
示例15: specialChannelsTreeStr
public function specialChannelsTreeStr()
{
$specialid = intval($_GET['specialid']);
$channel_db = bpBase::loadModel('channel_model');
$channels = $channel_db->select(array('specialid' => $specialid), '*', $limit = '', $order = '`taxis` ASC');
if ($channels) {
foreach ($channels as $c) {
echo '<div style="padding:0 0 0 48px;"><nobr><img src="image/folder.gif" align="absmiddle" /> <a href="?m=article&c=m_article&a=articles&id=' . $c['id'] . '&site=' . $specialid . '" target="sright">' . $c['name'] . '</a></nobr></div>';
}
} else {
echo '<div style="padding:0 0 0 48px;">该专题没有栏目</div>';
}
}