本文整理汇总了PHP中InitSmarty函数的典型用法代码示例。如果您正苦于以下问题:PHP InitSmarty函数的具体用法?PHP InitSmarty怎么用?PHP InitSmarty使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitSmarty函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ToValidate
function ToValidate($email)
{
global $show, $url;
$smarty = InitSmarty();
$smarty->assign('email', $email);
$smarty->assign('show', $show);
$smarty->assign('url', $url);
$smarty->display('validate.html');
exit;
}
示例2: include
/*
if(empty($captcha)) ShowError('请输入验证码',$url['login']);
//判断验证码
include(ROOT_PATH.'/source/class/Captcha.class.php');
if(!Captcha::Check($captcha)) ShowError('验证码输入错误',$url['login']);
*/
$auto = Val('auto', 'POST', 1);
if ($user->userId <= 0) {
if ($user->Login($username, $userpwd, $auto)) {
ShowSuccess('登录成功');
} else {
ShowError('登录失败,请检查用户/邮箱或密码', $url['login']);
}
}
break;
case 'logout':
if ($user->Logout()) {
ShowSuccess('成功退出');
}
break;
default:
if ($user->userId > 0) {
ShowError('已经登录');
}
$smarty = InitSmarty();
$smarty->assign('do', $do);
$smarty->assign('show', $show);
$smarty->assign('url', $url);
$smarty->display('login.html');
break;
}
示例3: die
die('Access Denied');
}
$db = DBConnect();
$tbUser = $db->tbPrefix . 'user';
$tbSession = $db->tbPrefix . 'session';
$tbContent = $db->tbPrefix . 'content';
$tbComment = $db->tbPrefix . 'comment';
//社区概况
$situation = array();
$situation['userCount'] = $db->FirstValue("SELECT COUNT(*) FROM {$tbUser}");
//注册用户总数
$tbSession = $db->tbPrefix . 'session';
$situation['onlineCount'] = $db->FirstValue("SELECT COUNT(DISTINCT userId) FROM {$tbSession} WHERE updateTime>" . (time() - EXPIRES));
//在线用户总数
$situation['onlineUsers'] = $db->Dataset("SELECT DISTINCT u.id,u.userName FROM {$tbSession} s INNER JOIN {$tbUser} u ON u.id=s.userId WHERE updateTime>" . (time() - EXPIRES));
//在线用户
//系统环境
$sysInfo = array();
$sysInfo['sys_version'] = 'IT121 1.0';
$sysInfo['serverOS'] = PHP_OS;
$sysInfo['serverSoftware'] = $_SERVER['SERVER_SOFTWARE'];
$sysInfo['phpVersion'] = 'PHP v' . PHP_VERSION;
$sysInfo['mysqlVersion'] = 'MySQL ' . $db->FirstValue('SELECT VERSION()');
include ROOT_PATH . '/source/common.php';
$smarty = InitSmarty(1);
$smarty->assign('situation', $situation);
$smarty->assign('sysInfo', $sysInfo);
$smarty->assign('do', $do);
$smarty->assign('show', $show);
$smarty->assign('url', $url);
$smarty->display('admin_index.html');
示例4: Notice
function Notice($str = '', $turnto = URL_ROOT, $time = 3, $style = 'success', $urltitle)
{
global $show, $url;
$notice = array('str' => $str, 'turnto' => $turnto, 'time' => $time, 'style' => $style, 'urltitle' => $urltitle);
$smarty = InitSmarty();
$smarty->assign('show', $show);
$smarty->assign('url', $url);
$smarty->assign('notice', $notice);
$smarty->display('notice.html');
exit;
}