本文整理汇总了PHP中sys::needLog方法的典型用法代码示例。如果您正苦于以下问题:PHP sys::needLog方法的具体用法?PHP sys::needLog怎么用?PHP sys::needLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sys
的用法示例。
在下文中一共展示了sys::needLog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInfo
<?php
/*
* changeInfo.php
* 处理用户信息修改的逻辑
* Created By C860 at 2014-1-20
*/
//动态加载相关文件
if (file_exists('conf/config.php')) {
$predir = '';
} else {
$predir = '../';
}
include_once $predir . 'conf/config.php';
//需要用户登录
sys::needLog($predir . 'login.php');
//引入相关模型类
include_once $predir . 'Models/user_info.php';
/*
* getInfo方法
* 获取当前用户信息
* @author C860
* @return array|false
*/
function getInfo()
{
$info = user_info::getUserInfo($_SESSION['userId']);
if ($info != false) {
return $info;
} else {
return false;
示例2: date
<?php
/*
* newArticle.php
* 负责处理新发表文章的逻辑
* Createed By C860 at 2014-1-19
*/
if (!class_exists('sys')) {
include_once '../conf/config.php';
}
//需要登录
sys::needLog('../login.php');
//检测数据合法性
if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['content']) && !empty($_POST['content']) && isset($_POST['tags']) && !empty($_POST['tags'])) {
//引入相关模型类
include_once '../Models/article.php';
include_once '../Models/tag_relate_article.php';
include_once '../Models/user_info.php';
$currentTime = date('Y-m-d H:i:s');
//新增文章
if (article::add($_POST['title'], $_POST['content'], $currentTime, $_SESSION['userId'])) {
$ID = article::getId($_POST['title'], $_SESSION['userId'], $currentTime);
$tags = explode('|', $_POST['tags']);
foreach ($tags as $tag) {
tag_relate_article::add($tag, $ID);
}
user_info::increaseArticleCount($_SESSION['userId']);
sys::alert('发表成功!');
sys::redirect('../index.php');
}
} else {
示例3: chkform
<?php
include_once 'conf/config.php';
include_once 'Controllers/newArticle.php';
sys::needLog('login.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="public/stylesheets/global.css"/>
<link rel="stylesheet" type="text/css" href="public/stylesheets/issue.css"/>
<script type="text/javascript" src="public/javascripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="public/javascripts/navSlide.js"></script>
<script type="text/javascript" src="public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="public/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="public/javascripts/key-value.js"></script>
</head>
<body>
<?php
include_once 'menu.php';
?>
<div id="mainBox">
<div id="container">
<form id="newAFrom" onsubmit="return chkform()" class="editor-content" action="Controllers/newArticle.php" method="post">
<div class="editor-header">
<span class="line"></span>
<h2 class="editor-title"> 发表文章</h2>
<input class="issue-title" type="text" name="title" id="title">