本文整理汇总了PHP中Assign函数的典型用法代码示例。如果您正苦于以下问题:PHP Assign函数的具体用法?PHP Assign怎么用?PHP Assign使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Assign函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Assign
Assign('style_dir', LAYOUT);
Assign('template_dir', TEMPLATEDIR);
Assign('template_url', TEMPLATEURL);
Assign('layout_dir', LAYOUT);
if (USE_PHOTO_TAGGING == true) {
$Cbucket->addJS('jquery_plugs/jquery.cbtagger.js', 'view_item');
}
$Cbucket->addJS('jquery_plugs/jquery.Jcrop.js', 'edit_account');
$Cbucket->addJS('amplify/amplify.core.min.js');
$Cbucket->addJS('amplify/amplify.request.min.js');
$Cbucket->addJS('amplify/amplify.store.min.js');
$Cbucket->addJS('amplify_requests.js');
//Assigning JS Files
Assign('jsArray', $Cbucket->JSArray);
//Assigning Module Files
Assign('module_list', $Cbucket->moduleList);
//Checking Website is closed or not
if (config('closed') && THIS_PAGE != 'ajax' && !$in_bg_cron && THIS_PAGE != 'cb_install') {
if (!has_access("admin_access", TRUE)) {
e($row['closed_msg'], "w");
template("global_header.html");
template("message.html");
exit;
} else {
e(lang("ATTENTION: THIS WEBSITE IS IN OFFLINE MODE"), "w");
}
}
//Configuring Uploader
uploaderDetails();
register_filter('photo_action_links', 'cbphoto_pm_action_link_filter');
attach_photo_pm_handlers();
示例2: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號098 綁定手機號 ##參考015和096
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
if (CheckOpenID($params['openid'], $params['uid']) == FALSE) {
$result['msg'] = '电话号码已注册!';
} else {
$fields = array('username_d' => Assign($params[KEY_PHONE]), 'password' => Assign($params['pwd']));
$num = StorageEditByID('hh_techuser', $fields, $params['uid']);
if ($num <= 0) {
$result['msg'] = '绑定失败!';
} else {
$result = array('code' => '101', 'msg' => '绑定成功!');
}
}
示例3: count
$total = count($_POST['check_photo']);
for ($i = 0; $i < $total; $i++) {
$id_array[] = $_POST['check_photo'][$i];
}
//$eh->flush();
}
if (isset($_GET['search'])) {
$array = array('title' => $_GET['title'], 'pid' => $_GET['photoid'], 'key' => $_GET['photokey'], 'tags' => $_GET['tags'], 'featured' => $_GET['featured'], 'active' => $_GET['active'], 'user' => $_GET['userid'], 'extension' => $_GET['extension'], 'order' => $_GET['order']);
}
$parr = $array;
// Creating Limit
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, RESULTS);
$parr['limit'] = $get_limit;
if (!$parr['order']) {
$parr['order'] = " date_added DESC ";
} else {
$parr['order'] = $parr['order'] . " DESC";
}
$collections = $cbcollection->get_collections(array("type" => "photos"));
$photos = $cbphoto->get_photos($parr);
Assign('photos', $photos);
assign('c', $collections);
$pcount = $parr;
$pcount['count_only'] = true;
$total_rows = $cbphoto->get_photos($pcount);
$total_pages = count_pages($total_rows, RESULTS);
$pages->paginate($total_pages, $page);
subtitle("Photo Manager");
template_files('photo_manager.html');
display_it();
示例4: foreach
foreach ($condition['column'] as $key => $val) {
$buffer[$key] = Assign($row[$val], 0);
}
$filter_count = array('uid' => Assign($params['uid'], 0), 'tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'type' => '1');
if (StorageCount('hh_techuser_shoucang', $filter_count)) {
$buffer['collect'] = '1';
}
if ($params['type'] == '3' and $buffer['collect'] == '0') {
continue;
}
$filter_count['touid'] = 0;
if (StorageCount('hh_techuser_dianzan', $filter_count)) {
$buffer['mypraise'] = '1';
}
$filter_total = array('tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'type' => '1', 'touid' => 0);
$buffer['praises'] = StorageCount('hh_techuser_dianzan', $filter_total);
## 獲取圖片信息
if ($params['tag'] == '1' or $params['tag'] == '2') {
$buffer['mdata'] = array();
$condition_sub = array('schema' => 'hh_techforum_img', 'fields' => array('id'), 'filter' => array('qid' => Assign($row['id'], 0)));
$buf = StorageFind($condition_sub);
if (is_array($buf) and empty($buf) == FALSE) {
foreach ($buf as $number => $row_img) {
$buffer['mdata'][] = array('mid' => $row_img['id'], 'type' => '0', 'mname' => 'image' . ($number + 1), 'mpic' => "{$row_img['id']}_s.png", 'url' => '');
}
}
}
$result['data'][] = $buffer;
}
}
}
示例5: Techuser_rank2score
} else {
$rankscore = Techuser_rank2score(Assign($params['reward'], 0));
if (empty($rankscore) == FALSE) {
$record_user = StorageFindID('hh_techuser', $params['uid']);
if (is_array($record_user) == FALSE or empty($record_user) == TRUE) {
$result['msg'] = '当前帐号不存在!';
} else {
if ($record_user['rankscore'] < $rankscore) {
$result['msg'] = '您的可兑换积分余额不足!';
} else {
$result['msg'] = '';
}
}
}
if (empty($result['msg']) == TRUE or empty($params['reward']) == TRUE) {
$data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'title' => Assign($params['title']), 'content' => Assign($params['context']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous'], 0), 'reward' => Assign($params['reward'], 0), 'rewarded' => empty($params['reward']) ? 0 : $rankscore);
$id = StorageAdd('hh_techforum', $data);
if (empty($id) == TRUE) {
$result['msg'] = MESSAGE_ERROR;
} else {
for ($index = 0; $index < 6; $index++) {
$field = 'image' . strval($index + 1);
if ($_FILES[$field]['error'] <= 0 and empty($_FILES[$field]['tmp_name']) == FALSE) {
$buf_data = array('qid' => $id, 'createdat' => 'NOW()', 'filename' => $_FILES[$field]['name'], 'size' => $_FILES[$field]['size']);
$buf_id = StorageAdd('hh_techforum_img', $buf_data);
$uploadfile = PIC_F_PATH . DIRECTORY_SEPARATOR . "{$buf_id}.png";
$uploadfile_s = PIC_F_PATH . DIRECTORY_SEPARATOR . "{$buf_id}_s.png";
move_uploaded_file($_FILES[$field]['tmp_name'], $uploadfile);
MakeSmallIMG($uploadfile, $uploadfile_s);
}
}
示例6: switch
//Deleting Multiple Videos
if (isset($_POST['delete_flags'])) {
for ($id = 0; $id <= RESULTS; $id++) {
$eh->flush();
$cbvid->action->delete_flags($_POST['check_video'][$id]);
}
}
switch ($mode) {
case "view":
default:
assign("mode", "view");
//Getting Video List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, 5);
$videos = $cbvid->action->get_flagged_objects($get_limit);
Assign('videos', $videos);
//Collecting Data for Pagination
$total_rows = $cbvid->action->count_flagged_objects();
$total_pages = count_pages($total_rows, 5);
//Pagination
$pages->paginate($total_pages, $page);
break;
case "view_flags":
assign("mode", "view_flags");
$vid = mysql_clean($_GET['vid']);
$vdetails = $cbvid->get_video($vid);
if ($vdetails) {
$flags = $cbvid->action->get_flags($vid);
assign('flags', $flags);
assign('video', $vdetails);
} else {
示例7: array
case '1':
$condition = array('schema' => 'hh_techuser', 'filter' => array('username_d' => Assign($params['phone'])));
if (empty($params['phoneaes']) == FALSE) {
$condition['filter']['username'] = Assign($params['phoneaes']);
}
$record = StorageFindOne($condition);
if (is_array($record) and empty($record) == FALSE) {
$result['msg'] = '该号码已经被注册!';
die(JsonEncode($result));
}
$params['message'] = SMS_ACTION_BANDINGS . $chars;
break;
case '2':
$condition = array('schema' => 'hh_techuser', 'filter' => array('username_d' => Assign($params['phone'])));
if (empty($params['phoneaes']) == FALSE) {
$condition['filter']['username'] = Assign($params['phoneaes']);
}
$record = StorageFindOne($condition);
if (is_array($record) == FALSE or empty($record) == TRUE) {
$result['msg'] = '该号码不存在!';
die(JsonEncode($result));
}
$params['message'] = SMS_ACTION_PASSWORD . $chars;
break;
}
## 發送短信
if (SMS($params['phone'], $params['message']) == FALSE) {
$result['msg'] = '发送失败!';
die(JsonEncode($result));
}
$result = array('code' => '101', 'data' => $chars);
示例8: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號087 推薦APP
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
$condition = array('schema' => 'hh_dbver', 'fields' => array('COUNT(*)', 'ver'), 'filter' => array('vername' => 'app_' . Assign($params['tag']), 'ver' => array('GT', Assign($params['databasever'], 0))));
$recordset = StorageFind($condition);
if (is_array($recordset) == FALSE or empty($recordset) == TRUE) {
$result['msg'] = MESSAGE_EMPTY;
} else {
$result = array('code' => '101', 'data' => array(), 'messages' => 0);
if (empty($recordset) == FALSE) {
$result['databasever'] = $recordset[0]['ver'];
}
$condition_sub = array('schema' => 'hh_app', 'fields' => array('id', 'title', 'url', 'img'), 'filter' => array('tag' => array('NEQ', $params['tag'])));
$buf = StorageFind($condition_sub);
if (is_array($buf) and empty($buf) == FALSE) {
foreach ($buf as $index => $row) {
$result['data'][] = array('aid' => $row['id'], 'aname' => $row['title'], 'url' => $row['url'], 'imageurl' => $row['img']);
$result['messages'] += 1;
}
}
示例9: e
}
//Create package
if (isset($_GET['create_package'])) {
if ($lang_obj->createPack($_GET['create_package'])) {
e("Language pack has been re-created", "m");
}
}
//Create package
if (isset($_GET['recreate_from_pack'])) {
if ($lang_obj->updateFromPack($_GET['recreate_from_pack'])) {
e("Language database has been updated", "m");
}
}
//Get List Of Languages
assign('language_list', $lang_obj->get_langs());
Assign('msg', $msg);
if ($lang_obj->lang_exists(mysql_clean($_GET['edit_language']))) {
assign('edit_lang', 'yes');
assign('lang_details', $lang_obj->lang_exists(mysql_clean($_GET['edit_language'])));
$edit_id = mysql_clean($_GET['edit_language']);
$limit = RESULTS;
$current_page = $_GET['page'];
$current_page = is_numeric($current_page) && $current_page > 0 ? $current_page : 1;
$curr_limit = ($current_page - 1) * $limit . ',' . $limit;
if (isset($_GET['search_phrase'])) {
$varname = mysql_clean($_GET['varname']);
$text = mysql_clean($_GET['text']);
if (!empty($varname)) {
$varname_query = "varname LIKE '%{$varname}%'";
}
if (!empty($text)) {
示例10: assign
}
}
//Set Mode
assign('mode', $_GET['mode']);
if (isset($_POST['update'])) {
$configs = $Cbucket->configs;
$rows = array('autoplay_video', 'buffer_time', 'logo_placement', 'use_playlist', 'youtube_enabled', 'enlarge_button', 'embed_player_height', 'embed_player_width', 'autoplay_embed', 'pseudostreaming', 'pak_license', 'pakplayer_contextmsg');
//Checking for logo
if (isset($_FILES['logo_file']['name'])) {
$logo_file = $Upload->upload_website_logo($_FILES['logo_file']);
if ($logo_file) {
$myquery->Set_Website_Details('player_logo_file', $logo_file);
}
}
if ($_POST['pak_license'] && !file_exists(BASEDIR . '/player/pak_player/pakplayer.unlimited.swf')) {
$_POST['pak_license'] = "";
}
foreach ($rows as $field) {
$value = mysql_clean($_POST[$field]);
$myquery->Set_Website_Details($field, $value);
}
e("Player Settings Have Been Updated", 'm');
}
if ($_GET['set']) {
$cbplayer->set_player($_GET);
}
$row = $myquery->Get_Website_Details();
Assign('row', $row);
subtitle("Manage Players");
template_files('manage_players.html');
display_it();
示例11: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號007 申請訪問該問題
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-16#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
if (CheckOpenID($params['openid'], $params['uid']) == FALSE) {
$result['msg'] = MESSAGE_WARNING;
} else {
$fields = array('lockby' => 0, 'locktime' => 'NOW()', 'zhuangtai' => 0);
$filter = array('id' => Assign($params['qid'], 0), 'lockby' => Assign($params['uid'], 0), 'zhuangtai' => 1);
$num = StorageEdit('hh_questions', $fields, $filter);
if (empty($num) == TRUE) {
$result['msg'] = '放弃失败!';
} else {
StorageEdit('hh_questions_list', array('zhuangtai' => 1), array('qid' => Assign($params['qid'], 0)));
$result = array('code' => '101', 'msg' => MESSAGE_SUCCESS);
}
}
示例12: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號107 獲取案例跟貼(服務器頁面Ajax專用)
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
header('Access-Control-Allow-Origin:*');
$result = array('code' => '101', 'data' => array());
$condition = array('schema' => 'hh_anli_thread', 'filter' => array('cid' => empty($_REQUEST['cid']) ? Assign($params['cid'], 0) : $_REQUEST['cid']), 'others' => 'ORDER BY id DESC', 'charset' => TRUE);
$recordset = StorageFind($condition);
if (is_array($recordset) and empty($recordset) == FALSE) {
foreach ($recordset as $index => $row) {
$record = StorageFindID('hh_techuser', $row['uid']);
$content = $row['content'];
if (empty($row['version']) == FALSE) {
$content = Charset($content, DB_CHARSET, CL_CHARSET);
}
$result['data'][] = array('uid' => Assign($row['uid'], 0), 'nick' => Assign($record['nick'], NICK_DEFAULT), 'image' => empty($record['headerimg']) ? ICON_DEFAULT : ICON_PATH . $record['headerimg'], 'potimes' => $row['createdat'], 'context' => $content, 'cid' => $row['cid']);
}
}
示例13: mysql_clean
}
$child_ids[] = mysql_clean($category);
}
}
$search->category = $child_ids;
}
$search->date_margin = mysql_clean($_GET['datemargin']);
$search->sort_by = mysql_clean($_GET['sort']);
$search->limit = create_query_limit($page, $search->results_per_page);
$results = $search->search();
//echo $db->db_query;
//Collecting Data for Pagination
$total_rows = $search->total_results;
$total_pages = count_pages($total_rows, $search->results_per_page);
//Pagination
$pages->paginate($total_pages, $page);
Assign('results', $results);
Assign('template_var', $search->template_var);
Assign('display_template', $search->display_template);
if (empty($search->key)) {
Assign('search_type_title', $search->search_type[$type]['title']);
} else {
Assign('search_type_title', sprintf(lang('searching_keyword_in_obj'), mysql_clean(get('query')), $search->search_type[$type]['title']));
}
if (mysql_clean(get('query'))) {
subtitle($search->search_type[$type]['title'] . ' » ' . mysql_clean(get('query')));
}
//Displaying The Template
template_files('search.html');
display_it();
//pr($db);
示例14: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號062 匹配正時之獲取車型詳細信息 ##代替048
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
$condition = array('schema' => 'car_type_zhengshi', 'fields' => array('id', 'title'), 'flter' => array('oftype' => Assign($params['bid'], 0), 'type' => Assign($params['tid'], 0)));
$recordset = StorageFind($condition);
if (is_array($recordset) == FALSE or empty($recordset) == TRUE) {
$result['msg'] = '没有新数据,或者出现错误!';
} else {
$result = array('code' => '101', 'data' => array());
foreach ($recordset as $index => $row) {
$result['data'][] = array('id' => $row['id'], 'name' => $row['title']);
}
}
示例15: die
<?php
// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號075 提交案例評分
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
die('Permission denied');
}
if (CheckOpenID($params['openid'], $params['uid']) == FALSE) {
$result['msg'] = MESSAGE_WARNING;
} else {
$data = array('ofuser' => Assign($params['uid'], 0), 'createdat' => 'NOW()', 'ofanli' => Assign($params['cid'], 0), 'score' => Assign($params['score'], 0));
$id = StorageAdd('car_anli_score', $data);
if (empty($id) == TRUE) {
$result['msg'] = '重复保存!';
} else {
$avg = "(SELECT SUM(score)/COUNT(id) FROM car_anli_score WHERE ofanli='%d')";
$fields = array('score_avg' => sprintf($avg, $params['cid']));
StorageEditByID('search_result', $fields, $params['cid']);
## 更新用戶積分
Techuser_setScore(Assign($params['uid'], 0), 5);
$result = array('code' => '101', 'msg' => MESSAGE_SUCCESS);
}
}