本文整理汇总了PHP中jget函数的典型用法代码示例。如果您正苦于以下问题:PHP jget函数的具体用法?PHP jget怎么用?PHP jget使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
$username = jget('username', 'txt');
$password = jget('password');
$openid = jget('openid');
if ($username == "" || $password == "") {
json_error("无法登录,用户名或密码不能为空");
}
if ($this->Config['login_by_uid']) {
is_numeric($username) && json_error("禁止使用UID登录");
}
if ($GLOBALS['_J']['plugins']['func']['login']) {
hookscript('login', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'login');
}
$rets = jsg_member_login($username, $password);
$uid = (int) $rets['uid'];
if ($uid < 1) {
json_error(array_iconv($this->Config['charset'], 'utf-8', $rets['error']));
}
$r = false;
if ($openid && $uid) {
$r = jlogic('wechat')->do_bind($openid, $uid);
}
if ($r) {
json_result("绑定成功!");
} else {
json_error("绑定失败!");
}
}
示例2: static_data_refresh
function static_data_refresh()
{
$type = jget('type');
if (!in_array($type, array('app', 'content', 'login', 'other', 'role', 'user', 'verify'))) {
exit('type is invalid');
}
$ret = array();
$other_logic = jlogic('other');
$func = 'get' . ucfirst($type) . 'Statistics';
if (method_exists($other_logic, $func)) {
$cache_id = 'misc/' . $type . '_statistics';
cache_file('rm', $cache_id);
if ($type == 'other') {
cache_file('rm', 'misc/data_length');
}
$ret = $other_logic->{$func}();
}
#生成html代码
$head_html = "<tr class='altbg1'>";
$body_html = "<tr class='altbg2'>";
if ($ret) {
foreach ($ret['data'] as $k => $v) {
$head_html .= "<td>{$v['name']}</td>";
$body_html .= "<td>{$v['num']}</td>";
}
}
$head_html .= "</tr>";
$body_html .= "</tr>";
echo $head_html . $body_html;
exit;
}
示例3: get_sub_menu
function get_sub_menu()
{
if (defined('IN_GET_SUB_MENU_FUNC')) {
return array();
}
define('IN_GET_SUB_MENU_FUNC', true);
if (!@(include_once ROOT_PATH . "./setting/admin_page_menu.php")) {
return false;
}
$mod = jget('mod', 'txt');
$code = jget('code', 'txt');
$admin_link2 = $admin_link = 'admin.php';
if ($mod) {
$admin_link .= '?mod=' . $mod;
if (empty($code) || 'index' == $code) {
$admin_link2 = $admin_link;
}
if ($code) {
$admin_link .= '&code=' . $code;
}
}
foreach ($menu_list as $menus) {
foreach ($menus as $k => $v) {
if (false !== strpos($v['link'], $admin_link) || $v['link'] == $admin_link2) {
$v['current'] = 1;
$menus[$k] = $v;
return $menus;
}
}
}
return false;
}
示例4: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->ID = jget('id', 'int');
$this->IDS = jget('ids');
$this->Execute();
}
示例5: Main
function Main()
{
if (MEMBER_ID < 1) {
response_text('登录后才能继续操作');
}
global $_J;
if (!isset($_J['plugins'])) {
jlogic('plugin')->loadplugincache();
}
$pluginid = jget('id');
if (!empty($pluginid)) {
list($identifier, $module) = explode(':', $pluginid);
$module = $module !== NULL ? $module : $identifier;
}
if (!is_array($_J['plugins']['hookmod']) || !array_key_exists($pluginid, $_J['plugins']['hookmod'])) {
response_text("插件不存在或已关闭");
}
if (empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $module)) {
response_text("未定义的操作");
}
if (@(!file_exists($modfile = PLUGIN_DIR . '/' . $identifier . '/' . $module . '.mod.php'))) {
response_text("插件模块文件(" . $modfile . ")不存在或者插件文件不完整");
}
if ($_J['plugins']['hookmod'][$pluginid]['role_id'] && 'admin' != MEMBER_ROLE_TYPE) {
response_text("您没有权限进行该操作");
}
include $modfile;
}
示例6: RewardDetail
function RewardDetail()
{
$rid = jget('rid', 'int');
$tid = jget('tid', 'int');
if (!$rid || !$tid) {
response_text('无效的有奖转发ID');
}
$reward = jlogic('reward')->getRewardInfo($rid);
if (!$reward) {
response_text('无效的有奖转发ID');
}
if ($reward['time_lesser'] > 0) {
$hours = $reward['time_lesser'] % 86400;
$day = floor($reward['time_lesser'] / 86400) ? floor($reward['time_lesser'] / 86400) . '天' : '';
$i = $hours % 3600;
$hours = floor($hours / 3600) ? floor($hours / 3600) . '时' : '';
$i = floor($i / 60) ? floor($i / 60) . '分' : '';
$reward['time_lesser'] = '距离转发结束还有 ' . $day . $hours . $i;
} else {
$reward['time_lesser'] = '有奖转发结束';
}
if ($reward['rules']['tag']) {
$content = '#' . implode('##', $reward['rules']['tag']) . '#';
}
include template('widget/widget_reward_view');
}
示例7: topic
function topic()
{
$id = jget('id', 'int');
$infos = jlogic('image')->get_uploadimg_byid($id);
$sql_wheres = array("item" => "`item` = 'topic_image'", "item_id" => "`item_id` = '" . $id . "'");
$this->_topic_list('new', $sql_wheres, $order, array(), array('imageinfo' => $infos[$id]));
}
示例8: fromJson
public function fromJson($json)
{
if (!empty($json)) {
parent::fromJson($json);
$this->PaymentId = jget($json, 'PaymentId');
$this->PaymentRequestId = jget($json, 'PaymentRequestId');
$this->Status = jget($json, 'Status');
$this->PaymentType = jget($json, 'PaymentType');
$this->FundingSource = jget($json, 'FundingSource');
$this->GuestCheckout = jget($json, 'GuestCheckout');
$this->CreatedAt = jget($json, 'CreatedAt');
$this->ValidUntil = jget($json, 'ValidUntil');
$this->CompletedAt = jget($json, 'CompletedAt');
$this->ReservedUntil = jget($json, 'ReservedUntil');
$this->Total = jget($json, 'Total');
$this->AllowedFundingSources = jget($json, 'AllowedFundingSources');
$this->RecurrenceResult = jget($json, 'RecurrenceResult');
$this->Transactions = array();
if (!empty($json['Transactions'])) {
foreach ($json['Transactions'] as $key => $value) {
$tr = new TransactionDetailModel();
$tr->fromJson($value);
array_push($this->Transactions, $tr);
}
}
}
}
示例9: Main
function Main()
{
$cids = jget('cids');
$id = jget('id');
if (is_array($cids)) {
foreach ($cids as $val) {
if ($val) {
$cid = $val;
}
}
} elseif ($id) {
$rowd = $this->CpLogic->Getrow($id, 'department');
$cid = $rowd['cid'];
$row = $this->CpLogic->Getrow($rowd['cid'], 'company');
if ($rowd['upid']) {
$ids = $rowd['upid'];
}
$cids = explode(',', $row['upid']);
if ($cids[0] > 0) {
$cids[] = $cid;
} else {
$cids[0] = $cid;
}
} else {
$cids = array(0);
$cid = 0;
}
if (@is_file(ROOT_PATH . 'include/logic/cp.logic.php') && $this->Config['company_enable'] && $this->Config['department_enable']) {
$selectco = '';
$i = 0;
foreach ($cids as $k => $v) {
$j = $k + 1;
if ($v || $i == 0) {
$company = $this->CpLogic->get_list_company($i, 'id ASC');
$selectco .= '<span id="nextcompany_' . $k . '"><select name="cids[]" onchange="listnextc(this,\'' . $j . '\');"><option value="">请选择...</option>';
foreach ($company as $val) {
if ($val['id'] == $v) {
$selectco .= '<option value="' . $val['id'] . '" selected>' . $val['name'] . '</option>';
} else {
$selectco .= '<option value="' . $val['id'] . '">' . $val['name'] . '</option>';
}
}
$selectco .= '</select></span>';
}
$i = $v;
}
if ($cid) {
$lists = $this->CpLogic->GetTable('department', 0, $cid);
} else {
$lists = '';
}
$action = '';
include template('admin/department');
} else {
if (!is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
$cp_not_install = true;
}
include template('admin/cp_ad');
}
}
示例10: delete
function delete()
{
$ip = jget('ip', 'txt');
if ($ip) {
jtable('failedlogins')->delete(array('ip' => $ip));
}
$this->Messager('操作成功', 'admin.php?mod=failedlogins&code=index');
}
示例11: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->TopicLogic = jlogic('topic');
$this->ID = jget('id', 'int');
$this->Member = $this->_member();
$this->Execute();
}
示例12: TopNotice
function TopNotice()
{
$type = jget('display', 'int', 'P');
if ($type) {
jsg_setcookie('topnotice', 'block');
} else {
jsg_setcookie('topnotice', 'none');
}
}
示例13: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->ID = jget('id', 'int');
$this->TopicLogic = jlogic('topic');
$this->CacheConfig = jconf::get('cache');
$this->ShowConfig = jconf::get('show');
$this->Execute();
}
示例14: del
function del()
{
$ids = jget('ids');
if ($ids) {
jlogic('feed')->delete_feed(array('ids' => $ids));
$this->Messager("删除成功", 'admin.php?mod=feed');
} else {
$this->Messager("请选择要删除的对象", 'admin.php?mod=feed');
}
}
示例15: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$this->ID = jget('id', 'int');
Mobile::logic('mblog');
$this->MblogLogic = new MblogLogic();
$this->CacheConfig = jconf::get('cache');
$this->ShowConfig = jconf::get('show');
Mobile::is_login();
$this->Execute();
}