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


PHP ykfile函数代码示例

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


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

示例1: upload_img

function upload_img($file_upload_name)
{
    $imgName = $_FILES["{$file_upload_name}"]['name'];
    //上传文件的名称
    $imgType = $_FILES["{$file_upload_name}"]['type'];
    //上传文件的类型
    $imgSize = $_FILES["{$file_upload_name}"]['size'];
    //上传文件的大小
    $imgTmp_name = $_FILES["{$file_upload_name}"]['tmp_name'];
    //上传文件在服务器上的临时文件名称
    //随机生成一个图片名称
    $imgDbName = md5(getUuid());
    //截取文件的后缀
    $ext = explode(".", $imgName);
    $ext = $ext[count($ext) - 1];
    $savePath = "pages/upload/" . $imgDbName . "." . $ext;
    if (file_exists($savePath)) {
        //  如果存在这个路径
        echo $savePath . "already exists<br />\n";
    } else {
        // 不存在路径的时候
        move_uploaded_file($imgTmp_name, ykfile($savePath));
        return $savePath;
    }
}
开发者ID:samuel072,项目名称:PHP,代码行数:25,代码来源:talker.php

示例2: getAccessToken

 private function getAccessToken()
 {
     // access_token 应该全局存储与更新,以下代码以写入到文件中做示例
     $data = json_decode(file_get_contents(ykfile("wxapi/access_token.json")));
     if ($data->expire_time < time()) {
         // 如果是企业号用以下URL获取access_token
         //$url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$this->appId&corpsecret=$this->appSecret";
         //      $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$this->appId&secret=$this->appSecret";
         //      $res = $this->httpGet($url);
         $res = "http://10.172.222.187/service/get_token.php?appid={$this->appId}&secret={$this->appSecret}";
         $access_token = $res->access_token;
         if ($access_token) {
             $data->expire_time = time() + 7000;
             $data->access_token = $access_token;
             $fp = fopen("access_token.json", "w");
             fwrite($fp, json_encode($data));
             fclose($fp);
         }
     } else {
         $access_token = $data->access_token;
     }
     return $access_token;
 }
开发者ID:samuel072,项目名称:PHP,代码行数:23,代码来源:jssdk.php

示例3: session_start

<?php

session_start();
// 开启session
require_once "config.php";
require_once ykfile("source/talker_service.php");
$page_title = "点他来讲";
$talker = new TalkerService();
$talkers = $talker->get_all(0, 10);
include ykfile("pages/talkers/talkersList.php");
开发者ID:samuel072,项目名称:PHP,代码行数:10,代码来源:talkers.php

示例4: ykfile

<?php

