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


PHP check_group函数代码示例

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


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

示例1: page_message

function page_message()
{
    $message_id = $_GET['message'];
    $message = db_easy("SELECT * FROM `intr_message` WHERE `id`={$message_id}");
    $q_comm = db_query("SELECT * FROM `intr_comments` WHERE `message_id`={$message_id} ORDER BY `date` DESC");
    $user = db_easy("SELECT * FROM `users` WHERE `id`=" . $message['user_id']);
    $edit_del_comment_html = "";
    if (check_group("writer") || $user['name'] == get_user()) {
        $edit_del_message_html .= "<br/><a href='" . uri_make_v1(array("UriScript" => 'intranet.php', 'page' => 'message', 'message' => $message_id, 'edit_message' => 'yes', 'message' => $message['id'])) . "' style='font-size:8pt;'>Редактировать</a>";
        $edit_del_message_html .= "<a href='" . uri_make_v1(array("UriScript" => 'intranet.php', 'page' => 'message', 'message' => $message_id, 'delete_message' => 'yes', 'message' => $message['id'])) . "' style='padding-left:10px;font-size:8pt;' onClick=\"if(!confirm('Удалить?')) return false;\">Удалить</a>";
    }
    $comments_html = "";
    while ($comment = db_fetch($q_comm)) {
        $user = db_easy("SELECT * FROM `users` WHERE `id`={$comment['user_id']}");
        $comments_html .= "<div style='margin:15px 0 0 0;padding:0 0 0 10px;border-left:2px solid #AAA;'>";
        $comments_html .= "<span style='font-size:8pt;font-style:italic;'><b>" . $user['name_rus'] . ",</b> " . date("d.m.Y H:i", strtotime($comment['date'])) . "</span><br/>" . $comment['text'] . "</div>";
        if (check_group("writer") || $user['name'] == get_user()) {
            $comments_html .= "<a href='" . uri_make_v1(array("UriScript" => 'intranet.php', 'page' => 'message', 'message' => $message_id, 'edit_comment' => 'yes', 'comment' => $comment['id'])) . "' style='font-size:8pt;'>Редактировать</a>";
            $comments_html .= "<a href='" . uri_make_v1(array("UriScript" => 'intranet.php', 'page' => 'message', 'message' => $message_id, 'delete_comment' => 'yes', 'comment' => $comment['id'])) . "' style='padding-left:10px;font-size:8pt;' onClick=\"if(!confirm('Удалить?')) return false;\">Удалить</a>";
        }
    }
    $html .= template_get('message/message', array("user" => $user['name_rus'], "date" => date("d.m.Y", strtotime($message['date'])), "title" => $message['title'], "edit_del_message" => $edit_del_message_html, "text" => $message['text'], "uri_back" => uri_make_v1(array("UriScript" => "intranet.php")), "uri_comment" => uri_make_v1(array("UriScript" => "intranet.php", "page" => "message", "message" => $message_id, "add_comment" => "yes")), "comments" => $comments_html));
    //Подключаем подвал
    $html .= template_get('footer');
    return $html;
}
开发者ID:jsib,项目名称:dumps.loc,代码行数:26,代码来源:message.php

示例2: page_index

