本文整理汇总了PHP中hookscript函数的典型用法代码示例。如果您正苦于以下问题:PHP hookscript函数的具体用法?PHP hookscript怎么用?PHP hookscript使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hookscript函数的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: build_cache_userstats
function build_cache_userstats()
{
global $_G;
$totalmembers = C::t('common_member')->count();
$member = C::t('common_member')->range(0, 1, 'DESC');
$member = current($member);
$newsetuser = $member['username'];
$data = array('totalmembers' => $totalmembers, 'newsetuser' => $newsetuser);
if ($_G['setting']['plugins']['func'][HOOKTYPE]['cacheuserstats']) {
$_G['userstatdata'] =& $data;
hookscript('cacheuserstats', 'global', 'funcs', array(), 'cacheuserstats');
}
savecache('userstats', $data);
}
示例3: deletethread
function deletethread($tids, $membercount = false, $credit = false, $ponly = false)
{
global $_G;
if ($_G['setting']['plugins'][HOOKTYPE . '_deletethread']) {
$_G['deletethreadtids'] =& $tids;
$hookparam = func_get_args();
hookscript('deletethread', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'deletethread');
}
if (!$tids) {
return 0;
}
require_once libfile('function/forum');
foreach ($tids as $tid) {
my_post_log('delete', array('tid' => $tid));
}
$count = count($tids);
$tids = dimplode($tids);
loadcache(array('threadtableids', 'posttableids'));
$threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array();
$posttableids = !empty($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array('0');
if (!in_array(0, $threadtableids)) {
$threadtableids = array_merge(array(0), $threadtableids);
}
DB::delete('common_moderate', "id IN ({$tids}) AND idtype='tid'");
$atids = $fids = $postids = $threadtables = array();
foreach ($threadtableids as $tableid) {
$threadtable = !$tableid ? "forum_thread" : "forum_thread_{$tableid}";
$query = DB::query("SELECT cover, tid, fid, posttableid FROM " . DB::table($threadtable) . " WHERE tid IN ({$tids})");
while ($row = DB::fetch($query)) {
$atids[] = $row['tid'];
$row['posttableid'] = !empty($row['posttableid']) && in_array($row['posttableid'], $posttableids) ? $row['posttableid'] : '0';
$postids[$row['posttableid']][$row['tid']] = $row['tid'];
if ($tableid) {
$fids[$row['fid']][] = $tableid;
}
}
if (!$tableid && !$ponly) {
$threadtables[] = $threadtable;
}
}
if ($credit || $membercount) {
$losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0;
$postlist = $uidarray = $tuidarray = $ruidarray = array();
foreach ($postids as $posttableid => $posttabletids) {
$query = DB::query('SELECT tid, first, authorid, dateline, replycredit, invisible FROM ' . DB::table(getposttable($posttableid)) . ' WHERE tid IN (' . dimplode($posttabletids) . ')');
while ($post = DB::fetch($query)) {
if ($post['invisible'] != -1 && $post['invisible'] != -5) {
$postlist[] = $post;
}
}
}
$query = DB::query("SELECT tid, extcreditstype FROM " . DB::table('forum_replycredit') . " WHERE tid IN ({$tids})");
while ($rule = DB::fetch($query)) {
$rule['extcreditstype'] = $rule['extcreditstype'] ? $rule['extcreditstype'] : $_G['setting']['creditstransextra'][10];
$replycredit_rule[$rule['tid']] = $rule;
}
foreach ($postlist as $post) {
if ($post['dateline'] < $losslessdel) {
if ($membercount) {
if ($post['first']) {
updatemembercount($post['authorid'], array('threads' => -1, 'post' => -1), false);
} else {
updatemembercount($post['authorid'], array('posts' => -1), false);
}
}
} else {
if ($credit) {
if ($post['first']) {
$tuidarray[] = $post['authorid'];
} else {
$ruidarray[] = $post['authorid'];
}
}
}
if ($credit || $membercount) {
if ($post['authorid'] > 0 && $post['replycredit'] > 0) {
if ($replycredit_rule[$post['tid']]['extcreditstype']) {
updatemembercount($post['authorid'], array($replycredit_rule[$post['tid']]['extcreditstype'] => (int) ('-' . $post['replycredit'])));
}
}
}
}
if ($credit) {
if ($tuidarray || $ruidarray) {
require_once libfile('function/post');
}
if ($tuidarray) {
updatepostcredits('-', $tuidarray, 'post', $_G['forum']['fid']);
}
if ($ruidarray) {
updatepostcredits('-', $ruidarray, 'reply', $_G['forum']['fid']);
}
$auidarray = $attachtables = array();
foreach ($atids as $tid) {
$attachtables[getattachtablebytid($tid)][] = $tid;
}
foreach ($attachtables as $attachtable => $attachtids) {
$query = DB::query("SELECT uid, dateline FROM " . DB::table($attachtable) . " WHERE tid IN (" . dimplode($attachtids) . ")");
while ($attach = DB::fetch($query)) {
if ($attach['dateline'] > $losslessdel) {
//.........这里部分代码省略.........
示例4: getmenu
function getmenu($brandresult, $active)
{
global $_G, $template, $bodycss, $ishideheader, $allurl;
$group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
global $myhomeurl, $referer, $addgroup;
$tmpconfig = $_G['cache']['plugin']['sanree_brand'];
$allowsyngroup = intval($tmpconfig['allowsyngroup']);
$isshowordinary = intval($tmpconfig['isshowordinary']);
!defined('sr_brand_JS') && define('sr_brand_JS', sr_brand_TPL . '/' . $tmpconfig['template'] . '/js');
!defined('SANREE_BRAND_TEMPLATE') && define('SANREE_BRAND_TEMPLATE', sr_brand_TPL . '/' . $tmpconfig['template']);
$allurl = gethomeurl();
$myhomeurl = !empty($brandresult['brandno']) ? getbrandnourl($brandresult['brandno']) : getmyburl_by_bid($brandresult['bid']);
$referer = urlencode($myhomeurl);
if (!isset($_G['cache']['sanree_brand_topmenu']) || !is_array($_G['cache']['sanree_brand_topmenu'])) {
sanreeupdatecache('menu');
}
$menu = sanreeloadcache('topmenu');
$headermenulist = array();
$headermenulist['index'] = array('url' => getburl($brandresult), 'title' => srlang('brandindex'), 'class' => ' class="normal"');
$brandresult['allowalbum'] == 1 && ($headermenulist['myalbum'] = array('url' => getalbumurl($brandresult['bid']), 'title' => srlang('myalbum'), 'class' => ' class="normal"'));
$allowsyngroup == 1 && intval($group['allowsyngroup']) == 1 && $brandresult['syngrouptid'] && ($headermenulist['dzgroup'] = array('url' => 'forum.php?mod=group&fid=' . $brandresult['syngrouptid'], 'title' => srlang('dzgroup'), 'class' => ' class="normal"'));
hookscript('sanreebrandusermenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandusermenu');
if ($_G['sanree_brand_menus']) {
foreach ($_G['sanree_brand_menus'] as $row) {
$row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
$row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
$row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
$headermenulist[$row['name']] = $row;
}
}
$isshowordinary == 1 && ($headermenulist['ordinary'] = array('url' => 'forum.php?mod=viewthread&tid=' . $brandresult['tid'], 'title' => srlang('ordinary'), 'class' => ' class="normal"'));
foreach ($menu as $row) {
$row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
$row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
$row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
$headermenulist['menu' . $row[id]] = $row;
}
$headermenulist[$active] && ($headermenulist[$active]['class'] = ' class="active"');
$headermenulists = $headermenulist;
$headermenulist = array();
$menuorder = C::t('#sanree_brand#sanree_brand_menu_order')->fetch_all();
asort($menuorder);
foreach ($menuorder as $key => $row) {
if ($headermenulists[$key]) {
$headermenulist[$key] = $headermenulists[$key];
}
}
if (intval($_G['uid']) === intval($brandresult['uid'])) {
define('IN_BRAND_USER', TRUE);
hookscript('sanreebrandmanagemenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandmanagemenu');
$managemenulist = array();
$_G['sanree_brand_managemenus'][] = array('displayorder' => 9999, 'window' => 0, 'name' => '', 'title' => '', 'url' => '', 'class' => '', 'image' => 'source/plugin/sanree_brand/tpl/good/images/add.png');
if ($_G['sanree_brand_managemenus']) {
foreach ($_G['sanree_brand_managemenus'] as $row) {
$row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
$row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
$row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
$managemenulist[] = $row;
}
$ncount = count($managemenulist);
$mod = $ncount % 10;
$mt = intval($ncount / 10);
$oneh = 100;
if ($mt == 0) {
$ih = $oneh;
} else {
if ($mod == 0) {
$ih = $mt * $oneh;
} else {
$ih = ($mt + 1) * $oneh;
}
}
$ih += 10;
$managemenulist = $this->array_sort($managemenulist, 'displayorder');
}
}
$allowtemplate = intval($group['allowtemplate']);
if ($allowtemplate == 1) {
$templateconfig = unserialize($brandresult['templateconfig']);
$bodystyle = $templateconfig['bodystyle'];
$bodycss = '';
if ($bodystyle) {
if (intval($bodystyle['isuse']) == 1) {
$bodycss = "body {\r\n";
if ($bodystyle['notbackimg'] == 1) {
if (!empty($bodystyle['backgroundimage'])) {
$bodycss .= "background-image:url('" . $_G['setting']['attachurl'] . 'category/' . "{$bodystyle['backgroundimage']}');\r\n";
}
} else {
$bodycss .= "background:none;\r\n";
}
if (!empty($bodystyle['backgroundrepeat'])) {
$bodycss .= "background-repeat:{$bodystyle['backgroundrepeat']};\r\n";
}
if (!empty($bodystyle['backgroundcolor'])) {
$bodycss .= "background-color:{$bodystyle['backgroundcolor']};\r\n";
}
if (!empty($bodystyle['backgroundattachment'])) {
$bodycss .= "background-attachment:{$bodystyle['backgroundattachment']};\r\n";
}
//.........这里部分代码省略.........
示例5: delete
function delete($ids)
{
$ids = (array) $ids;
$admin_list = array();
$member_ids = array();
$query = DB::query("select * from " . DB::table('members') . " where `uid` in ('" . implode("','", $ids) . "')");
while (false != ($row = DB::fetch($query))) {
$uid = $row['uid'];
if (jsg_member_is_founder($uid) || 'admin' == $row['role_type']) {
$admin_list[$uid] = $row['nickname'];
} else {
$member_ids[$uid] = $uid;
if (true === UCENTER && $row['ucuid'] > 0) {
uc_user_delete($row['ucuid']);
}
}
#if NEDU
if (defined('NEDU_MOYO')) {
ndata('sync')->member()->delete($uid);
}
#endif
if ($GLOBALS['_J']['config']['company_enable'] && @is_file(ROOT_PATH . 'include/logic/cp.logic.php') && $row['companyid'] > 0) {
$CpLogic = jlogic('cp');
$CpLogic->update('company', $row['companyid'], -1, -$row['topic_count']);
if ($GLOBALS['_J']['config']['department_enable'] && $row['departmentid'] > 0) {
$CpLogic->update('department', $row['departmentid'], -1, -$row['topic_count']);
}
$cp_companys = $CpLogic->get_cp_users($row['uid']);
if ($cp_companys) {
foreach ($cp_companys as $val) {
$CpLogic->update('company', $val['companyid'], -1, 0);
if ($GLOBALS['_J']['config']['department_enable'] && $val['departmentid'] > 0) {
$CpLogic->update('department', $val['departmentid'], -1, 0);
}
}
}
}
}
$member_ids_count = count($member_ids);
if ($member_ids_count > 0) {
$member_ids_in = jimplode($member_ids);
jlogic('buddy')->del_user($member_ids);
jlogic('topic')->DeleteToBox(" where `uid` in ({$member_ids_in}) limit 999999999 ");
jlogic('topic')->Delete(" where `uid` in ({$member_ids_in}) limit 999999999 ");
$tbs = array('blacklist' => array('uid', 'touid'), 'credits_log' => 'uid', 'credits_rule_log' => 'uid', 'cron' => 'touid', 'event' => 'postman', 'event_favorite' => 'uid', 'event_member' => 'fid', 'group' => 'uid', 'groupfields' => 'uid', 'imjiqiren_client_user' => 'uid', 'invite' => array('uid', 'fuid'), 'ios' => 'uid', 'item_sms' => 'uid', 'item_user' => 'uid', 'kaixin_bind_info' => 'uid', 'log' => 'uid', 'mailqueue' => 'uid', 'mall_order' => 'uid', 'mall_order_action' => 'uid', 'medal_apply' => 'uid', 'member_notice' => 'uid', 'member_relation' => 'touid', 'member_topic' => 'uid', 'member_validate' => 'uid', 'members_profile' => 'uid', 'members_verify' => 'uid', 'members_vest' => array('uid', 'useruid'), 'my_tag' => 'user_id', 'my_topic_tag' => 'user_id', 'pms' => array('msgfromid', 'msgtoid'), 'qqwb_bind_info' => 'uid', 'qun' => 'founderuid', 'qun_apply' => 'uid', 'qun_user' => 'uid', 'renren_bind_info' => 'uid', 'report' => 'uid', 'reward' => 'uid', 'reward_image' => 'uid', 'reward_user' => 'uid', 'reward_win_user' => 'uid', 'schedule' => 'uid', 'sessions' => 'uid', 'sms_client_user' => 'uid', 'sms_receive_log' => 'uid', 'sms_send_log' => 'uid', 'tag_favorite' => 'uid', 'task_log' => 'uid', 'topic' => 'uid', 'topic_favorite' => 'uid', 'topic_image' => 'uid', 'topic_attach' => 'uid', 'topic_longtext' => 'uid', 'topic_mention' => 'uid', 'topic_music' => 'uid', 'topic_show' => 'uid', 'topic_video' => 'uid', 'user_medal' => 'uid', 'user_tag_fields' => 'uid', 'validate_category_fields' => 'uid', 'vote' => 'uid', 'vote_user' => 'uid', 'wall' => 'uid', 'xwb_bind_info' => 'uid', 'yy_bind_info' => 'uid', 'topic_dig' => array('uid', 'touid'), 'buddy_channel' => 'uid', 'buddy_department' => 'uid', 'bulletin' => 'uid', 'topic_live' => 'uid', 'topic_talk' => array('uid', 'touid'), 'topic_channel' => 'uid', 'memberfields' => 'uid', 'members' => 'uid');
foreach ($tbs as $k => $vs) {
$vs = (array) $vs;
foreach ($vs as $v) {
DB::query("delete from `" . TABLE_PREFIX . "{$k}` where `{$v}` in ({$member_ids_in})", "SKIP_ERROR");
}
}
}
$rets = array('admin_list' => $admin_list, 'member_ids' => $member_ids, 'member_ids_count' => $member_ids_count);
if ($GLOBALS['_J']['plugins']['func']['deletemember']) {
hookscript('deletemember', 'funcs', is_array($member_ids) ? $member_ids : array($member_ids), 'deletemember');
}
return $rets;
}
示例6: threadpubsave
function threadpubsave($tid, $passapproval = false)
{
global $_G;
if ($_G['setting']['plugins']['func'][HOOKTYPE]['threadpubsave']) {
$hookparam = func_get_args();
hookscript('threadpubsave', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'threadpubsave');
}
$thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, -4, '=', !$passapproval ? $_G['uid'] : null);
if (!$thread) {
return 0;
}
$threadpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid);
$thread['message'] = $threadpost['message'];
$modworksql = 0;
$displayorder = 0;
$dateline = $_G['timestamp'];
$moderatepids = $saveposts = array();
$return = 1;
list($modnewthreads) = threadmodstatus($thread['subject'] . "\t" . $thread['message']);
if ($modnewthreads && $passapproval === false) {
updatemoderate('tid', $tid);
manage_addnotify('verifythread');
$displayorder = -2;
$modworksql = 1;
$return = -1;
} else {
C::t('forum_post')->update_by_tid('tid:' . $tid, $tid, array('dateline' => $dateline, 'invisible' => '0'), false, false, 1);
}
C::t('forum_thread')->update($tid, array('displayorder' => $displayorder, 'dateline' => $_G['timestamp'], 'lastpost' => $_G['timestamp']));
$posts = $thread['replies'] + 1;
if ($thread['replies']) {
$saveposts = C::t('forum_post')->fetch_all_by_tid('tid:' . $tid, $tid, true, '', 0, 0, 0);
foreach ($saveposts as $post) {
$dateline++;
$invisible = 0;
list(, $modnewreplies) = threadmodstatus($post['subject'] . "\t" . $post['message']);
if ($modnewreplies) {
$moderatepids[] = $post['pid'];
$verifypost = true;
$invisible = -2;
$modworksql = 1;
$return = -2;
}
C::t('forum_post')->update('tid:' . $tid, $post['pid'], array('dateline' => $dateline, 'invisible' => $invisible));
updatepostcredits('+', $thread['authorid'], 'reply', $thread['fid']);
}
}
if ($moderatepids) {
updatemoderate('pid', $moderatepids);
manage_addnotify('verifypost');
}
updatepostcredits('+', $thread['authorid'], 'post', $thread['fid']);
$attachcount = C::t('forum_attachment_n')->count_by_id('tid:' . $thread['tid'], 'tid', $thread['tid']);
updatecreditbyaction('postattach', $thread['authorid'], array(), '', $attachcount, 1, $thread['fid']);
if ($_G['forum']['status'] == 3) {
C::t('forum_groupuser')->update_counter_for_user($thread['authorid'], $thread['fid'], 1);
}
$subject = str_replace("\t", ' ', $thread['subject']);
$lastpost = $thread['tid'] . "\t" . $subject . "\t" . $thread['lastpost'] . "\t" . $thread['lastposter'];
C::t('forum_forum')->update($_G['fid'], array('lastpost' => $lastpost));
C::t('forum_forum')->update_forum_counter($thread['fid'], 1, $posts, $posts, $modworksql);
if ($_G['forum']['type'] == 'sub') {
C::t('forum_forum')->update($_G['forum']['fup'], array('lastpost' => $lastpost));
}
if ($_G['setting']['plugins']['func'][HOOKTYPE]['threadpubsave']) {
hookscript('threadpubsave', 'global', 'funcs', array('param' => $hookparam, 'step' => 'save', 'posts' => $saveposts), 'threadpubsave');
}
return $return;
}
示例7: deletethread
function deletethread($tids, $membercount = false, $credit = false, $ponly = false)
{
global $_G;
if ($_G['setting']['plugins']['func'][HOOKTYPE]['deletethread']) {
$_G['deletethreadtids'] =& $tids;
$hookparam = func_get_args();
hookscript('deletethread', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'deletethread');
}
if (!$tids) {
return 0;
}
$count = count($tids);
$arrtids = $tids;
$tids = dimplode($tids);
loadcache(array('threadtableids', 'posttableids'));
$threadtableids = !empty($_G['cache']['threadtableids']) ? $_G['cache']['threadtableids'] : array();
$posttableids = !empty($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array('0');
if (!in_array(0, $threadtableids)) {
$threadtableids = array_merge(array(0), $threadtableids);
}
C::t('common_moderate')->delete($arrtids, 'tid');
C::t('forum_threadclosed')->delete($arrtids);
$cachefids = $atids = $fids = $postids = $threadtables = array();
foreach ($threadtableids as $tableid) {
foreach (C::t('forum_thread')->fetch_all_by_tid($arrtids, 0, 0, $tableid) as $row) {
$atids[] = $row['tid'];
$row['posttableid'] = !empty($row['posttableid']) && in_array($row['posttableid'], $posttableids) ? $row['posttableid'] : '0';
$postids[$row['posttableid']][$row['tid']] = $row['tid'];
if ($tableid) {
$fids[$row['fid']][] = $tableid;
}
$cachefids[$row['fid']] = $row['fid'];
}
if (!$tableid && !$ponly) {
$threadtables[] = $tableid;
}
}
if ($credit || $membercount) {
$losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0;
$postlist = $uidarray = $tuidarray = $ruidarray = array();
foreach ($postids as $posttableid => $posttabletids) {
foreach (C::t('forum_post')->fetch_all_by_tid($posttableid, $posttabletids, false) as $post) {
if ($post['invisible'] != -1 && $post['invisible'] != -5) {
$postlist[] = $post;
}
}
}
foreach (C::t('forum_replycredit')->fetch_all($arrtids) as $rule) {
$rule['extcreditstype'] = $rule['extcreditstype'] ? $rule['extcreditstype'] : $_G['setting']['creditstransextra'][10];
$replycredit_rule[$rule['tid']] = $rule;
}
foreach ($postlist as $post) {
if ($post['dateline'] < $losslessdel) {
if ($membercount) {
if ($post['first']) {
updatemembercount($post['authorid'], array('threads' => -1, 'post' => -1), false);
} else {
updatemembercount($post['authorid'], array('posts' => -1), false);
}
}
} else {
if ($credit) {
if ($post['first']) {
$tuidarray[$post['fid']][] = $post['authorid'];
} else {
$ruidarray[$post['fid']][] = $post['authorid'];
}
}
}
if ($credit || $membercount) {
if ($post['authorid'] > 0 && $post['replycredit'] > 0) {
if ($replycredit_rule[$post['tid']]['extcreditstype']) {
updatemembercount($post['authorid'], array($replycredit_rule[$post['tid']]['extcreditstype'] => (int) ('-' . $post['replycredit'])));
}
}
}
}
if ($credit) {
if ($tuidarray || $ruidarray) {
require_once libfile('function/post');
}
if ($tuidarray) {
foreach ($tuidarray as $fid => $tuids) {
updatepostcredits('-', $tuids, 'post', $fid);
}
}
if ($ruidarray) {
foreach ($ruidarray as $fid => $ruids) {
updatepostcredits('-', $ruids, 'reply', $fid);
}
}
$auidarray = $attachtables = array();
foreach ($atids as $tid) {
$attachtables[getattachtableid($tid)][] = $tid;
}
foreach ($attachtables as $attachtable => $attachtids) {
foreach (C::t('forum_attachment_n')->fetch_all_by_id($attachtable, 'tid', $attachtids) as $attach) {
if ($attach['dateline'] > $losslessdel) {
$auidarray[$attach['uid']] = !empty($auidarray[$attach['uid']]) ? $auidarray[$attach['uid']] + 1 : 1;
}
//.........这里部分代码省略.........
示例8: intval
$closedreason = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='closedreason'");
showmessage($closedreason ? $closedreason : 'board_closed', NULL, 'NOPERM');
}
periodscheck('visitbanperiods');
}
if((!empty($fromuid) || !empty($fromuser)) && ($creditspolicy['promotion_visit'] || $creditspolicy['promotion_register'])) {
require_once DISCUZ_ROOT.'/include/promotion.inc.php';
}
if($uchome['addfeed']) {
$customaddfeed = $customaddfeed == '-1' ? 0 : ($customaddfeed == 0 ? $uchome['addfeed'] : intval($customaddfeed));
} else {
$customaddfeed = 0;
}
$rssauth = $rssstatus && $discuz_uid ? rawurlencode(authcode("$discuz_uid\t".($fid ? $fid : '')."\t".substr(md5($discuz_pw.$discuz_secques), 0, 8), 'ENCODE', md5($_DCACHE['settings']['authkey']))) : '0';
$transferstatus = $transferstatus && $allowtransfer;
$feedpostnum = $feedpostnum && $uchomeurl ? intval($feedpostnum) : 0;
$pluginhooks = array();
if(isset($hookscript[CURSCRIPT]['module'])) {
hookscript(CURSCRIPT);
}
if($discuz_uid && $newbietaskupdate && $lastactivity < $newbietaskupdate) {
require_once DISCUZ_ROOT.'./include/task.func.php';
task_newfunction_autoapply();
}
?>
示例9: hookscriptoutput
function hookscriptoutput($tplfile)
{
global $_G;
if (isset($_G['setting']['hookscript']['global']['global']['module'])) {
hookscript('global');
}
if (isset($_G['setting']['hookscript'][$_G['basescript']][CURMODULE]['outputfuncs'])) {
hookscript(CURMODULE, 'outputfuncs', array('template' => $tplfile, 'message' => $_G['hookscriptmessage'], 'values' => $_G['hookscriptvalues']));
}
}
示例10: savebanlog
function savebanlog($username, $origgroupid, $newgroupid, $expiration, $reason)
{
global $_G;
if ($_G['setting']['plugins']['func'][HOOKTYPE]['savebanlog']) {
$param = func_get_args();
hookscript('savebanlog', 'global', 'funcs', array('param' => $param), 'savebanlog');
}
writelog('banlog', dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['groupid']}\t{$_G['clientip']}\t{$username}\t{$origgroupid}\t{$newgroupid}\t{$expiration}\t{$reason}"));
}
示例11: DoAdd
function DoAdd()
{
if (MEMBER_ID < 1) {
response_text("请先登录或者注册一个帐号");
}
$content = trim($this->Post['content']);
if (!$content) {
response_text("请输入内容");
}
$topic_type = $this->Post['topictype'];
if ('both' == $topic_type) {
$type = 'both';
} elseif ('reply' == $topic_type) {
$type = 'reply';
} elseif ('company' == $topic_type) {
$type = 'company';
} elseif ('qun' == $topic_type) {
$type = 'qun';
} elseif ('live' == $topic_type) {
$type = 'live';
} elseif ('talk' == $topic_type) {
$type = 'talk';
} elseif ('personal' == $topic_type) {
$type = 'personal';
} elseif (in_array($topic_type, array('answer', 'event', 'vote', 'fenlei', 'reward'))) {
$type = 'reply';
} elseif (is_numeric($topic_type)) {
$type = 'first';
} else {
$type = 'first';
}
#if NEDU
defined('NEDU_MOYO') && nlogic('feeds.app.jsg')->topic_detect_type($type, $topic_type);
#endif
if (!in_array($type, array('both', 'reply', 'forward'))) {
if (!$this->MemberHandler->HasPermission('topic', 'add')) {
response_text("您的角色没有发布的权限");
}
} else {
if (('reply' == $type || 'both' == $type) && !$this->MemberHandler->HasPermission('topic', 'reply')) {
response_text("您的角色没有评论的权限");
} elseif (('forward' == $type || 'both' == $type) && !$this->MemberHandler->HasPermission('topic', 'forward')) {
response_text("您的角色没有转发的权限");
}
}
if ($this->Config['seccode_enable'] > 1) {
$YXM_check = jlogic('seccode')->topiccheckYXM($type);
if ($YXM_check && $this->yxm_title && $this->Config['seccode_pub_key'] && $this->Config['seccode_pri_key']) {
$YinXiangMa_response = jlogic('seccode')->CheckYXM(@$_POST['YinXiangMa_challenge'], @$_POST['YXM_level'][0], @$_POST['YXM_input_result']);
if ($YinXiangMa_response != "true") {
response_text("验证码输入错误");
}
}
}
$roottid = max(0, (int) $this->Post['roottid']);
$totid = max(0, (int) $this->Post['totid']);
$touid = max(0, (int) $this->Post['touid']);
$imageid = trim($this->Post['imageid']);
$attachid = trim($this->Post['attachid']);
$relateid = trim($this->Post['relateid']);
$featureid = trim($this->Post['featureid']);
$videoid = max(0, (int) $this->Post['videoid']);
$anonymous = (int) $this->Post['anonymous'];
$longtextid = max(0, (int) $this->Post['longtextid']);
$design = trim($this->Post['r']);
$xiami_id = trim($this->Post['xiami_id']) ? trim($this->Post['xiami_id']) : 0;
$from = trim($this->Post['from']);
$verify = $this->Post['verify'] ? 1 : 0;
$is_reward = jget('is_reward', 'int');
$item = trim($this->Post['item']);
$item_id = intval(trim($this->Post['item_id']));
if ('company' == $item) {
$item_id = $GLOBALS['_J']['member']['companyid'];
}
if (!empty($item_id)) {
if (!($item == 'company' || $item == 'topic_image')) {
jfunc('app');
$ret = app_check($item, $item_id);
if (!$ret) {
$item = '';
$item_id = 0;
}
}
if ($item == 'channel') {
$can_pub_topic = jlogic('channel')->can_pub_topic($item_id);
if (!$can_pub_topic) {
$item = '';
$item_id = 0;
}
}
} else {
$item = '';
$item_id = 0;
}
$data = array('content' => $content, 'totid' => $totid, 'imageid' => $imageid, 'attachid' => $attachid, 'videoid' => $videoid, 'from' => empty($from) ? 'web' : $from, 'type' => $type, 'design' => $design, 'item' => $item, 'item_id' => $item_id, 'touid' => $touid, 'longtextid' => $longtextid, 'xiami_id' => $xiami_id, 'pverify' => $verify, 'is_reward' => $is_reward, 'relateid' => $relateid, 'featureid' => $featureid, 'anonymous' => $anonymous);
if ($GLOBALS['_J']['plugins']['func']['posttopic']) {
hookscript('posttopic', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'posttopic');
}
$return = $this->TopicLogic->Add($data);
if (is_array($return) && $return['tid'] > 0) {
//.........这里部分代码省略.........
示例12: hookscriptoutput
function hookscriptoutput($tplfile)
{
global $hookscript, $hookscriptmessage;
if (isset($hookscript['global']['module'])) {
hookscript('global');
}
if (isset($hookscript[CURSCRIPT]['outputfuncs'])) {
hookscript(CURSCRIPT, 'outputfuncs', array('template' => $tplfile, 'message' => $hookscriptmessage));
}
}
示例13: srhooks
function srhooks()
{
global $_G;
$hscript = 'plugin';
$script = 'sanree';
$type = 'funcs';
hookscript($script, $hscript, $type);
}
示例14: Login2
function Login2()
{
$username = trim(jget('username'));
$password = jget('password');
if ($username == "" || $password == "") {
json_error("无法登录,用户名或密码不能为空");
}
if ($GLOBALS['_J']['plugins']['func']['login']) {
hookscript('login', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'login');
}
$referer = jget('referer');
if (!$referer) {
$referer = jsg_getcookie('referer');
}
$rets = jsg_member_login($username, $password);
$uid = (int) $rets['uid'];
if ($uid < 1) {
json_error($rets['error']);
}
$member = jsg_member_info($uid);
$this->Config['email_must_be_true'] == 2 && $member['email_checked'] == 0 && ($referer = 'index.php?mod=member&code=setverify&ids=' . $uid);
if ($this->Config['extcredits_enable'] && $uid > 0) {
update_credits_by_action('login', $uid);
}
Load::logic('other');
$otherLogic = new OtherLogic();
$sql = "SELECT m.id as medal_id,m.medal_img,m.medal_name,m.medal_depict,m.conditions,u.dateline,y.apply_id\r\n\t\t\t\tFROM " . TABLE_PREFIX . "medal m\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user_medal u ON (u.medalid = m.id AND u.uid = '{$uid}')\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "medal_apply y ON (y.medal_id = m.id AND y.uid = '{$uid}')\r\n\t\t\t\tWHERE m.is_open = 1\r\n\t\t\t\tORDER BY u.dateline DESC,m.id";
$query = $this->DatabaseHandler->Query($sql);
while (false != ($rs = $query->GetRow())) {
$rs['conditions'] = unserialize($rs['conditions']);
if (in_array($rs['conditions']['type'], array('topic', 'reply', 'tag', 'invite', 'fans')) && !$rs['dateline']) {
$result .= $otherLogic->autoCheckMedal($rs['medal_id'], $uid);
}
}
header("location:mobile/index.php");
}
示例15: dshowmessage
function dshowmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0)
{
global $_G, $show_message;
$_G['messageparam'] = func_get_args();
if (empty($_G['inhookscript']) && defined('CURMODULE')) {
hookscript(CURMODULE, $_G['basescript'], 'messagefuncs', array('param' => $_G['messageparam']));
}
if ($extraparam['break']) {
return;
}
$_G['inshowmessage'] = true;
$param = array('header' => false, 'timeout' => null, 'refreshtime' => null, 'closetime' => null, 'locationtime' => null, 'alert' => null, 'return' => false, 'redirectmsg' => 0, 'msgtype' => 1, 'showmsg' => true, 'showdialog' => false, 'login' => false, 'handle' => false, 'extrajs' => '', 'striptags' => true);
$navtitle = lang('core', 'title_board_message');
if ($custom) {
$alerttype = 'alert_info';
$show_message = $message;
include template('common/showmessage');
dexit();
}
define('CACHE_FORBIDDEN', TRUE);
$_G['setting']['msgforward'] = @dunserialize($_G['setting']['msgforward']);
$handlekey = $leftmsg = '';
if (defined('IN_MOBILE')) {
unset($extraparam['showdialog']);
unset($extraparam['closetime']);
unset($extraparam['extrajs']);
if (!$url_forward && dreferer() && IN_MOBILE == 1) {
$url_forward = $referer = dreferer();
}
if (!empty($url_forward) && strpos($url_forward, 'mobile') === false) {
$url_forward_arr = explode("#", $url_forward);
if (strpos($url_forward_arr[0], '?') !== false) {
$url_forward_arr[0] = $url_forward_arr[0] . '&mobile=' . IN_MOBILE;
} else {
$url_forward_arr[0] = $url_forward_arr[0] . '?mobile=' . IN_MOBILE;
}
$url_forward = implode("#", $url_forward_arr);
}
}
if (empty($_G['inajax']) && (!empty($_GET['quickforward']) || $_G['setting']['msgforward']['quick'] && empty($extraparam['clean_msgforward']) && $_G['setting']['msgforward']['messages'] && @in_array($message, $_G['setting']['msgforward']['messages']))) {
$param['header'] = true;
}
$_GET['handlekey'] = !empty($_GET['handlekey']) && preg_match('/^\\w+$/', $_GET['handlekey']) ? $_GET['handlekey'] : '';
if (!empty($_G['inajax'])) {
$handlekey = $_GET['handlekey'] = !empty($_GET['handlekey']) ? dhtmlspecialchars($_GET['handlekey']) : '';
$param['handle'] = true;
}
if (!empty($_G['inajax'])) {
$param['msgtype'] = empty($_GET['ajaxmenu']) && (empty($_POST) || !empty($_GET['nopost'])) ? 2 : 3;
}
if ($url_forward) {
$param['timeout'] = true;
if ($param['handle'] && !empty($_G['inajax'])) {
$param['showmsg'] = false;
}
}
foreach ($extraparam as $k => $v) {
$param[$k] = $v;
}
if (array_key_exists('set', $extraparam)) {
$setdata = array('1' => array('msgtype' => 3));
if ($setdata[$extraparam['set']]) {
foreach ($setdata[$extraparam['set']] as $k => $v) {
$param[$k] = $v;
}
}
}
$timedefault = intval($param['refreshtime'] === null ? $_G['setting']['msgforward']['refreshtime'] : $param['refreshtime']);
if ($param['timeout'] !== null) {
$refreshsecond = !empty($timedefault) ? $timedefault : 3;
$refreshtime = $refreshsecond * 1000;
} else {
$refreshtime = $refreshsecond = 0;
}
if ($param['login'] && $_G['uid'] || $url_forward) {
$param['login'] = false;
}
$param['header'] = $url_forward && $param['header'] ? true : false;
if ($_GET['ajaxdata'] === 'json') {
$param['header'] = '';
}
if ($param['header']) {
header("HTTP/1.1 301 Moved Permanently");
dheader("location: " . str_replace('&', '&', $url_forward));
}
$url_forward_js = addslashes(str_replace('\\', '%27', $url_forward));
if ($param['location'] && !empty($_G['inajax'])) {
include template('common/header_ajax');
echo '<script type="text/javascript" reload="1">window.location.href=\'' . $url_forward_js . '\';</script>';
include template('common/footer_ajax');
dexit();
}
$_G['hookscriptmessage'] = $message;
$_G['hookscriptvalues'] = $values;
$vars = explode(':', $message);
if (count($vars) == 2) {
$show_message = lang('plugin/' . $vars[0], $vars[1], $values);
} else {
$show_message = lang('message', $message, $values);
}
//.........这里部分代码省略.........