本文整理汇总了PHP中jtable函数的典型用法代码示例。如果您正苦于以下问题:PHP jtable函数的具体用法?PHP jtable怎么用?PHP jtable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jtable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add($uid, $check = '')
{
$ret = false;
if ($GLOBALS['_J']['config']['sendmailday'] > 0) {
$user = array();
if (is_numeric($uid)) {
$user = jtable('members')->info($uid);
} elseif (is_array($uid)) {
$user = $uid;
}
if ($user && ($uid = (int) $user['uid']) > 0 && $user['email'] && 1 == $user['email_checked'] && (!$check || $check && 1 == $user[$check]) && TIMESTAMP - $user['lastactivity'] > 3600) {
if (1 == $user['user_notice_time']) {
$sendtime = TIMESTAMP;
} elseif (2 == $user['user_notice_time']) {
$sendtime = TIMESTAMP + 86400;
} elseif (4 == $user['user_notice_time']) {
$sendtime = TIMESTAMP + 86400 * 30;
} else {
$sendtime = TIMESTAMP + 86400 * 7;
}
$data = array('dateline' => $sendtime, 'uid' => $uid, 'email' => $user['email'], 'msg' => serialize(array('comment_new' => $user['comment_new'], 'newpm' => $user['newpm'], 'event_new' => $user['event_new'], 'at_new' => $user['at_new'], 'fans_new' => $user['fans_new'], 'vote_new' => $user['vote_new'], 'dig_new' => $user['dig_new'], 'channel_new' => $user['channel_new'], 'company_new' => $user['company_new'], 'qun_new' => $user['qun_new'])));
$row = $this->row($uid);
if (!$row) {
$ret = $this->insert($data, true, true);
} else {
if ($row['dateline'] > 0) {
unset($data['dateline']);
}
$ret = $this->update($data, array('uid' => $uid));
}
}
}
return $ret;
}
示例2: DoClean
function DoClean()
{
$type = get_param('type');
if (!$type) {
$this->Messager("请先选择要清理的缓存对象");
}
$this->_removeTopicAttach();
$this->_removeTopicLongtext();
$this->_removeVoteImage();
if (in_array('data', $type)) {
cache_db('clear');
jtable('failedlogins')->truncate();
DB::query("update " . TABLE_PREFIX . "members set `username`=`uid` WHERE `username`!=`uid` AND `username` REGEXP '^[0-9]*\$'");
}
if (in_array('tpl', $type)) {
cache_clear();
jconf::set('validate_category', array());
jlogic('credits')->rule_conf(true);
}
if (in_array('channel', $type)) {
jlogic('channel')->update_data();
}
if (in_array('album', $type)) {
jlogic('image')->update_data();
}
$this->Messager("已清空所有缓存");
}
示例3: my_member_validate
function my_member_validate($uid, $email, $role_id = '', $new = 0, $check_allow = 1)
{
if (1 > ($uid = (int) $uid)) {
return false;
}
if (!($email = trim($email))) {
return false;
}
$sys_config = jconf::get();
if ($new == 0 && !$sys_config['reg_email_verify']) {
return false;
}
if ($check_allow && jdisallow($uid)) {
return false;
}
$sql = "select * from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}' order by `regdate` asc";
$query = DB::query($sql);
$data = array();
if (DB::num_rows($query) > 0) {
DB::query("delete from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}'");
}
$data['uid'] = $uid;
$data['email'] = $email;
$data['role_id'] = (int) ($role_id > 0 ? $role_id : $sys_config['normal_default_role_id']);
$data['key'] = substr(md5(md5($uid . $email . $role_id) . md5(uniqid(mt_rand(), true))), 3, 16);
$data['status'] = $data['verify_time'] = '0';
$data['regdate'] = TIMESTAMP;
$data['type'] = 'email';
jtable('member_validate')->insert($data);
$email_message = "您好:\r\n您收到此邮件是因为在 {$sys_config['site_url']} 用户注册中使用了该 Email,\r\n如果您没有进行上述操作,请忽略这封邮件。\r\n------------------------------------------------------\r\n帐号激活说明:\r\n为避免垃圾邮件或您的Email地址被滥用,我们需要对您的email有效性进行验证,\r\n您只需点击下面的链接即可激活您的帐号,并享有真正会员权限:\r\n{$sys_config['site_url']}/index.php?mod=member&code=verify&uid={$data['uid']}&key={$data['key']}&from=reg\r\n\r\n(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)\r\n感谢您的访问,祝您使用愉快!\r\n\r\n此致,\r\n{$sys_config['site_name']} 管理团队.\r\n";
$send_result = send_mail($email, " [{$sys_config['site_name']}]Email地址验证", $email_message, $sys_config['site_name'], $sys_config['site_admin_email'], array(), 3, false);
return $send_result;
}
示例4: do_bind
public function do_bind($openid, $jsg_id = MEMBER_ID)
{
if (!$jsg_id) {
return FALSE;
}
jtable('wechat')->delete(array('wechat_id' => $openid));
jtable('wechat')->delete(array('jsg_id' => $jsg_id));
$r = jtable('wechat')->insert(array('wechat_id' => $openid, 'jsg_id' => $jsg_id, 'dateline' => TIMESTAMP), 1);
return $r;
}
示例5: delMailQueue
function delMailQueue()
{
$ids = jget('ids');
if ($ids && is_array($ids)) {
$list = jtable('mailqueue')->get($ids);
foreach ($list as $row) {
jtable('mailqueue')->delete(array('uid' => $row['uid']));
}
}
$this->Messager('操作成功', 'admin.php?mod=notice&code=mailq');
}
示例6: Reg
function Reg()
{
$uid = max(0, (int) $this->Inputs['uid']);
$token = $this->Inputs['token'];
if ($uid > 0 && strlen($token) == 64 && ctype_alnum($token)) {
$info = jtable('ios')->info(array('token' => $token));
if (!$info) {
jtable('ios')->insert(array('uid' => $uid, 'token' => $token), 1);
} elseif ($uid != $info['uid']) {
jtable("ios")->update(array('uid' => $uid), $info['id']);
}
}
}
示例7: add
function add($tid, $uid)
{
$ret = false;
$tid = jfilter($tid, 'int');
$uid = jfilter($uid, 'int');
if ($tid > 0 && $uid > 0 && !$this->is_at($tid, $uid) && ($row = jtable('topic')->row($tid)) && $uid != $row['uid']) {
$ret = $this->insert(array('tid' => $tid, 'uid' => $uid, 'tuid' => $row['uid'], 'dateline' => TIMESTAMP), 1);
if ($ret) {
$this->cache_rm(array('tid' => $tid, 'uid' => $uid));
jtable('members')->update_count($uid, 'at_new', '+1', array('+@at_count' => 1));
}
}
return $ret;
}
示例8: notice_index
function notice_index()
{
$this->Title = '网站公告';
$id = jget('id', 'int');
if ($id < 1) {
$id = jget('ids', 'int');
if ($id < 1) {
$id = jget('code', 'int');
}
}
if ($id > 0) {
$notice_info = jtable('notice')->info($id);
$this->Title .= ' - ' . $notice_info['title'];
}
$notice_data = jtable('notice')->get_data();
include template('notice_index');
}
示例9: add_order
public function add_order($data)
{
$data['uid'] = MEMBER_ID;
$data['username'] = MEMBER_NICKNAME;
$data['sn'] = TIMESTAMP . mt_rand(1, 9999);
$config = jconf::get('mall');
$id = jtable('mall_order')->insert($data, 1);
if ($id) {
jtable('mall_goods')->update_count(array('id' => $data['goods_id']), 'seal_count', '+' . $data['goods_num']);
jtable('mall_goods')->update_count(array('id' => $data['goods_id']), 'order_count', '+' . $data['goods_num']);
jtable('mall_goods')->update_count(array('id' => $data['goods_id']), 'total', '-' . $data['goods_num']);
update_credits_by_action('convert', $data['uid'], 1, -$data['pay_credit']);
$feed_msg = cut_str($data['goods_name'], 30, '');
feed_msg('mall', 'exchange', $data['goods_id'], $feed_msg, 0);
}
return $id;
}
示例10: exchangegoods
function exchangegoods()
{
$this->Title = '积分兑换记录';
$pagenum = 10;
$css['exchange'] = $css['exp'] = ' class="current"';
$data = jtable('mall_order')->get(array('uid' => MEMBER_ID, 'sql_order' => 'id desc', 'page_num' => $pagenum));
$page = $data['page']['html'];
$data = $data['list'];
foreach ($data as $key => $value) {
$data[$key]['pay_time'] = $value['pay_time'] > 0 ? my_date_format($value['pay_time']) : '-';
$data[$key]['xaddress'] = strlen($value['address']) > 26 ? cut_str($value['address'], 15) : $value['address'];
}
$feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
$top_credit_members = jlogic('mall')->get_top_member_credits();
$config = jconf::get('mall');
include template('mall_exchangegoods');
}
示例11: act
public function act($uid = 0, $tid = 0, $act = '')
{
$uid = is_numeric($uid) ? (int) $uid : 0;
if (jdisallow($uid)) {
return "您无权进行此操作";
}
$tid = is_numeric($tid) ? (int) $tid : 0;
if ($tid < 1) {
return "请指定一个微博";
}
$topic_info = jtable('topic')->info($tid);
if (!$topic_info) {
return "指定的微博已经不存在了";
}
$infop = array('uid' => $uid, 'tid' => $tid);
$topic_favorite = $this->db->info($infop);
$is_favorite = $topic_favorite ? true : false;
if ('check' == $act) {
return $is_favorite ? 1 : 0;
}
if ('info' == $act) {
return $topic_favorite;
}
$ret = '';
if (in_array($act, array('add', 'del', 'delete'))) {
if ('add' == $act) {
if (!$is_favorite) {
$this->db->insert(array('uid' => $uid, 'tid' => $tid, 'tuid' => $topic_info['uid'], 'dateline' => TIMESTAMP));
jtable('members')->update_count($topic_info['uid'], 'favoritemy_new', '+1');
if ($GLOBALS['_J']['config']['feed_type'] && is_array($GLOBALS['_J']['config']['feed_type']) && in_array('favorite', $GLOBALS['_J']['config']['feed_type']) && $GLOBALS['_J']['config']['feed_user'] && is_array($GLOBALS['_J']['config']['feed_user']) && array_key_exists(MEMBER_ID, $GLOBALS['_J']['config']['feed_user'])) {
$feed_msg = cut_str($topic_info['content'], 30, '');
feed_msg('leader', 'favorite', $tid, $feed_msg, $topic_info['item_id']);
}
}
$ret = "<span><a href='javascript:void(0)'>已收藏</a></span>";
} else {
if ($is_favorite) {
$this->db->delete($infop);
}
$ret = "已取消";
}
jtable('members')->update_count($uid, 'topic_favorite_count', $this->db->count(array('uid' => $uid)));
}
return $ret;
}
示例12: qun_announcement_index
function qun_announcement_index()
{
$this->Title = $this->Config['changeword']['weiqun'] . '公告';
$qid = jget('qid', 'int');
$id = jget('id', 'int');
if ($id < 1) {
$id = jget('ids', 'int');
if ($id < 1) {
$id = jget('code', 'int');
}
}
if ($id > 0) {
$qun_announcement_info = jtable('qun_announcement')->info($id);
$author_member = jsg_member_info($qun_announcement_info['author_id']);
$this->Title .= ' - ' . cutstr(trim(strip_tags($qun_announcement_info['message'])), 30);
}
include template('qun/qun_announcement_index');
}
示例13: DoModify
function DoModify()
{
if (($new_module = trim($this->Post['new_module'])) && trim($new_module_name = $this->Post['new_module_name'])) {
jtable('role_module')->replace(array("module" => $new_module, "name" => $new_module_name));
}
$module_list = (array) $this->Post['module'];
foreach ($module_list as $module) {
jtable('role_module')->replace($module);
}
$delete_list = (array) $this->Post['delete'];
if ($delete_list) {
$module_in = " `module` IN (" . jimplode($delete_list) . ") ";
DB::query("DELETE FROM " . TABLE_PREFIX . "role_module where " . $module_in);
$sql = "DELETE FROM " . TABLE_PREFIX . "role_action where " . $module_in;
$this->DatabaseHandler->Query($sql);
}
$this->Messager("修改成功");
}
示例14: Topic
function Topic()
{
if (MEMBER_ID < 1) {
response_text('您是游客,没有权限举报');
}
$tid = jget('totid', 'int', 'P');
$report_reason = $this->Post['report_reason'];
$report_content = $this->Post['report_content'];
$data = array('uid' => MEMBER_ID, 'username' => MEMBER_NICKNAME, 'ip' => $GLOBALS['_J']['client_ip'], 'reason' => (int) $report_reason, 'content' => strip_tags($report_content), 'tid' => (int) $tid, 'dateline' => time());
$result = jtable('report')->insert($data);
if ($notice_to_admin = $this->Config['notice_to_admin']) {
$message = "用户" . MEMBER_NICKNAME . "举报了微博ID:{$tid}(" . $data['content'] . "),<a href='admin.php?mod=report&code=report_manage' target='_blank'>点击</a>进入管理。";
$pm_post = array('message' => $message, 'to_user' => str_replace('|', ',', $notice_to_admin));
$admin_info = DB::fetch_first('select `uid`,`username`,`nickname` from `' . TABLE_PREFIX . 'members` where `uid` = 1');
load::logic('pm');
$PmLogic = new PmLogic();
$PmLogic->pmSend($pm_post, $admin_info['uid'], $admin_info['username'], $admin_info['nickname']);
}
response_text('举报成功');
}
示例15: Notice_email
function Notice_email($touid = 0)
{
$touid = max(0, (int) $touid);
$timestamp = time();
$sql = "select `uid`,`email`,`notice_at`,`notice_pm`,`notice_reply`,`user_notice_time`,`last_notice_time` from `" . TABLE_PREFIX . "members` where `uid` = '{$touid}'";
$query = $this->DatabaseHandler->Query($sql);
$members = $query->GetRow();
$sql = "select * from `" . TABLE_PREFIX . "cron` where `touid` = '{$touid}'";
$query = $this->DatabaseHandler->Query($sql);
$crons = $query->GetRow();
if ($members['user_notice_time'] == 0) {
Load::logic('task');
$TaskLogic = new TaskLogic();
$TaskLogic->run($id = 1);
}
if ($send_return) {
jtable('members')->update_count($touid, 'last_notice_time', $timestamp);
$sql = "delete from `" . TABLE_PREFIX . "cron` where `id`= '{$crons['id']}' ";
$this->DatabaseHandler->Query($sql);
}
}