/**
*  @author:  han
*  登陆
*/
require_once ykfile("source/score_service.php");
require_once ykfile("source/modules/score_module.php");
//获取所有的参数值
$json_params = json_decode(file_get_contents("php://input"));
$mobile = $json_params->mobile;
$password = $json_params->password;
// 根据手机号码和密码查询数据
$userService = new UserService(@$user_id);
$user_info = $userService->get_by_mobile_pass($mobile, $password);
if ($user_info != NULL) {
    $scoSer = new ScoreService();
    $rule_list = $scoSer->apply_rule($user_info, GET_SCORE, ScoreModule::point_signin);
    $message = "";
    foreach ($rule_list as $rule) {
        $msg = $rule->title . " + " . $rule->amount;
        $message[] = $msg;
    }
    $user_info = $userService->get_by_uuid($user_info->uuid);
    unset($_SESSION['current_user']);
    // 成功登陆 干掉session中关于前一个用户信息
    $_SESSION['current_user'] = serialize($user_info);
    // 装载新的用户信息
    $json_array = array("status" => "0", "message" => $message, "profile" => $user_info);
    echo json_encode($json_array);
} else {
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:user_signin.php

示例5: ykfile

<?php

require_once ykfile("source/user_service.php");
require_once ykfile("source/score_service.php");
require_once ykfile("source/model/user_model.php");
require_once ykfile("source/qq_reader_service.php");
$json_params = json_decode(file_get_contents("php://input"));
$openid = $json_params->openid;
$nickname = $json_params->nickname;
$gender = $json_params->gender;
$avatar = $json_params->avatar;
file_put_contents("/tmp/yike.log", "avatar===>" . $avatar . "\n", FILE_APPEND);
$user_model = new UserModel();
$user_model->name = $nickname;
$user_model->sex = $gender;
$user_model->avatar = $avatar;
$userSer = new UserService(@$uuid);
$type = UserModel::QQ_LOGIN_USER;
$user_info = $userSer->save_user_part($user_model, $openid, $type);
if ($user_info) {
    $qq_reader_ser = new QQReaderService();
    $qq_reader_info = $qq_reader_ser->check_open_id($openid);
    $scoSer = new ScoreService();
    if ($qq_reader_info) {
        // 登陆
        $status = ScoreModule::point_signin;
    } else {
        // 注册
        $status = ScoreModule::point_signup;
    }
    $rule_list = $scoSer->apply_rule($user_info, GET_SCORE, $status);
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:user_qqlogin.php

示例6: ykfile

<?php

//  审核发布信息  0:  审核   1:驳回     2:发布
require_once ykfile("source/activity_service.php");
$state = $_GET['state'];
$act_id = $_GET['act_id'];
$reject_message = $_GET['reject'];
$actSer = new ActivityService();
$result = $actSer->set_act_state($act_id, $state, $reject_message);
$status = 0;
$message = "";
if ($result) {
    $statue = 0;
    $message = "success";
} else {
    $status = 1;
    $message = "fail";
}
echo json_encode(array("status" => $status, "message" => $message));
开发者ID:samuel072,项目名称:PHP,代码行数:19,代码来源:user_set_act_state.php

示例7: ykfile

<?php

include_once ykfile("source/modules/tag_module.php");
class TagService
{
    /**
     * 根据channel_id查询对一个的标签对象
     * return tag列表
     */
    public function get_defualt($channel_id)
    {
        $tagModule = new TagModule();
        return $tagModule->get_defualt($channel_id);
    }
    /**
     * 查询所有的标签对象
     * return 返回tag标签对象集合
     */
    public function get_all()
    {
        $tagModule = new TagModule();
        return $tagModule->get_all();
    }
}
开发者ID:samuel072,项目名称:PHP,代码行数:24,代码来源:tag_service.php

示例8: ykfile

</li>
	  <li class="percent30 header"><?php 
    echo $adv->link;
    ?>
</li>
	  <li class="percent20 header">
		<a href="/m/admin.php?mod=edit_adv&adv_id=<?php 
    echo $adv->id;
    ?>
" target="mainFrame">编辑</a>
      </li>
    </ul>
    <?php 
}
?>
  </div>
	
  <div class="buttons">
    <a href="/m/admin.php?mod=edit_adv" target="mainFrame">添加广告</a>
  </div>

  <!-- 分页 -->
  <?php 
include ykfile('pages/admin/pager.php');
?>

  <script type="text/javascript" src="/m/pages/js/jquery-1.11.1.min.js"></script>

</body>
</html>
开发者ID:samuel072,项目名称:PHP,代码行数:30,代码来源:adv_list.php

示例9: ykfile

<?php

require_once ykfile('source/activity_service.php');
if (!empty($_SESSION['current_user'])) {
    $user_id = $_SESSION['currnet_user']->uuid;
    $actsrv = new ActivityService();
    $act_list = $actsrv->get_by_user($user_id, 0, 10);
    $page_title = '我的发布';
    require_once ykfile("pages/user/sub_record.php");
} else {
    $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    echo "<script type='text/javascript'>alert('请您先登陆!');window.location.href='/m/user.php?mod=signin&url={$url}'</script>";
}
开发者ID:samuel072,项目名称:PHP,代码行数:13,代码来源:sub_record.php

示例10: ykfile

<?php

require_once ykfile('source/dbtables/hotword_table.php');
require_once ykfile('source/modules/activity_module.php');
class SearchService
{
    public function get_act_by_ids($ids)
    {
        $act_mod = new ActivityModule();
        $act_ids = "";
        foreach ($ids as $id) {
            $act_ids .= $id . ",";
        }
        $act_ids = substr($act_ids, 0, strlen($act_ids) - 1);
        return $act_mod->get_act_by_ids($act_ids);
    }
}
开发者ID:samuel072,项目名称:PHP,代码行数:17,代码来源:search_service.php

示例11: ykfile

<?php

require_once ykfile("source/dbtables/talker_table.php");
/**
 * 业务逻辑层  处理页面逻辑的
 */
class TalkerService
{
    /**
     *	查询全部的演讲
     *	默认大小是10
     */
    public function get_all($next_id, $pagesize)
    {
        $tk_table = new TalkerTable();
        return $tk_table->get_all($next_id, $pagesize);
    }
    /**
     * 获取总的数据量
     */
    function get_talk_count()
    {
        $tk_table = new TalkerTable();
        return $tk_table->get_count();
    }
    /**
     * 点TA来讲 增加一个点击数
     *
     */
    public function click_talker($uuid)
    {
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:talker_service.php

示例12: ykfile

<?php

require_once ykfile("wxapi/jssdk.php");
$jssdk = new JSSDK("wx1bd28c923d97ffdb", "d56aa861e47c0b2cd1787c77ad934ec6");
$signPackage = $jssdk->GetSignPackage();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<title><?php 
echo $video->title;
?>
</title>
<link href="/m/pages/css/style_comm.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="/m/pages/css/style_540.css" />
<link href="/m/pages/css/idangerous.swiper.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="/m/pages/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/m/pages/js/idangerous.swiper.min.js"></script>
<script src="/m/pages/js/jq_aux.js" type="text/javascript"></script>

</head>
<body>
<header>
    <div class="head">
        <h4>一刻直播</h4>
        <div class="layer_return"><a href="javascript:history.go(-1);"></a></div>
      <!--  <div class="layer_out"><a href="javascript:void(0);" id="share"></a></div> -->
    </div>
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:detail.php

示例13: ykfile

<?php

/*后台商品信息管理*/
require_once ykfile("source/commodity_service.php");
$next_id = intval($_GET['next_id']);
$count = intval($_GET['count']);
if ($count <= 0) {
    $count = 10;
}
$comm_ser = new CommodityService();
$comm_list = $comm_ser->get_commodity($next_id, $count);
$comm_total = $comm_ser->get_count();
// 以下4个参数,必须计算出来,分页器要使用
// page_cur: 当前页, 从1开始计算
// page_count: 总页数
// page_prefix: 点页数后,取数据的url前缀
// next_id: 下一页超始数据
$page_cur = intval(($next_id + 1 + 9) / 10);
$page_count = intval(($comm_total + 9) / 10);
$page_prefix = "/m/admin.php?mod=commodity";
$next_id += $count;
require_once ykfile("pages/admin/commodity_list.php");
开发者ID:samuel072,项目名称:PHP,代码行数:22,代码来源:admin_commodity.php

示例14: ykfile

<?php

require_once ykfile("source/modules/activity_module.php");
class MoocService
{
    /**
     * 查询全部公开课
     */
    public function get_all($next_id, $pagesize, $stage)
    {
        $mooc_ac = new ActivityModule();
        if (empty($next_id) || empty($pagesize)) {
            $next_id = 0;
            $pagesize = 10;
        }
        $mooc_list = $mooc_ac->get_all_by_type(@$tag_id, $next_id, $pagesize, 2, $stage);
        if ($mooc_list != 1000) {
            $activity_array = array();
            foreach ($mooc_list as $mooc) {
                $section_list = $mooc_ac->get_sec_by_actId($mooc->id);
                if ($section_list != 1000 && !empty($section_list)) {
                    foreach ($section_list as $section) {
                        array_push($mooc->content, $section);
                    }
                }
                array_push($activity_array, $mooc);
            }
            return $activity_array;
        } else {
            return 1000;
        }
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:mooc_service.php

示例15: ykfile

<?php

require_once ykfile("source/dbtables/db.php");
require_once ykfile("source/model/appointment_model.php");
class AppointmentTable extends DB
{
    public function table_name()
    {
        return 'appointment';
    }
    // 数据库对像,转成模型对象
    public function dbobj_to_model($obj)
    {
        $appoint = new AppointmentModel();
        $appoint->id = $obj->id;
        $appoint->user->uuid = $obj->user_id;
        $appoint->name = $obj->name;
        $appoint->mobile = $obj->mobile;
        $appint->com_address = $obj->com_address;
        $appoint->activity->id = $obj->activity_id;
        $appoint->state = $obj->state;
        $appoint->message = $obj->message;
        $appoint->appoint_time = $obj->appoint_time;
        return $appoint;
    }
    // 取指定用户的预约信息
    public function get_by_user($user_id, $state, $next_id = 0, $count = 10)
    {
        $sql = "select * from appointment where user_id = '{$user_id}' and state = {$state} limit {$next_id}, {$count}";
        $list = $this->get_list_by_sql($sql);
        return $list;
开发者ID:samuel072,项目名称:PHP,代码行数:31,代码来源:appointment_table.php


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