function page_index()
{
    $q = db_query("SELECT * FROM `intr_message`");
    $message_html = "";
    if (get_user_group() == "writer") {
        $add_message_html = "<a href='" . uri_make_v1(array("UriScript" => "intranet.php", "add_message" => "yes")) . "' style='padding:0 0 0 10px;'><img src='/_content/img/add-icon.png'/></a>";
    } else {
        $add_message_html = "";
    }
    while ($message = db_fetch($q)) {
        $message_html .= "<a href='" . uri_make_v1(array("UriScript" => "intranet.php", "page" => "message", "message" => $message['id'])) . "'>" . trim($message['title']) . "</a>";
        if (check_group("writer") || $user['name'] == get_user()) {
            //$message_html.="<br/><a href='".uri_make_v1(array("UriScript"=>'intranet.php', 'edit_message'=>'yes', 'message'=>$message['id']))."' style='font-size:8pt;'>Редактировать</a>";
            //$message_html.="<a href='".uri_make_v1(array("UriScript"=>'intranet.php', 'delete_message'=>'yes', 'message'=>$message['id']))."' style='padding-left:10px;font-size:8pt;' onClick=\"if(!confirm('Удалить?')) return false;\">Удалить</a>";
            //$message_html.="<br/><br/>";
            /*$comments_html.="<a href='".uri_make_v1(array("UriScript"=>'intranet.php', 'page'=>'message', 'message'=>$message['id'], 'edit_comment'=>'yes', 'comment'=>$comment['id']))."' style='font-size:8pt;'>Редактировать</a>";
            		$comments_html.="<a href='".uri_make_v1(array("UriScript"=>'intranet.php', 'page'=>'message', 'message'=>$message['id'], 'delete_comment'=>'yes', 'comment'=>$comment['id']))."' style='padding-left:10px;font-size:8pt;' onClick=\"if(!confirm('Удалить?')) return false;\">Удалить</a>";
            		*/
            $message_html .= "<a href='" . uri_make_v1(array("UriScript" => "intranet.php", "edit_message" => "yes", "message" => $message['id'])) . "' style='padding:0 0 0 10px;'><img src='/_content/img/edit-icon.png'/></a>";
            $message_html .= "<a href='" . uri_make_v1(array("UriScript" => "intranet.php", "delete_message" => "yes", "message" => $message['id'])) . "' style='padding:0 0 0 10px;' onClick=\"if(!confirm('Удалить?')) return false;\"><img src='/_content/img/remove-icon.png'/></a>" . "<br/>";
        }
    }
    $contacts_html = "";
    $q = db_query("SELECT * FROM `users`");
    while ($user = db_fetch($q)) {
        $contacts_html .= "<a href='" . uri_make_v1(array("UriScript" => "intranet.php", "page" => "contact", "name" => $user['name'])) . "'>" . $user['name_rus'] . "</a>" . "<br/>";
    }
    $html .= template_get('intranet/intranet', array("add_message" => $add_message_html, "message" => $message_html, "contacts" => $contacts_html));
    //Подключаем подвал
    $html .= template_get('footer');
    return $html;
}
开发者ID:jsib,项目名称:dumps.loc,代码行数:32,代码来源:index.php

示例3: page_contact

function page_contact()
{
    $user_name = $_GET['name'];
    $user = db_easy("SELECT * FROM `users` WHERE `name`='" . $user_name . "'");
    $edit_del_comment_html = "";
    if (check_group("writer") || $user['name'] == get_user()) {
    }
    $html .= template_get('contacts/contact', array("name_rus" => $user['name_rus'], "position" => $user['position'], "mobile_phone" => $user['mobile_phone']));
    //Подключаем подвал
    $html .= template_get('footer');
    return $html;
}
开发者ID:jsib,项目名称:dumps.loc,代码行数:12,代码来源:contact.php

