• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP formulaperm函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中formulaperm函数的典型用法代码示例。如果您正苦于以下问题:PHP formulaperm函数的具体用法?PHP formulaperm怎么用?PHP formulaperm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了formulaperm函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: periodscheck

    $navigation = ' &rsaquo; <a href="forum.php">' . $_G['setting']['navs'][2]['navname'] . '</a> ' . $navigation;
}
periodscheck('postbanperiods');
if ($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw' . $_G['fid']]) {
    showmessage('forum_passwd', "forum.php?mod=forumdisplay&fid={$_G['fid']}");
}
if (empty($_G['forum']['allowview'])) {
    if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
        showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
    } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
        showmessagenoperm('viewperm', $_G['fid']);
    }
} elseif ($_G['forum']['allowview'] == -1) {
    showmessage('forum_access_view_disallow');
}
formulaperm($_G['forum']['formulaperm']);
if (!$_G['adminid'] && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 3600)) {
    if (TIMESTAMP - DB::result_first("SELECT regdate FROM " . DB::table('common_member') . " WHERE uid='{$_G['uid']}'") < $_G['setting']['newbiespan'] * 3600) {
        showmessage('post_newbie_span', '', array('newbiespan' => $_G['setting']['newbiespan']));
    }
}
$special = $special > 0 && $special < 7 || $special == 127 ? intval($special) : 0;
$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : '';
$_G['group']['allowpostattach'] = $_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || !$_G['forum']['postattachperm'] && $_G['group']['allowpostattach'] || $_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm']));
$_G['forum']['allowpostimage'] = isset($_G['forum']['allowpostimage']) ? $_G['forum']['allowpostimage'] : '';
$_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || !$_G['forum']['postimageperm'] && $_G['group']['allowpostimage'] || $_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']));
$_G['group']['attachextensions'] = $_G['forum']['attachextensions'] ? $_G['forum']['attachextensions'] : $_G['group']['attachextensions'];
if ($_G['group']['attachextensions']) {
    $imgexts = explode(',', str_replace(' ', '', $_G['group']['attachextensions']));
    $imgexts = array_intersect(array('jpg', 'jpeg', 'gif', 'png', 'bmp'), $imgexts);
    $imgexts = implode(', ', $imgexts);
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:forum_post.php


示例2: formulaperm

require_once DISCUZ_ROOT.'./include/post.func.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';

if(empty($forum) || $forum['type'] == 'group') {
	wapmsg('forum_nonexistence');
}

if(empty($forum['allowview']) && ((!$forum['viewperm'] && !$readaccess) || ($forum['viewperm'] && !forumperm($forum['viewperm'])))) {
	wapmsg('forum_nopermission');
}

if(empty($bbcodeoff) && !$allowhidecode && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
	wapmsg('post_hide_nopermission');
}

formulaperm($forum['formulaperm']);

if(!$adminid && $newbiespan && (!$lastpost || $timestamp - $lastpost < $newbiespan * 3600)) {
	$regdate = $db->result_first("SELECT regdate FROM {$tablepre}members WHERE uid='$discuz_uid'");
	if($timestamp - $regdate < $newbiespan * 3600) {
		showmessage('post_newbie_span');
	}
}

$postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post'];
$replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply'];

$modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && ($forum['modnewposts'] || !empty($censormod)) ? 1 : 0;
$modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && ($forum['modnewposts'] == 2 || !empty($censormod)) ? 1 : 0;

$subject = wapconvert($subject);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:post.inc.php


示例3: elseif

} elseif ($_G['gp_action'] == 'apply' && submitcheck('medalsubmit')) {
    $medalid = intval($_G['gp_medalid']);
    $_G['forum_formulamessage'] = $_G['forum_usermsg'] = $medalnew = '';
    $medal = DB::fetch_first("SELECT * FROM " . DB::table('forum_medal') . " WHERE medalid='{$medalid}'");
    if (!$medal['type']) {
        showmessage('medal_apply_invalid');
    }
    $medaldetail = DB::fetch_first("SELECT medalid FROM " . DB::table('forum_medallog') . " WHERE uid='{$_G['uid']}' AND medalid='{$medalid}' AND type NOT IN('3', '4')");
    if ($medaldetail['medalid']) {
        showmessage('medal_apply_existence', 'home.php?mod=medal');
    }
    $applysucceed = FALSE;
    $medalpermission = $medal['permission'] ? unserialize($medal['permission']) : '';
    if ($medalpermission[0]) {
        include libfile('function/forum');
        formulaperm(serialize(array('medal' => $medalpermission)), 1);
        if ($_G['forum_formulamessage']) {
            showmessage('medal_permforum_nopermission', 'home.php?mod=medal', array('formulamessage' => $_G['forum_formulamessage'], 'usermsg' => $_G['forum_usermsg']));
        } else {
            $applysucceed = TRUE;
        }
    } else {
        $applysucceed = TRUE;
    }
    if ($applysucceed) {
        if ($medal['type'] == 1) {
            $usermedal = DB::fetch_first("SELECT medals FROM " . DB::table('common_member_field_forum') . " WHERE uid='{$_G['uid']}'");
            $medalnew = $usermedal['medals'] ? $usermedal['medals'] . "\t" . $medal['medalid'] : $medal['medalid'];
            DB::query("UPDATE " . DB::table('common_member_field_forum') . " SET medals='{$medalnew}' WHERE uid='{$_G['uid']}'");
            $medalmessage = 'medal_get_succeed';
        } else {
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:home_medal.php


示例4: substr

            if ($medalpos = strpos($medalid, '|')) {
                $medalid = substr($medalid, 0, $medalpos);
            }
            $medallog['name'] = $_DCACHE['medals'][$medalid]['name'];
            $medallog['image'] = $medallist[$medalid]['image'];
            $medallogs[] = $medallog;
        }
    }
} elseif ($action == 'apply') {
    $medalid = intval($medalid);
    $formulamessage = '';
    $medal = $db->fetch_first("SELECT * FROM {$tablepre}medals WHERE medalid='{$medalid}'");
    if (!$medal['type']) {
        showmessage('medal_required_invalid');
    }
    formulaperm($medal['permission'], 1) && ($medal['permission'] = formulaperm($medal['permission'], 2));
    if (submitcheck('medalsubmit')) {
        $medaldetail = $db->fetch_first("SELECT medalid FROM {$tablepre}medallog WHERE uid='{$discuz_uid}' AND medalid='{$medalid}' AND type NOT IN('3', '4')");
        if ($medaldetail['medalid']) {
            showmessage('medal_apply_existence', 'medal.php');
        } else {
            $expiration = empty($medal['expiration']) ? 0 : $timestamp + $medal['expiration'] * 86400;
            $db->query("INSERT INTO {$tablepre}medallog (uid, medalid, type, dateline, expiration, status) VALUES ('{$discuz_uid}', '{$medalid}', '2', '{$timestamp}', '{$expiration}', '0')");
        }
        showmessage('medal_apply_succeed', 'medal.php');
    }
} elseif ($action == 'log') {
    $medallognum = $db->result_first("SELECT COUNT(*) FROM {$tablepre}medallog WHERE uid='{$discuz_uid}' AND type IN ('0', '1')");
    $multipage = multi($medallognum, $tpp, $page, "medal.php?action=log");
    $query = $db->query("SELECT me.*, m.image FROM {$tablepre}medallog me\r\n\t\t\tLEFT JOIN {$tablepre}medals m USING (medalid)\r\n\t\t\tWHERE me.uid='{$discuz_uid}' AND me.type IN ('0', '1') ORDER BY me.dateline DESC LIMIT {$start_limit},{$tpp}");
    while ($medallog = $db->fetch_array($query)) {
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:medal.php


示例5: intval

	$medalid = intval($medalid);
	$formulamessage = $usermsg = $medalnew = '';
	$medal = $db->fetch_first("SELECT * FROM {$tablepre}medals WHERE medalid='$medalid'");
	if(!$medal['type']) {
		showmessage('medal_apply_invalid');
	}

	$medaldetail = $db->fetch_first("SELECT medalid FROM {$tablepre}medallog WHERE uid='$discuz_uid' AND medalid='$medalid' AND type NOT IN('3', '4')");
	if($medaldetail['medalid']) {
		showmessage('medal_apply_existence', 'medal.php');
	}

	$medalpermission = $medal['permission'] ? unserialize($medal['permission']) : '';
	if($medalpermission[0]) {
		formulaperm($medal['permission'], 1);

		if($formulamessage) {
			showmessage('medal_permforum_nopermission', 'medal.php');
		}

		$usermedal = $db->fetch_first("SELECT medals FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
		$medalnew = $usermedal['medals'] ? $usermedal['medals']."\t".$medal['medalid'] : $medal['medalid'];
		$db->query("UPDATE {$tablepre}memberfields SET medals='$medalnew' WHERE uid='$discuz_uid'");

		$db->query("INSERT INTO {$tablepre}medallog (uid, medalid, type, dateline, expiration, status) VALUES ('$discuz_uid', '$medalid', '1', '$timestamp', '$expiration', '0')");
		showmessage('medal_get_succeed', 'medal.php');
	} else {
		$expiration = empty($medal['expiration'])? 0 : $timestamp + $medal['expiration'] * 86400;
		$db->query("INSERT INTO {$tablepre}medallog (uid, medalid, type, dateline, expiration, status) VALUES ('$discuz_uid', '$medalid', '2', '$timestamp', '$expiration', '0')");
		showmessage('medal_apply_succeed', 'medal.php');
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:medal.php


示例6: max

$page = max(1, intval($page));
$start_limit = $number = ($page - 1) * $waptpp;

if(!empty($fid)) {

	require_once DISCUZ_ROOT.'./include/forum.func.php';

	if(empty($forum)) {
		wapmsg('forum_nonexistence');
	}

	if(($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) || $forum['redirect'] || $forum['password']) {
		wapmsg('forum_nopermission');
	} elseif($forum['formulaperm']) {
		formulaperm($forum['formulaperm'], 0, TRUE);
	}

	echo 	"<p>".strip_tags($forum['name'])."<br />".
		"<a href=\"index.php?action=post&amp;do=newthread&amp;fid=$forum[fid]\">$lang[post_new]</a> ".
		"<a href=\"index.php?action=forum&amp;do=digest&amp;fid=$forum[fid]\">$lang[digest]</a><br /><br />".
		"$lang[forum_list] <a href=\"index.php?action=forum&amp;fid=$forum[fid]\">$lang[reload]</a><br />";

	$do = !empty($do) ? 'digest' : '';
	$filteradd = $do == 'digest' ? 'AND digest>\'0\'' : '';
	$threadcount = $sdb->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid' $filteradd AND displayorder>='0'");

	$thread['prefix'] = '';
	$query = $sdb->query("SELECT * FROM {$tablepre}threads
		WHERE fid='$fid' $filteradd AND displayorder>='0'
		ORDER BY displayorder DESC, lastpost DESC LIMIT $start_limit, $waptpp");
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:forum.inc.php



注:本文中的formulaperm函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP forum函数代码示例发布时间:2022-05-15
下一篇:
PHP formulaires_editer_objet_verifier函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap