本文整理汇总了PHP中spClass函数的典型用法代码示例。如果您正苦于以下问题:PHP spClass函数的具体用法?PHP spClass怎么用?PHP spClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spClass函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: agree
public function agree($apply_id)
{
$conditions['apply_id'] = $apply_id;
$apply = $this->find_one($conditions);
if ($apply) {
$this->update(array('apply_id' => $apply_id), array('status' => 1));
$ptx_user = spClass("ptx_user");
if ($apply['apply_type'] == 1) {
$ptx_user->update_staruser($apply['user_id'], 1);
$ptx_staruser = spClass("ptx_staruser");
$data['user_id'] = $apply['user_id'];
$data['medal_id'] = $apply['medal_id'];
$data['star_reason'] = $apply['message_txt'];
$ptx_staruser->add_one($data);
$ptx_staruser->update_staruser_cache();
} elseif ($apply['apply_type'] == 2) {
$data['user_id'] = $apply['user_id'];
$data['store_category_id'] = $apply['store_category_id'];
$data['shop_desc'] = $apply['message_txt'];
$ptx_goodshop = spClass('ptx_goodshop');
$ptx_goodshop->add_one($data);
$ptx_user->update_shopuser($apply['user_id'], 1);
}
$this->deleteByPk($apply_id);
}
return;
}
开发者ID:httvncoder,项目名称:151722441,代码行数:27,代码来源:ptx_apply.php
示例2: logout
function logout()
{
unset($_SESSION['username']);
unset($_SESSION['password']);
spClass('spAcl')->set("");
$this->display("login.htm");
// 显示模板,这里使用的模板是根目录/tpl/green/index.html。
}
开发者ID:wateronface,项目名称:php,代码行数:8,代码来源:main.php
示例3: updatesave
function updatesave()
{
$i_order = spClass("i_order");
$param = $this->spArgs();
$conditions = array('id' => $param['chk_list'][0]);
$this->results = $i_order->find($conditions);
$this->display("i_order_updateform.htm");
// 显示模板
}
开发者ID:wateronface,项目名称:php,代码行数:9,代码来源:i_pay_action.php
示例4: index
/** @brief 显示首页 */
function index()
{
if (!$this->visitor->is_login()) {
$this->login();
} else {
$members = spClass('UserModel')->findAll(array('store_id' => $this->visitor['user']['store_id']));
$this->member = $members;
$this->display('index.html');
}
}
开发者ID:eon-hong,项目名称:anypay,代码行数:11,代码来源:main.php
示例5: updatesave
function updatesave()
{
$model = spClass("product");
$param = $this->spArgs();
$conditions = array('id' => $param['id']);
$model->update($conditions, $param);
// echo($model->dumpSql());
$this->results = spUrl("product_action", "index");
$this->display("ok.htm");
// 显示模板
}
开发者ID:wateronface,项目名称:php,代码行数:11,代码来源:product_action.php
示例6: userlogin
public function userlogin($uname, $upass)
{
$conditions = array('uname' => $uname, 'upass' => $upass);
if ($result = $this->find($conditions)) {
spClass('FeiAcl')->set($result['acl']);
$_SESSION["userinfo"] = $result;
return true;
} else {
return false;
}
}
开发者ID:daolei,项目名称:grw,代码行数:11,代码来源:model_user.php
示例7: addfuncs
/**
* 注册已挂靠的视图函数
*/
public function addfuncs()
{
if (is_array($GLOBALS['G_SP']["view_registered_functions"]) && method_exists($this->engine, 'register_function')) {
foreach ($GLOBALS['G_SP']["view_registered_functions"] as $alias => $func) {
if (is_array($func) && !is_object($func[0])) {
$func = array(spClass($func[0]), $func[1]);
}
$this->engine->register_function($alias, $func);
}
}
}
开发者ID:eon-hong,项目名称:anypay,代码行数:14,代码来源:spView.php
示例8: addfuncs
/**
* 注册视图函数
*/
public function addfuncs()
{
if (is_array($GLOBALS['G_SP']["view_registered_functions"])) {
foreach ($GLOBALS['G_SP']["view_registered_functions"] as $alias => $func) {
if (is_array($func) && !is_object($func[0])) {
$func = array(spClass($func[0]), $func[1]);
}
$this->engine->registerPlugin("function", $alias, $func);
unset($GLOBALS['G_SP']["view_registered_functions"][$alias]);
}
}
}
开发者ID:ngsoqia,项目名称:soupian,代码行数:15,代码来源:spView.php
示例9: verify
public function verify($var)
{
if (empty($var)) {
return false;
}
$text = spClass('spSession')->get('vcode');
if ($var != $text) {
return false;
} else {
return true;
}
}
开发者ID:eon-hong,项目名称:anypay,代码行数:12,代码来源:spVerifyCode.php
示例10: login
public function login($username, $password)
{
$conditions = array('username' => $username, 'password' => $password);
if ($result = $this->find($conditions)) {
spClass('spAcl')->set($result['acl_name']);
$result['password'] = md5($result['password']);
$_SESSION["user"] = $result;
return true;
} else {
return false;
}
}
开发者ID:hfutxqd,项目名称:keding_website,代码行数:12,代码来源:user.php
示例11: user
public function user()
{
$this->parameter_need('sname');
$ptx_user = spClass('ptx_user');
$user = $ptx_user->find(array('domain' => $this->sname), ' ptx_user.user_id ');
$this->user_id = $user['user_id'];
$act = $this->spArgs("act");
if (in_array($act, array('focus', 'shares', 'album', 'favorite_share', 'following', 'fans', 'timeline', 'forumline'))) {
eval("\$this->{$act}();");
} else {
$this->timeline();
}
}
开发者ID:httvncoder,项目名称:151722441,代码行数:13,代码来源:pub.php
示例12: action
public function action()
{
$user = spClass("users");
$userAppId = $this->spArgs("userAppId", 123);
$sql = "select * from users where users.userAppId=" . $userAppId;
$result = $user->findSql($sql);
// 执行查找
//dump($result); //输出数组
$json_Str = json_encode($result);
if ($json_Str != "false") {
echo $json_Str;
}
}
开发者ID:as3long,项目名称:as3long,代码行数:13,代码来源:dbTest.php
示例13: getUserSkin
private function getUserSkin($bid = 0)
{
if ($this->spArgs('domain') != 'home' && $this->spArgs('domain') != '') {
$rs = spClass('db_theme')->getByDomain($this->spArgs('domain'));
} elseif ($this->spArgs('uid') != '') {
$rs = spClass('db_theme')->getByUid($this->spArgs('uid'));
} else {
$rs = spClass('db_theme')->getByBid($this->spArgs('bid'));
}
if (!is_array($rs)) {
err404('您访问的用户不存在,用户可能已经更改了个性域名');
}
$skin = spClass('db_theme')->find(array('uid' => $rs['uid']));
$this->user_data = $rs;
$this->user_skin = $skin;
//将数据赋值给全局变量
}
开发者ID:as3long,项目名称:as3long,代码行数:17,代码来源:userblog.php
示例14: alert
private function alert()
{
$this->ajax_check_login();
$ptx_event_log = spClass('ptx_event_log');
$conditions['to_user_id'] = $this->current_user['user_id'];
$conditions['event_type'] = 'alert';
$conditions['is_read'] = '0';
$message_count = $ptx_event_log->findCount($conditions);
if ($message_count > 99) {
$message_html = "<em>N</em>";
} elseif ($message_count) {
$message_html = "<em>{$message_count}</em>";
} else {
$message_html = "";
}
$this->ajax_success_response(array('message_html' => $message_html), 'alert');
}
开发者ID:httvncoder,项目名称:151722441,代码行数:17,代码来源:ajaxmessage.php
示例15: __call
/**
* 魔术函数 通过函数名来调用不同的缓存驱动类
*/
public function __call($name, $args)
{
$driverClass = 'access_driver_' . $name;
if (!class_exists($driverClass)) {
spError('spAccess无法找到名为{$name}缓存驱动程序,请检查!');
}
extract(array_pop($args));
if ('w' == $method) {
// 写数据
$life_time = -1 == $life_time ? '300000000' : $life_time;
return spClass($driverClass)->set($name, serialize($value), $life_time);
} elseif ('c' == $method) {
// 清除数据
return spClass($driverClass)->del($name);
} else {
// 读数据
return unserialize(spClass($driverClass)->get($name));
}
}
开发者ID:wjgjb1109,项目名称:huicms,代码行数:22,代码来源:spAccessCache.php
示例16: step3
public function step3()
{
$config = spClass('Options');
if ($this->spArgs("db_host")) {
if ($config->load('config.php')) {
$db = array('host' => $this->spArgs("db_host"), 'port' => $this->spArgs("db_port"), 'login' => $this->spArgs("db_login"), 'password' => $this->spArgs("db_password"), 'database' => $this->spArgs("db_database"), 'prefix' => $this->spArgs("db_prefix"));
$admin = array('email' => $this->spArgs("admin_email"), 'nickname' => $this->spArgs("admin_nickname"), 'password' => $this->spArgs("admin_password"));
$config->set_item('db', $db);
$config->set_item('default_controller', 'welcome');
$config->save('config.php');
$do_install = $this->do_install($db, $admin);
if ($do_install['status'] != 200) {
$this->install_error = $do_install;
} else {
$this->jump(spUrl('install', 'step4'));
}
} else {
$this->install_error = array('status' => 500, 'msg' => 'config.php 文件不存在,请检查文件目录是否完整');
}
}
$this->display("install/step3.php");
}
开发者ID:httvncoder,项目名称:151722441,代码行数:22,代码来源:install.php
示例17: add
/** @brief 显示首页 */
function add()
{
if (empty($this->visitor['user'])) {
$this->display('login.html');
exit;
}
$username = $this->spArgs('user_name');
$password = $this->spArgs('password');
$realname = $this->spArgs('real_name');
$email = $this->spArgs('email');
$gender = $this->spArgs('gender');
$mobile = $this->spArgs('mobile');
if (empty($username) || empty($password) || empty($realname) || empty($email) || empty($gender) || empty($mobile)) {
$this->display('user/add.html');
} else {
$result = spClass('UserModel')->create(array('store_id' => $this->visitor['store']['store_id'], 'user_name' => $username, 'password' => $password, 'real_name' => $realname, 'mobile' => $mobile, 'gender' => $gender, 'email' => $email, 'pid' => 'N/A'));
if ($result) {
$this->show_message('USER_ADD_SUCCESS', 'GO_TO_INDEX', 'index.php');
} else {
show_error('USER_ADD_FAILURE', 'GO_TO_HISTORY');
}
}
}
开发者ID:eon-hong,项目名称:anypay,代码行数:24,代码来源:user.php
示例18: init
public function init($params)
{
if (is_array($params)) {
foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'cookie_secure', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) {
$this->{$key} = isset($params[$key]) ? $params[$key] : $this->{$key};
}
}
// Set the "now" time. Can either be GMT or server time, based on the
// config prefs. We use this to set the "last activity" time
$this->now = $this->_get_time();
$this->security = spClass('Security');
// Do we need encryption? If so, load the encryption class
if ($this->sess_encrypt_cookie == TRUE) {
$this->encrypt = spClass('Encrypt');
}
// Set the session length. If the session expiration is
// set to zero we'll set the expiration two years from now.
if ($this->sess_expiration == 0) {
$this->sess_expiration = 60 * 60 * 24 * 365 * 2;
}
// Set the cookie name
$this->sess_cookie_name = $this->cookie_prefix . $this->sess_cookie_name;
// Run the Session routine. If a session doesn't exist we'll
// create a new one. If it does, we'll update it.
if (!$this->sess_read()) {
$this->sess_create();
} else {
$this->sess_update();
}
// Delete 'old' flashdata (from last request)
$this->_flashdata_sweep();
// Mark all new flashdata as old (data will be deleted before next request)
$this->_flashdata_mark();
// Delete expired sessions if necessary
$this->_sess_gc();
}
开发者ID:httvncoder,项目名称:151722441,代码行数:36,代码来源:Session.php
示例19: setReWrite
/**
* 在控制器/动作执行前,对路由进行改装,使其可以解析URL_WRITE的地址
*/
public function setReWrite()
{
global $__controller, $__action;
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
$request = ltrim(strtolower(substr($_SERVER["REQUEST_URI"], strlen(dirname($GLOBALS['G_SP']['url']['url_path_base'])))), "\\/\\");
if ('?' == substr($request, 0, 1) or 'index.php?' == substr($request, 0, 10)) {
return;
}
if (empty($request) or 'index.php' == $request) {
$__controller = $GLOBALS['G_SP']['default_controller'];
$__action = $GLOBALS['G_SP']['default_action'];
return;
}
$this->params['suffix'] = '' == $this->params['suffix'] ? '?' : $this->params['suffix'];
$request = explode($this->params['suffix'], $request, 2);
$uri = array('first' => array_shift($request), 'last' => ltrim(implode($request), '?'));
$request = explode($this->params['sep'], $uri['first']);
$uri['first'] = array('pattern' => array_shift($request), 'args' => $request);
if (array_key_exists($uri['first']['pattern'], $this->params['map'])) {
@(list($__controller, $__action) = explode('@', $this->params['map'][$uri['first']['pattern']]));
if (!empty($this->params['args'][$uri['first']['pattern']])) {
foreach ($this->params['args'][$uri['first']['pattern']] as $v) {
spClass("spArgs")->set($v, array_shift($uri['first']['args']));
}
}
} elseif (isset($this->params['map']['@']) && !in_array($uri['first']['pattern'] . '.php', array_map('strtolower', scandir($GLOBALS['G_SP']['controller_path'])))) {
@(list($__controller, $__action) = explode('@', $this->params['map']['@']));
if (!empty($this->params['args']['@'])) {
$uri['first']['args'] = array_merge(array($uri['first']['pattern']), $uri['first']['args']);
foreach ($this->params['args']['@'] as $v) {
spClass("spArgs")->set($v, array_shift($uri['first']['args']));
}
}
} else {
$__controller = $uri['first']['pattern'];
$__action = array_shift($uri['first']['args']);
}
if (!empty($uri['first']['args'])) {
for ($u = 0; $u < count($uri['first']['args']); $u++) {
spClass("spArgs")->set($uri['first']['args'][$u], isset($uri['first']['args'][$u + 1]) ? $uri['first']['args'][$u + 1] : "");
$u += 1;
}
}
if (!empty($uri['last'])) {
$uri['last'] = explode('&', $uri['last']);
foreach ($uri['last'] as $val) {
@(list($k, $v) = explode('=', $val));
if (!empty($k)) {
spClass("spArgs")->set($k, isset($v) ? $v : "");
}
}
}
}
开发者ID:BGCX261,项目名称:zhima-svn-to-git,代码行数:58,代码来源:spUrlRewrite.php
示例20: checkNewbieTask
private function checkNewbieTask($user_id, $event)
{
if (in_array($event, array('first_post_share', 'first_add_follow', 'first_create_album', 'create_avatar', 'first_like_topic'))) {
$condition['event_type'] = 'reward';
$condition['event_code'] = $event;
$condition['to_user_id'] = $user_id;
if (spClass('ptx_event_log')->find_one($condition)) {
return true;
}
}
return false;
}
开发者ID:httvncoder,项目名称:151722441,代码行数:12,代码来源:event_dispatcher.php
注:本文中的spClass函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论