本文整理汇总了PHP中get_smarty函数的典型用法代码示例。如果您正苦于以下问题:PHP get_smarty函数的具体用法?PHP get_smarty怎么用?PHP get_smarty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_smarty函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_detail_html
function get_detail_html($record) {
$sm = get_smarty();
$sm->assign("r", $record);
return $sm->fetch("pages/detail.html");
}
开发者ID:hopkinsju,项目名称:MobileCat,代码行数:7,代码来源:record.php
示例2: index
public function index()
{
$smarty = get_smarty();
$this->_header($smarty);
$username = User::getLoginUsername();
$smarty->assign('username', $username);
//我的朋友
$my_friend_url = url("myweb", "friend::myfriend");
$smarty->assign("my_friend_url", $my_friend_url);
//登录链接
$login_url = url("myweb", "login::index");
$smarty->assign("login_url", $login_url);
//信息提醒
$msg_url = url("myweb", "friend::msg");
$smarty->assign("msg_url", $msg_url);
$uid = User::getLoginUid();
if ($uid == '1' || $uid == '2') {
$is_love = 'yes';
$love_url = url("myweb", "home::index", 1);
} elseif ($uid == '3' || $uid == '4') {
$is_love = 'yes';
$love_url = url("myweb", "home::index", 2);
} else {
$is_love = 'no';
$love_url = url("myweb", "home::index");
}
$smarty->assign("is_love", $is_love);
$smarty->assign("love_url", $love_url);
$smarty->display('myweb/usercenter/index.html');
}
开发者ID:lughong,项目名称:test,代码行数:30,代码来源:usercenter.php
示例3: photolist
public function photolist($act)
{
$smarty = get_smarty();
$this->_header($smarty);
$dir_id = explode('_', $act);
if (!isset($dir_id[1])) {
$dir_id[1] = null;
}
$uid = User::getLoginUid();
//获取列表
$list = UploadFile::getList($dir_id[1], $uid);
$smarty->assign("user_photo_list", $list);
//返回
$return_url = url("myweb", "photo::index");
$smarty->assign("return_url", $return_url);
//更换封面
$change_title_photo_url = url("myweb", "photo::covers", $dir_id[1]);
$smarty->assign("change_title_photo_url", $change_title_photo_url);
//pc上传
$upload_url = url("myweb", "photo::upload", $dir_id[1]);
$smarty->assign("upload_url", $upload_url);
//手机端上传文件链接
$upload_mobile_url = url("myweb", "photo::mobileupload", $dir_id[1], $uid);
$smarty->assign("upload_mobile_url", $upload_mobile_url);
//删除文件链接
$select_del_url = url("myweb", "photo::ajaxdel", $dir_id[1]);
$smarty->assign("select_del_url", $select_del_url);
$smarty->display("myweb/usercenter/upload.html");
}
开发者ID:lughong,项目名称:test,代码行数:29,代码来源:photo.php
示例4: checkcode
/**
* 根据用户点击找回密码的url来寻找是哪一个email
* 并且检查是否过期,是否被使用过了
*/
public function checkcode($code)
{
$rs = self::_checkCode($code);
$smarty = get_smarty();
$url = url("myweb", "fpw::npw");
$smarty->assign('code', $code);
$smarty->assign('url', $url);
$smarty->display('myweb/findpassword/password_update.html');
}
开发者ID:lughong,项目名称:test,代码行数:13,代码来源:fpw.php
示例5: index
public function index()
{
$smarty = get_smarty();
$this->_show($smarty);
//列表
$goodslist_url = url('goods', 'goods::index');
$smarty->assign('goodslist_url', $goodslist_url);
$smarty->display('goods/index.html');
}
开发者ID:lughong,项目名称:shop,代码行数:9,代码来源:home.php
示例6: get_detail_text
function get_detail_text($record, $is_text) {
$sm = get_smarty();
$sm->assign("is_text", $is_text);
$sm->assign("r", $record);
return $sm->fetch("email/send_message.txt");
}
开发者ID:hopkinsju,项目名称:MobileCat,代码行数:9,代码来源:send_email.php
示例7: get_one_result_html
function get_one_result_html($record) {
$p = new SiteParse();
$sm = get_smarty();
$record["info_keys"] = $p->detail_keys;
if ($saved = ar_get('saved', $_SESSION)) {
$record["is_saved"] = array_key_exists($bibid, $saved);
}
$sm->assign("r", $record);
$html = $sm->fetch("pages/detail_all.html");
return $html;
}
开发者ID:hopkinsju,项目名称:MobileCat,代码行数:14,代码来源:browse.php
示例8: index
public function index()
{
$smarty = get_smarty();
//注册账号链接
$reg_action_url = url("myweb", "reg::reging");
$smarty->assign("reg_action_url", $reg_action_url);
//验证码图片链接
$captcha_url = HOMEURL . "plugins/captcha/captcha.php?a=";
$smarty->assign("captcha_url", $captcha_url);
//已有账号,去登录链接
$login_url = url("myweb", "login::index");
$smarty->assign("login_url", $login_url);
$smarty->display("myweb/register/register.html");
}
开发者ID:lughong,项目名称:test,代码行数:14,代码来源:reg.php
示例9: get_smarty_header
function get_smarty_header($data, $auth, $perm ) {
$smarty = get_smarty();
$smarty->assign("uname",$auth->auth[uname]);
global $company_logo_image;
$smarty->assign("company_logo_image", $company_logo_image);
if ($perm->have_perm('SUPER') ) {
$smarty->assign("admin_reseller",1);
$smarty->assign("admin_clients",1);
}
if ($perm->have_perm('SUPER') || $perm->have_perm('RESELLER') ) {
## they are allowed to view more than one domain
// change_domain();
$smarty->assign("admin_domain",1);
$opts = $data->get_domain_options(null,null);
$udomain_values = $opts[0];
$udomain_output = $opts[1];
$smarty->assign("udomain_values", $udomain_values);
$smarty->assign("udomain_output", $udomain_output);
global $adomain;
if ($adomain) {
$smarty->assign("udomain_selected", $adomain);
} else {
$smarty->assign("udomain_selected", $auth->auth[udomain]);
}
} else {
$smarty->assign("admin_domain",0);
$smarty->assign("udomain",$auth->auth[udomain]);
}
if ($perm->have_perm('ADMIN') ) {
$smarty->assign("admin_subscribers",1);
$smarty->assign("admin_voicemail",1);
}
return $smarty ;
}
开发者ID:BackupTheBerlios,项目名称:sipums,代码行数:43,代码来源:nav.php
示例10: index
public function index()
{
$smarty = get_smarty();
//找回密码链接
$findpassword_url = url("myweb", "fpw::index");
$smarty->assign("findpassword_url", $findpassword_url);
//注册链接
$reg_url = url("myweb", "reg::index", "ready");
$smarty->assign("reg_url", $reg_url);
//微博登陆链接
$weibo_login_url = WeiBoLogin::getWeiboLoginUrl();
$smarty->assign("weibo_login_url", $weibo_login_url);
//QQ登陆链接
$qq_login_url = url("myweb", "qq::login");
$smarty->assign("qq_login_url", $qq_login_url);
//检查登录账号链接
$login_action_url = url("myweb", "login::logining");
$smarty->assign("login_action_url", $login_action_url);
$smarty->display("myweb/login/login.html");
}
开发者ID:lughong,项目名称:test,代码行数:20,代码来源:login.php
示例11: zfb_order_done
public function zfb_order_done($order_id)
{
//检查orderid是不是本人的
Assert::num_gt_zero($order_id);
$uid = User::get_login_id();
if (!$uid) {
$url = URL . 'login';
header("Location:{$url}");
throw new Exception("exit");
} else {
$result = OrderInfo::get_order_info($order_id);
if (!$result) {
header("location:" . URL);
}
$smarty = get_smarty();
//再去逛逛
$smarty->assign('homeurl', URL);
//订单详情
$smarty->assign('order_detail_url', URL . 'weixin/usercenter/order_detail/' . $order_id);
$smarty->display('web/home/order_success.html');
}
}
开发者ID:lughong,项目名称:test,代码行数:22,代码来源:alipay.php
示例12: index
public function index($love = 0)
{
$smarty = get_smarty();
$this->_header($smarty);
//用户名
$username = User::getLoginUsername();
$smarty->assign('username', $username);
//是否登录
if (User::getLoginUid()) {
$smarty->assign("is_login", "yes");
} else {
$smarty->assign("is_login", "no");
}
if ($love == 1) {
//h
$smarty->display("myweb/love/index.html");
} elseif ($love == 2) {
//w
$smarty->display("myweb/love/love.html");
} else {
//index
$smarty->display("myweb/home/index.html");
}
}
开发者ID:lughong,项目名称:test,代码行数:24,代码来源:home.php
示例13: get_init_time
$begin_time = get_init_time('begin');
$log->log("begin time = $begin_time ");
}
if ($_POST[end_time] ){
$end_time = $_POST[end_time];
} else {
// default value
$end_time = get_init_time('end');
$log->log("end time = $end_time ");
}
$footer_smarty = get_smarty();
$header_smarty->assign('include_js_datepicker',1);
$header_smarty->assign('conference_bg_flag',1);
$header_smarty->display('app_header.tpl');
$smarty->assign('conference_name',$conference_name);
$smarty->assign('conference_date',$conference_date);
$smarty->assign( 'msgs', $msgs );
$smarty->assign('owner',$spUser->username);
$smarty->assign('owner_name',$spUser->dbFields[first_name] . " " . $spUser->dbFields[last_name]);
$smarty->assign('times',$times );
$smarty->assign('begin_time',$begin_time );
$smarty->assign('end_time',$end_time );
$smarty->display('new_conference.tpl');
$footer_smarty->display('app_footer.tpl');
开发者ID:BackupTheBerlios,项目名称:sipums,代码行数:28,代码来源:new_conference.php
示例14: action_chat
function action_chat()
{
$user_id = $_SESSION['user_id'];
$smarty = get_smarty();
$ecs = get_ecs();
$db = get_database();
/**
* 判断当前用户是为聊天系统的注册用户
*/
$exist = check_of_username_exist($user_id);
// 获取用户头像
if (!empty($user_id)) {
$sql = "select password, headimg from " . $ecs->table('users') . " where user_id = '{$user_id}'";
$row = $db->getRow($sql);
$headimg = $row['headimg'];
$password = $row['password'];
$smarty->assign('headimg', $headimg);
}
if (!$exist) {
// 查询ECShop内用户信息
$sql = 'select a.user_id, a.password, a.email, a.user_name from ' . $ecs->table('users') . ' AS a where a.user_id = "' . $user_id . '"';
$user = $GLOBALS['db']->getRow($sql);
if (empty($user)) {
// 根据user_id未查找到任何用户信息
}
// 用户不存在,创建用户信息
$username = $user_id;
$password = $user['password'];
$name = $user['user_name'];
$email = $user['email'];
$type = 10;
$shop_id = -1;
$result = create_of_user($username, $password, $name, $email, $type, $shop_id);
if ($result) {
// 创建成功
} else {
// 创建失败
}
}
// 获取前端传来的商品编号、订单编号、店铺编号等
// 商品编号则显示商品信息
// 订单编号则显示订单信息
// 店铺编号则显示店铺信息
$goods_id = null;
$supp_id = -1;
$order_id = null;
$customers = null;
// 获取客服信息
$tab_items = array();
// 客服类型
$cus_types = CUSTOMER_SERVICE;
// 记录需要发给客服的URL
if (!empty($_REQUEST['chat_goods_id'])) {
/* 咨询商品信息 */
$goods_id = $_REQUEST['chat_goods_id'];
$goods = goods_info($goods_id);
$smarty->assign('chat_goods', $goods);
$smarty->assign('chat_goods_id', $goods_id);
// 获取店铺信息
$supp_id = null;
$tab_items[] = array("id" => "chat_goods", "name" => "咨询商品");
// 客服+售前
$cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_PRE;
}
if (!empty($_REQUEST['chat_supp_id'])) {
/* 店铺信息 */
$supp_id = $_REQUEST['chat_supp_id'];
$supp_info = get_dianpu_baseinfo($supp_id);
$smarty->assign('supp_info', $supp_info);
$smarty->assign('chat_supp_id', $supp_id);
$tab_items[] = array("id" => "chat_supp", "name" => "店铺信息");
// 客服+售前
$cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_PRE;
}
if (!empty($_REQUEST['chat_order_id'])) {
/* 咨询订单信息 */
require 'includes/lib_order.php';
$order_id = $_REQUEST['chat_order_id'];
// 获取商品和店铺信息
$goods_id = null;
$supp_id = null;
$order = order_info($order_id);
$order['order_status_text'] = $GLOBALS['_LANG']['os'][$order['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$order['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$order['shipping_status']];
$order['goods_list'] = order_goods($order_id);
$smarty->assign('chat_order', $order);
$smarty->assign('chat_order_id', $order_id);
$smarty->assign('chat_order_sn', $order['order_sn']);
$tab_items[] = array("id" => "chat_order", "name" => "咨询订单");
// 客服+售后
$cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_AFTER;
}
if (true) {
/* 最近订单列表 */
require 'includes/lib_transaction_1.php';
// 获取用户最近的5条订单列表
$order_list = get_user_orders_1($user_id, 5, 0);
// 所有客服忙碌状态,提示web端
$smarty->assign('order_list', $order_list);
$smarty->assign('order_count', count($order_list));
$tab_items[] = array("id" => "chat_order_list", "name" => "最近订单");
//.........这里部分代码省略.........
开发者ID:seanguo166,项目名称:yinoos,代码行数:101,代码来源:chat.php
示例15: vhosts
public function vhosts()
{
//create file_name
if (!empty($_POST['vhostsname'])) {
$file_name = 'F:\\wamp\\www\\' . $_POST['vhostsname'];
if (!is_dir($file_name)) {
mkdir($file_name);
//httpd-vhosts.conf
$vhosts_name = 'F:\\wamp\\bin\\apache\\apache2.2.22\\conf\\extra\\httpd-vhosts.conf';
$search_vhosts = 'DocumentRoot "F:\\wamp\\www\\' . $_POST['vhostsname'];
if (!in_array($search_vhosts, file($vhosts_name))) {
$vhosts_content = "\r\n" . '<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "F:\\wamp\\www\\' . $_POST['vhostsname'] . '"
ServerName ' . $_POST['vhostsname'] . '
ErrorLog "logs/' . $_POST['vhostsname'] . '-error.log"
CustomLog "logs/' . $_POST['vhostsname'] . '-access.log" common
</VirtualHost>';
file_put_contents($vhosts_name, $vhosts_content, FILE_APPEND);
}
//hosts
$hosts_name = 'C:\\Windows\\System32\\drivers\\etc\\hosts';
$hosts_content = "\r\n" . '127.0.0.1 ' . $_POST['vhostsname'];
if (!in_array($hosts_content, file($hosts_name))) {
file_put_contents($hosts_name, $hosts_content, FILE_APPEND);
}
}
}
$url = url("myweb", "Test::vhosts");
$smarty = get_smarty();
$smarty->assign("action_url", $url);
$smarty->display("myweb/home/vhosts.html");
}
开发者ID:lughong,项目名称:test,代码行数:33,代码来源:test.php
示例16: addtoorder
public function addtoorder()
{
//是否已经登录
User::isLogin();
if (!$_POST) {
$url = url('goods', 'goods::balance');
header('Location:' . $url);
throw new Exception('exit');
}
$default_address_id = isset($_POST['shipping']) ? htmlspecialchars($_POST['shipping']) : 0;
$payment = isset($_POST['payment']) ? htmlspecialchars($_POST['payment']) : '';
$is_mobile = isset($_POST['mobile']) ? htmlspecialchars($_POST['mobile']) : '';
$uid = LuS::get('uid');
$username = LuS::get('username');
$order_id = Cart::addOrder($uid, $username, $payment, $default_address_id);
//订单详情页
$order_detail_url = url('usercenter', 'usercenter::detail', $order_id);
//首页
$home_url = HOMEURL;
//订单号
$order_info = OrderInfo::getUserOrderInfoByOrderId($uid, $order_id);
//获取支付链接
$pay = GoodsM::getPayList($order_info['sn']);
//货到付款
$hdfkpay_url = $order_detail_url;
$smarty = get_smarty();
$smarty->assign('order_detail_url', $order_detail_url);
$smarty->assign('home_url', $home_url);
$str = $smarty->fetch('goods/order_success.html');
//增加一个订单id
$return_arr = array(true, $str, $pay['alipay'], $pay['wxpay'], $pay['wxsaomapay'], $hdfkpay_url, $order_id);
echo json_encode($return_arr);
throw new Exception('exit');
}
开发者ID:lughong,项目名称:shop,代码行数:34,代码来源:goods.php
示例17: detail
public function detail($goods_id)
{
//检查登录
$this->_login();
if (!$goods_id) {
$url = url('admin', 'admingoods::sale');
header('Location:' . $url);
throw new Exception('exit');
}
$goods_id = $goods_id + 0;
//取出该商品信息
$goods_info = AdminGoodsM::getGoodsInfoByGoodsId($goods_id);
$smarty = get_smarty();
$this->_goodsleft($smarty);
//更新连接
$update_url = url('admin', 'admingoods::edit', $goods_id);
$smarty->assign('update_url', $update_url);
$smarty->assign('is_upload', false);
$smarty->assign('goods_info', $goods_info);
$smarty->display('admin/goods/index.html');
}
开发者ID:lughong,项目名称:shop,代码行数:21,代码来源:admingoods.php
示例18: msg
public function msg()
{
$smarty = get_smarty();
$this->_header($smarty);
$uid = User::getLoginUid();
$msg_info_list = UserMsg::getUserMsgByUid($uid);
if ($msg_info_list) {
foreach ($msg_info_list as $key => $value) {
$msg_info_list[$key]['accept_url'] = url("myweb", "friend::accept", $value['friend_id']);
}
} else {
$msg_info_list = array();
}
$smarty->assign("msg", $msg_info_list);
//返回
$return_url = url("myweb", "friend::index");
$smarty->assign("return_url", $return_url);
$smarty->display("myweb/usercenter/msg.html");
}
开发者ID:lughong,项目名称:test,代码行数:19,代码来源:friend.php
示例19: info
public function info($type_id, $id)
{
if (!$type_id || !$id) {
echo '<script>history.go(-1);</script>';
throw new Exception('exit');
}
$uid = User::getLoginUid();
$detail_info = JournalM::getJournalDetail($type_id, $id, $uid);
if (!$detail_info) {
echo '<script>history.go(-1);</script>';
throw new Exception('exit');
}
$smarty = get_smarty();
$this->_header($smarty);
//点赞数量
$goods_num = JournalGoods::getJournalGoodsCount($type_id, $detail_info['id']);
$smarty->assign("goods_num", $goods_num);
//评论数量
$comment_num = JournalComment::getJournalCommentCount($type_id, $detail_info['id']);
$smarty->assign("comment_num", $comment_num);
//是否已点赞
$is_goods = JournalGoods::getJournalGoodsCount($type_id, $detail_info['id']);
if ($is_goods) {
$smarty->assign("is_goods", "yes");
} else {
$smarty->assign("is_goods", 'no');
}
//公开日记链接
$public_url = url("myweb", "journal::index", 1);
$public_count = JournalM::getJournalCount(1, $uid);
$smarty->assign("public_count", $public_count);
$smarty->assign("public_url", $public_url);
//私密日记链接
$private_url = url("myweb", "journal::index", 2);
$private_count = JournalM::getJournalCount(2, $uid);
$smarty->assign("private_count", $private_count);
$smarty->assign("private_url", $private_url);
//日记点赞链接
$journal_good_url = url("myweb", "journal::good");
$smarty->assign("journal_good_url", $journal_good_url);
//评论日记链接
$comment_url = url("myweb", "journal::comment", $detail_info['id']);
$smarty->assign("comment_url", $comment_url);
//日记内容修改链接
$content_edit_url = url("myweb", "journal::contentedit", $detail_info['id']);
$smarty->assign("content_edit_url", $content_edit_url);
$smarty->assign("uid", User::getLoginUid());
$smarty->assign("detail_info", $detail_info);
$smarty->assign("type_id", $type_id);
$smarty->display("myweb/usercenter/journal_detail.html");
}
开发者ID:lughong,项目名称:test,代码行数:51,代码来源:journal.php
示例20: editaddr
public function editaddr($address_id)
{
$uid = LuS::get('uid');
//获取地址详情信息
$address = UserAddress::getAddrByAddressId($uid, $address_id);
if (!$address) {
echo "<script>alert('编辑错误!'); history.go(-1);</script>";
throw new Exception('exit');
}
//如果手机号为空
if (!$address['mobile']) {
$address['mobile'] = '';
}
$smarty = get_smarty();
//获取省份列表
$province_list = RegionM::getProvinces();
$smarty->assign('province', $province_list);
//获取城市列表
$city_list = RegionM::getCitys($address['province']);
$smarty->assign('city', $city_list);
//获取地区列表
$district_list = RegionM::getDistricts($address['city']);
$smarty->assign('district', $district_list);
//ajax获取城市列表地址
$addr_get_city_url = url('region', 'region::getcitys');
$smarty->assign('addr_get_city_url', $addr_get_city_url);
//ajax获取地区列表地址
$addr_get_dist_url = url('region', 'region::getdistricts');
$smarty->assign('addr_get_dist_url', $addr_get_dist_url);
//添加新地址action
$addr_edit_act_url = url('usercenter', 'usercenter::editactaddr', $address['address_id']);
$smarty->assign('addr_edit_act_url', $addr_edit_act_url);
$smarty->assign("address", $address);
$smarty->display('usercenter/usercenter_addr_edit.html');
}
开发者ID:lughong,项目名称:shop,代码行数:35,代码来源:usercenter.php
注:本文中的get_smarty函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论