当前位置: 首页>>代码示例>>PHP>>正文


PHP getmtag函数代码示例

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


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

示例1: intval

		
		showmessage('do_success', "cp.php?ac=mtag&op=mtaginvite", 0);
	}

	showmessage('invite_mtag_cancel', "cp.php?ac=mtag&op=mtaginvite", 0);
	
}elseif($_GET['op'] == 'apply') {
	
	$tagid = intval($_GET['tagid']);
	if($tagid && submitcheck('pmsubmit')) {
		
		if(empty($_POST['message'])) {
			showmessage('fill_out_the_grounds_for_the_application');
		}
		$notearr = array();
		$mtag = getmtag($tagid);
		$mtagurl = 'cp.php?ac=mtag&tagid='.$tagid.'&op=manage&subop=members&key='.$_SGLOBAL['supe_username'];
		$_POST['message'] = getstr($_POST['message'], 0, 1, 1, 1);
		$message = cplang('apply_mtag_manager', array($mtagurl, $mtag['tagname'], $_POST['message']));
		
		$query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('tagspace')." WHERE tagid='$tagid' AND grade > 8 LIMIT 0 , 5");
		while ($value = $_SGLOBAL['db']->fetch_array($query)) {
			$notearr[] = array(
					'uid' => $value['uid'],
					'type' => 'mtag',
					'new' => 1,
					'authorid' => $_SGLOBAL['supe_uid'],
					'author' => $_SGLOBAL['supe_username'],
					'note' => addslashes(sstripslashes($message)),
					'dateline' => $_SGLOBAL['timestamp']
				);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:cp_mtag.php

示例2: array

        $db_target->query("UPDATE " . $db_target->table('common_member_count') . " SET posts=posts+1 WHERE uid='{$post['uid']}'", 'UNBUFFERED');
        $db_target->query("UPDATE " . $db_target->table('forum_groupuser') . " SET replies=replies+1 WHERE fid='{$sid}' AND uid='{$post['uid']}'", 'UNBUFFERED');
    }
    if ($lastpost) {
        $db_target->update('forum_thread', $lastpost, array('tid' => $tid));
    } else {
        $lastpost['lastpost'] = $value['lastpost'];
    }
    $db_target->insert('common_member_count', array('uid' => $value['uid']), 0, false, true);
    $db_target->query("UPDATE " . $db_target->table('common_member_count') . " SET threads=threads+1 WHERE uid='{$value['uid']}'", 'UNBUFFERED');
    $db_target->query("UPDATE " . $db_target->table('forum_groupuser') . " SET threads=threads+1 WHERE fid='{$sid}' AND uid='{$value['uid']}'", 'UNBUFFERED');
    $db_target->query("UPDATE " . $db_target->table('forum_forum') . " SET lastpost='{$lastpost['lastpost']}', threads=threads+1, posts=posts+{$value['replynum']} WHERE fid='{$sid}'", 'UNBUFFERED');
}
$force = false;
if (!$nextid) {
    if (!getmtag($tagid)) {
        if (!getprofield($fieldid)) {
            $nextid = 0;
        } else {
            $force = true;
        }
    } else {
        $force = true;
    }
    $nextid = $force ? 1 : 0;
}
if ($nextid) {
    if ($force) {
        $nextid = 0;
    }
    $mtag = array();
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:home_group.php

示例3: deleteposts

function deleteposts($tagid, $pids)
{
    global $_SGLOBAL;
    //统计
    $postnums = $mpostnums = $tids = $delposts = $newids = $spaces = array();
    $ismanager = $allowmanage = checkperm('managethread');
    $managebatch = checkperm('managebatch');
    $delnum = 0;
    //群主
    $wheresql = '';
    if (empty($allowmanage) && $tagid) {
        $mtag = getmtag($tagid);
        if ($mtag['grade'] >= 8) {
            $allowmanage = 1;
            $managebatch = 1;
            $wheresql = " AND p.tagid='{$tagid}'";
        }
    }
    //获取积分
    $reward = getreward('delcomment', 0);
    $query = $_SGLOBAL['db']->query("SELECT p.* FROM " . tname('post') . " p WHERE p.pid IN (" . simplode($pids) . ") {$wheresql} ORDER BY p.isthread DESC");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if ($allowmanage || $value['uid'] == $_SGLOBAL['supe_uid']) {
            if (!$managebatch && $value['uid'] != $_SGLOBAL['supe_uid']) {
                $delnum++;
            }
            $postarr[] = $value;
        }
    }
    if (!$managebatch && $delnum > 1) {
        return array();
    }
    foreach ($postarr as $key => $value) {
        if ($value['isthread']) {
            $tids[] = $value['tid'];
        } else {
            if (!in_array($value['tid'], $tids)) {
                $newids[] = $value['pid'];
                $delposts[] = $value;
                $postnums[$value['tid']]++;
                if ($ismanager && $value['uid'] != $_SGLOBAL['supe_uid']) {
                    //扣除积分
                    $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET credit=credit-{$reward['credit']}, experience=experience-{$reward['experience']} WHERE uid='{$value['uid']}'");
                }
            }
        }
    }
    $delthreads = array();
    if ($tids) {
        $delthreads = deletethreads($tagid, $tids);
    }
    if (empty($delposts)) {
        return $delthreads;
    }
    //整理
    $nums = renum($postnums);
    foreach ($nums[0] as $pnum) {
        $_SGLOBAL['db']->query("UPDATE " . tname('thread') . " SET replynum=replynum-{$pnum} WHERE tid IN (" . simplode($nums[1][$pnum]) . ")");
    }
    //删除
    $_SGLOBAL['db']->query("DELETE FROM " . tname('post') . " WHERE pid IN (" . simplode($newids) . ")");
    return $delposts;
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:63,代码来源:function_delete.php

示例4: ckmtagspace

function ckmtagspace($tagid)
{
    global $_SGLOBAL, $_SCONFIG, $event, $userevent;
    if ($event) {
        //活动话题单独处理
        if (empty($userevent) || $userevent['status'] < 2) {
            showmessage('event_only_allows_member_thread');
        }
        if ($event['tagid'] != $tagid) {
            showmessage('event_mtag_not_match');
        }
        $mtag = getmtag($tagid);
        if ($mtag['close']) {
            showmessage('mtag_close');
        }
        return $mtag;
    }
    $count = 0;
    $mtag = array();
    if ($tagid) {
        $mtag = getmtag($tagid);
        if ($mtag) {
            //判断是否关闭
            if ($mtag['close']) {
                showmessage('mtag_close');
            }
            //是否允许浏览
            if (empty($mtag['allowview'])) {
                showmessage('mtag_not_allow_to_do');
            }
            //判断是否满足人数要求
            if ($mtag['field']['mtagminnum'] && $mtag['membernum'] < $mtag['field']['mtagminnum']) {
                showmessage('mtag_minnum_erro', '', 1, array($mtag['field']['mtagminnum']));
            }
        }
    }
    if (empty($mtag)) {
        showmessage('first_select_a_mtag');
    }
    return $mtag;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:41,代码来源:cp_thread.php

示例5: topthreads

function topthreads($tagid, $tids, $v) {
	global $_SGLOBAL;
	
	$mtag = getmtag($tagid);
	if($mtag['grade']<8) {
		return array();
	}
	
	if(empty($v)) {
		$wheresql = " AND t.displayorder='1'";
		$v = 0;
	} else {
		$wheresql = " AND t.displayorder='0'";
		$v = 1;
	}
	$newtids = $threads = array();
	$query = $_SGLOBAL['db']->query("SELECT t.* FROM ".tname('thread')." t WHERE t.tagid='$tagid' AND t.tid IN (".simplode($tids).") $wheresql");
	while ($value = $_SGLOBAL['db']->fetch_array($query)) {
		$newtids[] = $value['tid'];
		$threads[] = $value;
	}
	
	//数据
	if($newtids) {
		$_SGLOBAL['db']->query("UPDATE ".tname('thread')." SET displayorder='$v' WHERE tid IN (".simplode($newtids).")");
	}

	return $threads;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:29,代码来源:function_op.php

示例6: ckmtagspace

function ckmtagspace($tagid)
{
    global $_SGLOBAL, $_SCONFIG;
    $count = 0;
    $mtag = array();
    if ($tagid) {
        $mtag = getmtag($tagid);
        if ($mtag) {
            //判断是否关闭
            if ($mtag['close']) {
                showmessage('mtag_close');
            }
            //是否允许浏览
            if (empty($mtag['allowview'])) {
                showmessage('mtag_not_allow_to_do');
            }
            //是否允许发
            if (empty($mtag['allowpost'])) {
                showmessage('no_privilege');
            }
            //判断是否满足人数要求
            if ($mtag['field']['mtagminnum'] && $mtag['membernum'] < $mtag['field']['mtagminnum']) {
                showmessage('mtag_minnum_erro', '', 1, array($mtag['field']['mtagminnum']));
            }
        }
    }
    if (empty($mtag)) {
        showmessage('first_select_a_mtag');
    }
    return $mtag;
}
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:cp_thread.php

示例7: deleteposts

function deleteposts($tagid, $pids)
{
    global $_SGLOBAL;
    //统计
    $postnums = $mpostnums = $tids = $delposts = $newids = $spaces = array();
    $allowmanage = checkperm('managethread');
    //群主
    $wheresql = '';
    if (empty($allowmanage) && $tagid) {
        $mtag = getmtag($tagid);
        if ($mtag['grade'] >= 8) {
            $allowmanage = 1;
            $wheresql = " AND p.tagid='{$tagid}'";
        }
    }
    $query = $_SGLOBAL['db']->query("SELECT p.* FROM " . tname('post') . " p WHERE p.pid IN (" . simplode($pids) . ") {$wheresql} ORDER BY p.isthread DESC");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if ($allowmanage || $value['uid'] == $_SGLOBAL['supe_uid']) {
            if ($value['isthread']) {
                $tids[] = $value['tid'];
            } else {
                if (!in_array($value['tid'], $tids)) {
                    $newids[] = $value['pid'];
                    $delposts[] = $value;
                    $postnums[$value['tid']]++;
                    $spaces[$value['uid']]++;
                }
            }
        }
    }
    $delthreads = array();
    if ($tids) {
        $delthreads = deletethreads($tagid, $tids);
    }
    if (empty($delposts)) {
        return $delthreads;
    }
    //整理
    $nums = renum($postnums);
    foreach ($nums[0] as $pnum) {
        $_SGLOBAL['db']->query("UPDATE " . tname('thread') . " SET replynum=replynum-{$pnum} WHERE tid IN (" . simplode($nums[1][$pnum]) . ")");
    }
    //删除
    $_SGLOBAL['db']->query("DELETE FROM " . tname('post') . " WHERE pid IN (" . simplode($newids) . ")");
    //积分
    updatespaces($spaces, 'post');
    return $delposts;
}
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:48,代码来源:function_delete.php


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