示例4: message

 }
 if ($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit'] * 86400) {
     message(lang($L['edit_limit'], array($MG['edit_limit'])));
 }
 if ($submit) {
     if ($item['islink']) {
         $post['islink'] = 1;
     } else {
         if (isset($post['islink'])) {
             unset($post['islink']);
         }
     }
     //$post['clear_link'] = $MOD['clear_link'];
     if ($do->pass($post)) {
         $CAT = get_cat($post['catid']);
         if (!$CAT || !check_group($_groupid, $CAT['group_add'])) {
             dalert(lang($L['group_add'], array($CAT['catname'])));
         }
         $post['addtime'] = timetodate($item['addtime']);
         $post['level'] = $item['level'];
         $post['fee'] = $item['fee'];
         $post['style'] = $item['style'];
         $post['template'] = $item['template'];
         $post['filepath'] = $item['filepath'];
         $post['note'] = $item['note'];
         $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
         $post['status'] = get_status($item['status'], $need_check);
         $post['hits'] = $item['hits'];
         $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0;
         $post['clear_link'] = $MOD['clear_link'] ? 1 : 0;
         $post['get_introduce'] = $MOD['get_introduce'] ? 1 : 0;
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:my.inc.php

示例5: check_group

<?php

include "inc/common.php";
// check if valid group specified and return group details
$groupdetails = check_group($_POST, $_GET);
// get permisssions for group
$permissions = group_permissions($groupdetails['group_id'], $user->data['user_id']);
if (!$permissions) {
    fatal_error("No permissions for this group");
}
// get post mode
if (isset($_POST['mode'])) {
    $mode = $_POST['mode'];
} elseif (isset($_GET['mode'])) {
    $mode = $_GET['mode'];
} else {
    $mode = "showexpenses";
}
// get user id if specified
if (isset($_POST['uid'])) {
    $uid = $_POST['uid'];
} elseif (isset($_GET['uid'])) {
    $uid = $_GET['uid'];
}
// get paid / spent if specified
if (isset($_POST['xtype'])) {
    $xtype = $_POST['xtype'];
} elseif (isset($_GET['xtype'])) {
    $xtype = $_GET['xtype'];
}
// get message
开发者ID:Whiskey24,项目名称:GoingDutchApi,代码行数:31,代码来源:expenses.php

示例6: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if ($DT_BOT) {
    dhttp(403);
}
require DT_ROOT . '/module/' . $module . '/common.inc.php';
check_referer() or dheader($MOD['linkurl']);
$itemid = intval(decrypt($auth));
$itemid or dheader($MOD['linkurl']);
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid} AND status>2");
$item or dheader($MOD['linkurl']);
extract($item);
$CAT = get_cat($catid);
$linkurl = $MOD['linkurl'] . $linkurl;
if (!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $MOD['group_contact']) || !check_group($_groupid, $CAT['group_show'])) {
    dheader($linkurl);
}
$fee = get_fee($item['fee'], $MOD['fee_view']);
if ($MG['fee_mode'] && $MOD['fee_mode']) {
    $fee = 0;
}
if ($item['username'] == $_username) {
    $fee = 0;
}
if ($fee) {
    if ($_userid) {
        check_pay($moduleid, $itemid) or dheader($linkurl);
    } else {
        dheader($linkurl);
    }
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:down.inc.php

示例7: property_option

$CP = $MOD['cat_property'] && $CAT['property'];
if ($CP) {
    require DT_ROOT . '/include/property.func.php';
    $options = property_option($catid);
    $values = property_value($moduleid, $itemid);
}
$adddate = timetodate($addtime, 5);
$editdate = timetodate($edittime, 5);
$todate = $totime ? timetodate($totime, 3) : 0;
$expired = $totime && $totime < $DT_TIME ? true : false;
$linkurl = $MOD['linkurl'] . $linkurl;
$thumbs = get_albums($item);
$albums = get_albums($item, 1);
$update = '';
$fee = get_fee($item['fee'], $MOD['fee_view']);
if (check_group($_groupid, $MOD['group_contact'])) {
    if ($fee) {
        $user_status = 4;
        $destoon_task = "moduleid={$moduleid}&html=show&itemid={$itemid}";
    } else {
        $user_status = 3;
        $member = $item['username'] ? userinfo($item['username']) : array();
        if ($item['totime'] && $item['totime'] < $DT_TIME && $item['status'] == 3) {
            $update .= ",status=4";
        }
        if ($member) {
            foreach (array('groupid', 'vip', 'validated', 'company', 'areaid', 'truename', 'telephone', 'mobile', 'address', 'qq', 'msn', 'ali', 'skype') as $v) {
                if ($item[$v] != $member[$v]) {
                    $update .= ",{$v}='" . addslashes($member[$v]) . "'";
                }
            }
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:show.inc.php

示例8: template

             }
             $db->free_result($result);
         }
     }
     $head_name = $L['user_title'];
     $head_title = $head_name . $DT['seo_delimiter'] . $head_title;
     $foot = '';
     include template('know_user', 'mobile');
     if (DT_CHARSET != 'UTF-8') {
         toutf8();
     }
     break;
 case 'answer':
     $itemid or dheader(mobileurl($moduleid));
     $_userid or dheader('login.php?forward=' . urlencode('know.php?action=' . $action . '&itemid=' . $itemid));
     check_group($_groupid, $MOD['group_answer']) or mobile_msg($L['know_msg_right']);
     $item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}");
     $item && $item['status'] > 2 or mobile_msg($L['know_msg_not_question']);
     if ($item['process'] != 1 || $_username && $_username == $item['username']) {
         mobile_msg($L['know_msg_right']);
     }
     if (!$MOD['answer_repeat']) {
         if ($_username) {
             $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE username='{$_username}' AND qid={$itemid}");
         } else {
             $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE ip='{$DT_IP}' AND qid={$itemid} AND addtime>{$DT_TIME}-86400");
         }
         if ($r) {
             mobile_msg($L['know_msg_has_answered']);
         }
     }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:know.php

