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

PHP get_current_admin_id函数代码示例

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

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



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

示例1: add_post

 function add_post()
 {
     $this->_getTree();
     if (IS_POST) {
         if (!empty($_POST['photos_alt']) && !empty($_POST['photos_url'])) {
             foreach ($_POST['photos_url'] as $key => $url) {
                 $photourl = sp_asset_relative_url($url);
                 $_POST['smeta']['photo'][] = array("url" => $photourl, "alt" => $_POST['photos_alt'][$key]);
             }
         }
         $_POST['smeta']['thumb'] = sp_asset_relative_url($_POST['smeta']['thumb']);
         $_POST['post']['post_date'] = date("Y-m-d H:i:s", time());
         $_POST['post']['smeta'] = json_encode($_POST['smeta']);
         $_POST['post']['post_author'] = get_current_admin_id();
         $result = $this->posts_obj->add($_POST['post']);
         if ($result) {
             //
             $_POST['term']['object_id'] = $result;
             $result = $this->terms_relationship->add($_POST['term']);
             if ($result) {
                 $this->success("添加成功!");
             } else {
                 $this->error("归类失败!");
             }
         } else {
             $this->error("添加失败!");
         }
     }
 }
开发者ID:Nightchen0521,项目名称:cmf,代码行数:29,代码来源:PostAction.class.php


示例2: add_post

 function add_post()
 {
     if (IS_POST) {
         if (empty($_POST['term'])) {
             $this->error("请至少选择一个分类栏目!");
         }
         if (!empty($_POST['photos_alt']) && !empty($_POST['photos_url'])) {
             foreach ($_POST['photos_url'] as $key => $url) {
                 $photourl = sp_asset_relative_url($url);
                 $_POST['smeta']['photo'][] = array("url" => $photourl, "alt" => $_POST['photos_alt'][$key]);
             }
         }
         $_POST['smeta']['thumb'] = sp_asset_relative_url($_POST['smeta']['thumb']);
         $_POST['post']['post_date'] = date("Y-m-d H:i:s", time());
         $_POST['post']['post_author'] = get_current_admin_id();
         $article = I("post.post");
         $article['smeta'] = json_encode($_POST['smeta']);
         $article['post_content'] = htmlspecialchars_decode($article['post_content']);
         $result = $this->posts_model->add($article);
         if ($result) {
             //
             foreach ($_POST['term'] as $mterm_id) {
                 $this->term_relationships_model->add(array("term_id" => intval($mterm_id), "object_id" => $result));
             }
             $this->success("添加成功!");
         } else {
             $this->error("添加失败!");
         }
     }
 }
开发者ID:feng8605765,项目名称:xmmusic,代码行数:30,代码来源:AdminPostController.class.php


示例3: password_post

 function password_post()
 {
     if (IS_POST) {
         if (empty($_POST['old_password'])) {
             $this->error("原始密码不能为空!");
         }
         if (empty($_POST['password'])) {
             $this->error("新密码不能为空!");
         }
         $user_obj = D("Common/Users");
         $uid = get_current_admin_id();
         $admin = $user_obj->where(array("id" => $uid))->find();
         $old_password = $_POST['old_password'];
         $password = $_POST['password'];
         if (sp_password($old_password) == $admin['user_pass']) {
             if ($_POST['password'] == $_POST['repassword']) {
                 if ($admin['user_pass'] == sp_password($password)) {
                     $this->error("新密码不能和原始密码相同!");
                 } else {
                     $data['user_pass'] = sp_password($password);
                     $data['id'] = $uid;
                     $r = $user_obj->save($data);
                     if ($r !== false) {
                         $this->success("修改成功!");
                     } else {
                         $this->error("修改失败!");
                     }
                 }
             } else {
                 $this->error("密码输入不一致!");
             }
         } else {
             $this->error("原始密码不正确!");
         }
     }
 }
开发者ID:kmlzh1983,项目名称:diamond,代码行数:36,代码来源:SettingController.class.php


示例4: userinfo_post

 function userinfo_post()
 {
     if (IS_POST) {
         $_POST['id'] = get_current_admin_id();
         $create_result = $this->users_obj->field("user_login,user_email,last_login_ip,last_login_time,create_time,user_activation_key,user_status,role_id,score,user_type", true)->create();
         if ($create_result) {
             if ($this->users_obj->save() !== false) {
                 $this->success("保存成功!");
             } else {
                 $this->error("保存失败!");
             }
         } else {
             $this->error($this->users_obj->getError());
         }
     }
 }
开发者ID:bxq2013,项目名称:thinkcmf_wechat,代码行数:16,代码来源:UserController.class.php


示例5: sp_get_current_admin_id

function sp_get_current_admin_id()
{
    return get_current_admin_id();
}
开发者ID:noikiy,项目名称:luokeke2,代码行数:4,代码来源:function.php


示例6: add_post

 function add_post()
 {
     if (IS_POST) {
         $_POST['smeta']['thumb'] = sp_asset_relative_url($_POST['smeta']['thumb']);
         $_POST['post']['post_date'] = date("Y-m-d H:i:s", time());
         $_POST['post']['post_author'] = get_current_admin_id();
         $page = I("post.post");
         $page['smeta'] = json_encode($_POST['smeta']);
         $page['post_content'] = htmlspecialchars_decode($page['post_content']);
         $result = $this->posts_model->add($page);
         if ($result) {
             $this->success("添加成功!");
         } else {
             $this->error("添加失败!");
         }
     }
 }
开发者ID:noikiy,项目名称:cmfx,代码行数:17,代码来源:AdminPageController.class.php


示例7: userinfo

 function userinfo()
 {
     $id = get_current_admin_id();
     $user = $this->users_obj->where(array("id" => $id))->find();
     $this->assign($user);
     $this->display();
 }
开发者ID:2flying2,项目名称:IDF-CTF-PLAT,代码行数:7,代码来源:UserAction.class.php


示例8: add_post

 function add_post()
 {
     if (IS_POST) {
         $_POST['smeta']['thumb'] = sp_asset_relative_url($_POST['smeta']['thumb']);
         $_POST['post']['post_date'] = date("Y-m-d H:i:s", time());
         $_POST['post']['smeta'] = json_encode($_POST['smeta']);
         $_POST['post']['post_author'] = get_current_admin_id();
         $result = $this->posts_obj->add($_POST['post']);
         if ($result) {
             $this->success("添加成功!");
         } else {
             $this->error("添加失败!");
         }
     }
 }
开发者ID:Nightchen0521,项目名称:cmf,代码行数:15,代码来源:PageAction.class.php


示例9: userinfo

 function userinfo()
 {
     $id = get_current_admin_id();
     $user = $this->users_obj->where("ID='{$id}'")->find();
     $this->assign($user);
     $this->display();
 }
开发者ID:Nightchen0521,项目名称:cmf,代码行数:7,代码来源:UserAction.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_current_blog_id函数代码示例发布时间:2022-05-15
下一篇:
PHP get_current函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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