本文整理汇总了PHP中system::getAllKeyValue方法的典型用法代码示例。如果您正苦于以下问题:PHP system::getAllKeyValue方法的具体用法?PHP system::getAllKeyValue怎么用?PHP system::getAllKeyValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system
的用法示例。
在下文中一共展示了system::getAllKeyValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: system
if (isset($_POST['edit']) && isset($_POST['value']) && $_POST['value'] == 'sendmail') {
require_once ROOT_PATH . "/apps/system/models/system.class.php";
$sys = new system();
$sys->unuse_smtp();
die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
if (isset($_POST['edit']) && isset($_POST['value']) && $_POST['value'] == 'smtp') {
require_once ROOT_PATH . "/apps/system/models/system.class.php";
$sys = new system();
$sys->use_smtp();
die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
if (isset($_POST['email'])) {
require_once ROOT_PATH . "/apps/system/models/system.class.php";
$system = new system();
$smtpconf = $system->getAllKeyValue();
require_once ENGINE_PATH . '/classes/email.class.php';
$emailClass = new email();
$emailClass->email_sock($smtpconf["smtp_host"], $smtpconf["smtp_port"], 0, 'error', 10, 1, $smtpconf["smtp_user"], $smtpconf["smtp_pass"], $smtpconf["smtp_from"]);
if ($emailClass->send_mail_sock("测试邮件", "这是一封测试邮件", $_POST['email'], $smtpconf["smtp_from_name"]) == 1) {
die(json_encode(array('status' => '发送成功')));
} else {
die(json_encode(array('status' => '发送失败,请正确配置SMTP')));
}
}
if (isset($_POST['edit']) && isset($_POST['value']) && $_POST['value'] == 'template') {
require_once ROOT_PATH . "/apps/system/models/system.class.php";
$sys = new system();
$sys->edit_template($_POST["template"]);
die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
示例2: lostUsername
public function lostUsername()
{
global $mysql, $langArray, $config, $meta;
$mysql->query("\n\t\t\tSELECT *\n\t\t\tFROM `users`\n\t\t\tWHERE `email` = '" . sql_quote($_POST['email']) . "'\n\t\t", __FUNCTION__);
if ($mysql->num_rows() == 0) {
return 'error_invalid_user_email';
}
$d = $mysql->fetch_array();
//判断有无客服管理模块
require_once ROOT_PATH . '/apps/app_extends/models/app_extends.class.php';
$app_extends = new app_extends();
if ($app_extends->is_service()) {
//通过用户id获取关联客服
require_once ROOT_PATH . '/apps/service/models/service.class.php';
$service = new service();
$theservice = $service->getserviceByuserid($d['user_id']);
require_once ENGINE_PATH . 'classes/email.class.php';
$emailClass = new email();
$emailClass->fromEmail = 'no-reply@' . $config['domain'];
$emailClass->contentType = 'text/html';
$emailClass->subject = '[' . $meta['meta_title'] . ']发给[' . $d['username'] . ']的找回用户名邮件';
$emailClass->message = '[' . $d['username'] . ']!<br />
什么?你连用户名都能忘?你是不是打算把小编也忘了,太残忍了! <br />
算了,不跟你计较,这是你的用户名:<br />
帐号:[' . $d['username'] . ']<br />
不许再忘哦!<br />
<br />
专属小编:[' . $theservice['user_name'] . ']<br />
[' . $meta['meta_title'] . ']<br />
[' . date('Y-m-d H:i:s', time()) . ']<br />';
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$system = new system();
$smtp = $system->is_smtp();
$smtpconf = $system->getAllKeyValue();
if ($smtp) {
$emailClass->email_sock($smtpconf["smtp_host"], $smtpconf["smtp_port"], 0, 'error', 10, 1, $smtpconf["smtp_user"], $smtpconf["smtp_pass"], $smtpconf["smtp_from"]);
$emailClass->send_mail_sock($emailClass->subject, $emailClass->message, $d['email'], $smtpconf["smtp_from_name"]);
unset($emailClass);
return true;
}
$emailClass->to($d['email']);
$emailClass->send();
unset($emailClass);
return true;
}
require_once ENGINE_PATH . 'classes/email.class.php';
$emailClass = new email();
$emailClass->fromEmail = 'no-reply@' . $config['domain'];
$emailClass->subject = '[' . $config['domain'] . '] ' . $langArray['email_lost_username'];
$emailClass->message = langMessageReplace($langArray['email_lost_username_text'], array('DOMAIN' => $config['domain'], 'USERNAME' => $d['username']));
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$system = new system();
$smtp = $system->is_smtp();
$smtpconf = $system->getAllKeyValue();
if ($smtp) {
$emailClass->email_sock($smtpconf["smtp_host"], $smtpconf["smtp_port"], 0, 'error', 10, 1, $smtpconf["smtp_user"], $smtpconf["smtp_pass"], $smtpconf["smtp_from"]);
$emailClass->send_mail_sock($emailClass->subject, $emailClass->message, $d['email'], $smtpconf["smtp_from_name"]);
unset($emailClass);
return true;
}
$emailClass->to($d['email']);
$emailClass->send();
unset($emailClass);
return true;
}
示例3: Smarty
define('SMARTY_DIR', ENGINE_PATH . "classes/Smarty/");
include_once SMARTY_DIR . "Smarty.class.php";
$smarty = new Smarty();
$smarty->compile_dir = CACHE . "/templates_cache/";
$smarty->compile_check = true;
$smarty->debugging = false;
$smarty->register_function('createEditor', 'createTextAreaEditor');
global $smarty;
#END;
//模板设置
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$systemClass = new system();
$currency = $systemClass->getActiveCurrency();
abr('currency', $currency);
#元数据
$meta = $systemClass->getAllKeyValue();
$smarty->assign('title', $meta['meta_title']);
$smarty->assign('meta_keywords', $meta['meta_keywords']);
$smarty->assign('meta_description', $meta['meta_description']);
$smarty->assign('site_logo', $meta['site_logo']);
/*
* 包含模板设置文件
*/
include_once ENGINE_PATH . '/system/core.template.php';
//模板目录
define("TEMPLATE_PATH", ROOT_PATH . "/templates/home/" . $meta['template'] . "/html/");
define("ADMIN_TEMPLATE_PATH", ROOT_PATH . "/templates/admin/" . $meta['admin_template'] . "/html/");
$config['template_data_path'] = $config['data_server_path'] . 'home/' . $meta['template'] . '/';
//前台模板资源目录
$config['template_path'] = $config['root_path'] . 'templates/home/' . $meta['template'] . '/';
//前台模板目录
示例4: unapproveDeleteUpdate
public function unapproveDeleteUpdate($id)
{
global $mysql, $item, $data, $langArray, $config, $meta;
if (!isset($_POST['comment_to_user']) || trim($_POST['comment_to_user']) == '') {
return $langArray['error_set_comment_to_user'];
}
$setQuery = '';
//获取当前作品历史数据
$mysql->query("\n\t\t\tSELECT *\n\t\t\tFROM `temp_items`\n\t\t\tWHERE `item_id` = '" . intval($item['id']) . "'\n\t\t\tLIMIT 1\n\t\t");
$temp_item_data = $mysql->fetch_array();
//回滚作品
$mysql->query("\n\t\t\tUPDATE `items`\n\t\t\tSET \n\t\t\t`status` = 'active'\n\t\t\tWHERE `id` = '" . intval($item['id']) . "'\n\t\t\tLIMIT 1\n\t\t");
//检测预览文件状态
if (!empty($temp_item_data['theme_preview'])) {
//删除新增预览图
$this->del_preview($item['id'], true);
//回滚原预览文件
$preview_arr = json_decode($temp_item_data['theme_preview'], 1);
foreach ($preview_arr as $value) {
$this->save_theme_preview($item['id'], $value, 1);
}
}
$this->deleteUpdate($item['id']);
////判断有无客服管理模块
// require_once ROOT_PATH.'/apps/app_extends/models/app_extends.class.php';
//
// $app_extends=new app_extends();
// if($app_extends->is_service()){
// //获取用户信息
// require_once ROOT_PATH.'/apps/users/models/users.class.php';
// $user = new users();
// $user_info = $user->getuserinfoById($item['user_id']);
// //通过用户id获取关联客服
// require_once ROOT_PATH.'/apps/service/models/service.class.php';
// $service = new service();
// $theservice = $service->getserviceByuserid($item['user_id']);
// $item_url = $config['domain'].'/'.$languageURL.'items/'.$item['id'];
// #给用户发邮件
// require_once ENGINE_PATH.'/classes/email.class.php';
// $emailClass = new email();
//
// $emailClass->fromEmail = 'no-reply@'.$config['domain'];
// $emailClass->contentType = 'text/html';
// $emailClass->subject = '你的作品['.$item['name'].']更新被拒绝';
// $emailClass->message = 'Hi!['.$user_info['username'].']:<br />
// 很抱歉你的作品['.$item['name'].']更新因以下原因被拒绝:<br />
// ['.$_POST['comment_to_user'].']<br />
// 不要失望好么?小编其实也很难过!<br />
// 一定要再接再厉,小编为你加油!<br />
// Fighting!<br />
// <br />
// 专属小编:['.$theservice['user_name'].']<br />
// ['.$meta['meta_title'].']<br />
// ['.date('Y-m-d H:i:s',time()).']<br />';
// require_once ROOT_PATH.'/apps/system/models/system.class.php';
// $system = new system();
// $smtp = $system ->is_smtp();
// $smtpconf=$system->getAllKeyValue();
// if($smtp){
// $emailClass->email_sock($smtpconf["smtp_host"],$smtpconf["smtp_port"],0,'error',10,1,$smtpconf["smtp_user"],$smtpconf["smtp_pass"],$smtpconf["smtp_from"]);
// $emailClass->send_mail_sock($emailClass->subject,$emailClass->message,$user_info['email'],$smtpconf["smtp_from_name"]) ;
// unset($emailClass);
// }else{
// $emailClass->to($user_info['email']);
// $emailClass->send();
// unset($emailClass);
// }
// }else{
#给用户发邮件
require_once ENGINE_PATH . '/classes/email.class.php';
$emailClass = new email();
$emailClass->fromEmail = 'no-reply@' . $config['domain'];
$emailClass->subject = '[' . $config['domain'] . '] ' . $langArray['email_unapprove_delete_item_update_subject'];
$emailClass->message = langMessageReplace($langArray['email_unapprove_delete_item_update_text'], array('THEMENAME' => $item['name'], 'COMMENT' => $_POST['comment_to_user']));
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$system = new system();
$smtp = $system->is_smtp();
$smtpconf = $system->getAllKeyValue();
if ($smtp) {
$emailClass->email_sock($smtpconf["smtp_host"], $smtpconf["smtp_port"], 0, 'error', 10, 1, $smtpconf["smtp_user"], $smtpconf["smtp_pass"], $smtpconf["smtp_from"]);
$emailClass->send_mail_sock($emailClass->subject, $emailClass->message, $user_info['email'], $smtpconf["smtp_from_name"]);
unset($emailClass);
} else {
$emailClass->to($item['user']['email']);
$emailClass->send();
unset($emailClass);
}
// }
return true;
}
示例5: add
public function add()
{
global $mysql, $langArray, $config;
if (!isset($_POST['name']) || trim($_POST['name']) == '') {
$error['name'] = $langArray['error_fill_this_field'];
}
if (!isset($_POST['text']) || trim($_POST['text']) == '') {
$error['text'] = $langArray['error_fill_this_field'];
}
if (!isset($_POST['send_to']) || trim($_POST['send_to']) == '') {
$error['send_to'] = $langArray['error_fill_this_field'];
}
if (isset($_POST['send_to']) && $_POST['send_to'] == 'city' && (!isset($_POST['city_id']) || !is_numeric($_POST['city_id']))) {
$error['city'] = $langArray['error_fill_this_field'];
}
if (isset($_POST['send_to']) && $_POST['send_to'] == 'group' && (!isset($_POST['bgroup_id']) || !is_numeric($_POST['bgroup_id']))) {
$error['group'] = $langArray['error_fill_this_field'];
}
if (isset($error)) {
return $error;
}
$sendID = 0;
if ($_POST['send_to'] == 'city') {
$sendID = $_POST['city_id'];
} elseif ($_POST['send_to'] == 'group') {
$sendID = $_POST['bgroup_id'];
}
$mysql->query("\n\t\t\tINSERT INTO `bulletin` (\n\t\t\t\t`name`,\n\t\t\t\t`text`,\n\t\t\t\t`datetime`,\n\t\t\t\t`send_to`,\n\t\t\t\t`send_id`\n\t\t\t)\n\t\t\tVALUES (\n\t\t\t\t'" . sql_quote($_POST['name']) . "',\n\t\t\t\t'" . sql_quote($_POST['text']) . "',\n\t\t\t\tNOW(),\n\t\t\t\t'" . sql_quote($_POST['send_to']) . "',\n\t\t\t\t'" . intval($sendID) . "'\n\t\t\t)\n\t\t", __FUNCTION__);
$bulletinID = $mysql->insert_id();
#加载订阅列表
if ($_POST['send_to'] == 'city') {
$mysql->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM `users`\n\t\t\t\tWHERE `city_id` = '" . intval($_POST['city_id']) . "' AND `bulletin_subscribe` = 'true'\n\t\t\t");
if ($mysql->num_rows() > 0) {
while ($d = $mysql->fetch_array()) {
$emails[] = $d['email'];
}
}
}
#加载分组
if ($_POST['send_to'] == 'group') {
$mysql->query("\n\t\t\t\tSELECT u.*\n\t\t\t\tFROM `bulletin_users` AS bg\t\t\t\t\n\t\t\t\tJOIN `users` AS u\n\t\t\t\tON u.`user_id` = bg.`user_id` AND u.`bulletin_subscribe` = 'true'\n\t\t\t\tWHERE bg.`bulletingroup_id` = '" . intval($_POST['bgroup_id']) . "'\n\t\t\t");
if ($mysql->num_rows() > 0) {
while ($d = $mysql->fetch_array()) {
$emails[] = $d['email'];
}
}
}
#加载全部
if ($_POST['send_to'] == 'active') {
$mysql->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM `users`\n\t\t\t\tWHERE `bulletin_subscribe` = 'true'\n\t\t\t");
if ($mysql->num_rows() > 0) {
while ($d = $mysql->fetch_array()) {
$emails[] = $d['email'];
}
}
}
#加载全部
if ($_POST['send_to'] == 'admins') {
$mysql->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM `admins`\n\t\t\t\tWHERE `bulletin_subscribe` = 'true'\n\t\t\t");
if ($mysql->num_rows() > 0) {
while ($d = $mysql->fetch_array()) {
$emails[] = $d['email'];
}
}
}
#加载全部
if ($_POST['send_to'] == 'site') {
$mysql->query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM `bulletin_emails`\n\t\t\t\tWHERE `bulletin_subscribe` = 'true'\n\t\t\t");
if ($mysql->num_rows() > 0) {
while ($d = $mysql->fetch_array()) {
$emails[] = $d['email'];
}
}
}
#获取模板
$mysql->query("\n\t\t\tSELECT *\n\t\t\tFROM `bulletin_template`\n\t\t\tORDER BY `id` DESC\n\t\t\tLIMIT 1\n\t\t");
if ($mysql->num_rows() > 0) {
$template = $mysql->fetch_array();
$template = $template['template'];
} else {
$template = '{$CONTENT}';
}
if (isset($emails)) {
require_once $config['system_core'] . 'classes/email.class.php';
foreach ($emails as $email) {
$mail = new email();
$mail->fromEmail = 'no-reply@' . $config['domain'];
$mail->to($email);
$mail->subject = '[' . $config['domain'] . '] ' . $_POST['name'];
$mail->contentType = 'text/html';
$mail->message = langMessageReplace($template, array('DOMAIN' => $config['domain'], 'BULLETINID' => $bulletinID, 'EMAIL' => $email, 'CONTENT' => $_POST['text']));
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$system = new system();
$smtp = $system->is_smtp();
$smtpconf = $system->getAllKeyValue();
if ($smtp) {
$mail->email_sock($smtpconf["smtp_host"], $smtpconf["smtp_port"], 0, 'error', 10, 1, $smtpconf["smtp_user"], $smtpconf["smtp_pass"], $smtpconf["smtp_from"]);
$mail->send_mail_sock($mail->subject, $mail->message, $email, $smtpconf["smtp_from_name"]);
unset($emailClass);
} else {
//.........这里部分代码省略.........
示例6: referalMoney
public function referalMoney($row, $you)
{
global $mysql, $langArray;
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$systemClass = new system();
//返回推广者推荐从此用户获佣金次数
$totals = $usersClass->getTotalReferals($you['user_id'], $you['referal_id']);
//获取系统配置
$configure = $systemClass->getAllKeyValue();
//在此用户获取佣金上限 以后不会在此用户上获取佣金提成
if ((int) $configure['referal_sum'] && $totals + 1 > (int) $configure['referal_sum']) {
$mysql->query("\n\t\t\t\tUPDATE `users`\n\t\t\t\tSET `referal_id` = 0\n\t\t\t\tWHERE `user_id` = '" . intval($you['user_id']) . "'\n\t\t\t\tLIMIT 1 \n\t\t\t");
return false;
}
//可获佣金提成
$referalMoney = floatval($row['price']) * (int) $configure['referal_percent'] / 100;
//充值至用户
$mysql->query("\n\t\t\tUPDATE `users`\n\t\t\tSET `earning` = `earning` + '" . sql_quote($referalMoney) . "',\n\t\t\t\t\t`total` = `total` + '" . sql_quote($referalMoney) . "',\n\t\t\t\t\t`referal_money` = `referal_money` + '" . sql_quote($referalMoney) . "'\n\t\t\tWHERE `user_id` = '" . intval($you['referal_id']) . "'\n\t\t\tLIMIT 1\n\t\t");
//资金流动类
require_once ROOT_PATH . '/apps/users/models/transaction_details.class.php';
$logClass = new transaction_details();
//记录流水
if ($referalMoney > 0) {
$logClass->addRecord(intval($you['referal_id']), 'referal_income', floatval($referalMoney), $langArray['item_name'] . ':' . $row['item_name']);
}
//佣金记录形成订单
$mysql->query("\n\t\t\tINSERT INTO `orders` (\n\t\t\t\t`user_id`,\n\t\t\t\t`owner_id`,\n\t\t\t\t`item_id`,\n\t\t\t\t`item_name`,\n\t\t\t\t`price`,\n\t\t\t\t`datetime`,\n\t\t\t\t`receive`,\n\t\t\t\t`paid`,\n\t\t\t\t`paid_datetime`,\n\t\t\t\t`type`\n\t\t\t)\n\t\t\tVALUES (\n\t\t\t\t'" . intval($row['user_id']) . "',\n\t\t\t\t'" . intval($row['owner_id']) . "',\n\t\t\t\t'" . intval($row['item_id']) . "',\n\t\t\t\t'" . sql_quote($row['item_name']) . "',\n\t\t\t\t'" . sql_quote($row['price']) . "',\n\t\t\t\tNOW(),\n\t\t\t\t'" . sql_quote($referalMoney) . "',\n\t\t\t\t'true',\n\t\t\t\tNOW(),\n\t\t\t\t'referal'\n\t\t\t)\n\t\t");
$mysql->query("\n\t\t\tINSERT INTO `users_referals_count` (\n\t\t\t\t`user_id`,\n\t\t\t\t`referal_id`,\n\t\t\t\t`datetime`\n\t\t\t)\n\t\t\tVALUES (\n\t\t\t\t'" . intval($you['user_id']) . "',\n\t\t\t\t'" . intval($you['referal_id']) . "',\n\t\t\t\tNOW()\n\t\t\t)\n\t\t");
}
示例7: referalMoney
public function referalMoney($row, $user)
{
global $mysql;
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
require_once ROOT_PATH . '/apps/system/models/system.class.php';
$systemClass = new system();
//获取推荐人在通过该用户购买作品获得到的分成次数
$totals = $usersClass->getTotalReferals($user['user_id'], $user['referal_id']);
//获取用户配置信息
$configure = $systemClass->getAllKeyValue();
//管理员设置了上限次数 且 所获分成次数达到上限
if ((int) $configure['referal_sum'] && $totals + 1 > (int) $configure['referal_sum']) {
$mysql->query("\n\t\t\t\tUPDATE `users`\n\t\t\t\tSET `referal_id` = 0\n\t\t\t\tWHERE `user_id` = '" . intval($user['user_id']) . "'\n\t\t\t\tLIMIT 1 \n\t\t\t");
return false;
}
//充值金额 * 分成比例
$referalMoney = floatval($row['deposit']) * (int) $configure['referal_percent'] / 100;
//对推荐人进行分成充值
$mysql->query("\n\t\t\tUPDATE `users`\n\t\t\tSET `earning` = `earning` + '" . sql_quote($referalMoney) . "',\n\t\t\t\t\t`total` = `total` + '" . sql_quote($referalMoney) . "',\n\t\t\t\t\t`referal_money` = `referal_money` + '" . sql_quote($referalMoney) . "'\t\t\t\t\t\t\t\t\t\n\t\t\tWHERE `user_id` = '" . intval($user['referal_id']) . "'\n\t\t\tLIMIT 1\n\t\t");
//将提成形成订单
$mysql->query("\n\t\t\tINSERT INTO `orders` (\n\t\t\t\t`user_id`,\n\t\t\t\t`owner_id`,\n\t\t\t\t`item_id`,\n\t\t\t\t`item_name`,\n\t\t\t\t`price`,\n\t\t\t\t`datetime`,\n\t\t\t\t`receive`,\n\t\t\t\t`paid`,\n\t\t\t\t`paid_datetime`,\n\t\t\t\t`type`\n\t\t\t)\n\t\t\tVALUES (\n\t\t\t\t'" . intval($user['user_id']) . "',\n\t\t\t\t'" . intval($user['referal_id']) . "',\n\t\t\t\t'0',\n\t\t\t\t'deposit',\n\t\t\t\t'" . sql_quote($row['deposit']) . "',\n\t\t\t\tNOW(),\n\t\t\t\t'" . sql_quote($referalMoney) . "',\n\t\t\t\t'true',\n\t\t\t\tNOW(),\n\t\t\t\t'referal'\n\t\t\t)\n\t\t");
}