示例9: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if ($DT_BOT) {
    dhttp(403);
}
$itemid or dheader($MOD['linkurl']);
login();
require DT_ROOT . '/module/' . $module . '/common.inc.php';
if (!check_group($_groupid, $MOD['group_talent'])) {
    include load('403.inc');
}
$item = $db->get_one("SELECT * FROM {$DT_PRE}resume WHERE itemid={$itemid} AND status=3");
$item or dheader($MOD['linkurl']);
if ($item['open'] != 3) {
    message($L['msg_resume_close'], $MOD['linkurl']);
}
if ($item['username'] == $_username) {
    message($L['msg_add_self'], $MOD['linkurl']);
}
$linkurl = $MOD['linkurl'] . $item['linkurl'];
$item = $db->get_one("SELECT * FROM {$DT_PRE}job_talent WHERE resumeid={$itemid} AND username='{$_username}'");
if ($item) {
    message($L['msg_talent_exist'], $linkurl);
}
$db->query("INSERT INTO {$DT_PRE}job_talent (resumeid,username,jointime) VALUES ('{$itemid}','{$_username}','{$DT_TIME}')");
message($L['msg_talent_success'], $linkurl);
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:talent.inc.php

示例10: defined

defined('IN_DESTOON') or exit('Access Denied');
$MG['club_reply_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
require MD_ROOT . '/reply.class.php';
$do = new reply();
$sql = $_userid ? "username='{$_username}'" : "ip='{$DT_IP}'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
$today = $today_endtime - 86400;
if (in_array($action, array('', 'add')) && $MG['club_reply_limit']) {
    $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table}_reply WHERE {$sql} AND status>1 AND addtime>{$today}");
    $limit_used = $r['num'];
    $limit_free = $MG['club_reply_limit'] > $limit_used ? $MG['club_reply_limit'] - $limit_used : 0;
}
switch ($action) {
    case 'add':
        check_group($_groupid, $MOD['group_reply']) or dalert(lang('message->without_permission_and_upgrade'), 'goback');
        $tid = isset($tid) ? intval($tid) : 0;
        $tid or dalert($L['my_choose_post'], $MOD['linkurl']);
        $T = $db->get_one("SELECT * FROM {$table} WHERE itemid={$tid}");
        $T && $T['status'] == 3 or dalert($L['my_not_post']);
        $gid = $T['gid'];
        $GRP = get_group($gid);
        $GRP && $GRP['status'] == 3 or dalert($L['my_not_group']);
        if ($MG['club_reply_limit'] && $limit_used >= $MG['club_reply_limit']) {
            dalert(lang($L['day_limit'], array($MG['club_reply_limit'], $limit_used)), $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid . '&job=' . $job);
        }
        if ($GRP['reply_type'] && !is_fans($GRP)) {
            $action = 'reply';
            $head_title = lang('message->without_permission');
            exit(include template('nofans', $module));
        }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:30,代码来源:my_reply.inc.php

示例11: credit_record

             credit_record($_username, $MOD['credit_answer'], 'system', $L['answer_question'], 'ID:' . $itemid);
         }
     }
     if ($MOD['answer_message'] && $item['username']) {
         send_message($item['username'], lang($L['answer_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['answer_msg_content'], array($item['title'], stripslashes($content), $linkurl)));
     }
     if ($status == 3) {
         $items = isset($items) ? intval($items) + 1 : 1;
         $page = ceil($items / $pagesize);
         $forward = 'answer.php?itemid=' . $itemid . '&page=' . $page . '&rand=' . mt_rand(10, 99) . '#last';
         dalert('', '', 'parent.window.location="' . $forward . '";');
     } else {
         dalert($L['answer_check'], '', 'parent.window.location=parent.window.location;');
     }
 } else {
     $could_vote = check_group($_groupid, $MOD['group_vote']);
     if (get_cookie('answer_vote_' . $itemid)) {
         $could_vote = false;
     }
     $pages = '';
     $answers = array();
     $items = $db->count($table . '_answer', "qid={$itemid} AND status=3 AND itemid!={$item['aid']}");
     $a = $items;
     if ($item['aid']) {
         $a += 1;
     }
     if ($item['answer'] != $a) {
         $item['answer'] = $a;
         $db->query("UPDATE {$table} SET answer={$a} WHERE itemid={$itemid}");
     }
     if ($item['process'] == 1 && $item['username'] && !$item['message'] && $MOD['messagedays']) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:answer.inc.php

示例12: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if ($DT_BOT) {
    dhttp(403);
}
$itemid or dheader($MOD['linkurl']);
login();
if (!check_group($_groupid, $MOD['group_apply'])) {
    include load('403.inc');
}
require DT_ROOT . '/module/' . $module . '/common.inc.php';
include load('misc.lang');
$item = $db->get_one("SELECT * FROM {$DT_PRE}job WHERE itemid={$itemid}");
$item or message($L['not_exists']);
if ($item['totime'] && $DT_TIME > $item['totime']) {
    message($L['has_expired']);
}
$item['status'] == 3 or message($L['not_exists']);
$item['username'] or message($L['com_not_member']);
$_username != $item['username'] or message($L['send_self']);
$app = $db->get_one("SELECT * FROM {$DT_PRE}job_apply WHERE jobid={$itemid} AND apply_username='{$_username}'");
if ($app) {
    message($L['apply_again']);
}
$linkurl = $MOD['linkurl'] . $item['linkurl'];
if ($submit) {
    $resumeid = intval($resumeid);
    $resumeid or dheader($linkurl);
    $resume = $db->get_one("SELECT * FROM {$DT_PRE}resume WHERE itemid={$resumeid} AND status=3 AND open=3 AND username='{$_username}'");
    $resume or message($L['not_resume'], $linkurl);
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:apply.inc.php

示例13: question

 if ($verify == 2) {
     question($answer, 1);
 }
 $could_vote = true;
 $condition = $_username ? "AND username='{$_username}'" : "AND ip='{$DT_IP}'";
 $r = $db->get_one("SELECT rid FROM {$DT_PRE}vote_record WHERE itemid={$itemid} {$condition}");
 if ($r) {
     $could_vote = false;
 }
 if ($fromtime && $DT_TIME < $fromtime) {
     $could_vote = false;
 }
 if ($totime && $DT_TIME > $totime) {
     $could_vote = false;
 }
 if (!check_group($_groupid, $groupids)) {
     $could_vote = false;
 }
 if ($could_vote) {
     if ($item['choose']) {
         $ids = array();
         $num = 0;
         foreach ($vote as $k => $v) {
             $s = 's' . $v;
             if (${$s}) {
                 $ids[] = $v;
                 ++$num;
             }
         }
         if ($num >= $vote_min && $num <= $vote_max) {
             foreach ($ids as $k => $v) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:vote.inc.php

示例14: elseif

            }
        } elseif (!in_array($g->ns(), array('study', 'promo', 'binet', 'free'))) {
            echo "Error: Unknown NS " . $g->ns() . " for group " . $gtext . "\n";
        }
    }
}
// Fetch groups
$groups = Group::selectAll(GroupSelect::base())->select(GroupSelect::castes());
$groups = $groups->toArray();
krsort($groups);
// Remember used castes
$used_castes = array();
echo "Checking " . count($groups) . " groups\n";
while (!empty($groups)) {
    $g = array_pop($groups);
    check_group($g);
    foreach ($g->castes() as $c) {
        array_push($used_castes, $c->id());
    }
    // Frees memory
    unset($g);
}
// Fetch castes
$cf = new CasteFilter();
$castes = $cf->get();
unset($cf);
echo "There are " . $castes->count() . " castes.\n";
// Unused castes
$unused_castes = array_diff($castes->ids(), $used_castes);
if (!empty($unused_castes)) {
    echo "Warning: " . count($unused_castes) . " unused castes\n";
开发者ID:netixx,项目名称:frankiz,代码行数:31,代码来源:check.groups.php

示例15: dalert

     $could_del or dalert($L['comment_msg_del']);
     $cid = isset($cid) ? intval($cid) : 0;
     $cid or dalert($L['comment_msg_cid']);
     $r = $db->get_one("SELECT * FROM {$DT_PRE}comment WHERE itemid='{$cid}' LIMIT 1");
     if ($r) {
         $star = 'star' . $r['star'];
         $db->query("UPDATE {$DT_PRE}comment_stat SET comment=comment-1,`{$star}`=`{$star}`-1 WHERE itemid={$r['item_id']} AND moduleid={$r['item_mid']}");
         $db->query("DELETE FROM {$DT_PRE}comment WHERE itemid={$cid}");
         $forward = rewrite('index.php?mid=' . $mid . '&itemid=' . $itemid . '&page=' . $page . '&rand=' . mt_rand(10, 99));
         dalert($L['comment_msg_del_success'], '', 'parent.window.location="' . $forward . '";');
     } else {
         dalert($L['comment_msg_not_comment']);
     }
     break;
 default:
     if (check_group($_groupid, $MOD['comment_group'])) {
         $user_status = 3;
     } else {
         if ($_userid) {
             $user_status = 1;
         } else {
             $user_status = 2;
         }
     }
     $need_captcha = $MOD['comment_captcha_add'] == 2 ? $MG['captcha'] : $MOD['comment_captcha_add'];
     if ($MOD['comment_pagesize']) {
         $pagesize = $MOD['comment_pagesize'];
         $offset = ($page - 1) * $pagesize;
     }
     if ($submit) {
         if ($user_status != 3) {
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:comment_list.inc.php


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