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


PHP vB_Bitfield_Builder::build方法代码示例

本文整理汇总了PHP中vB_Bitfield_Builder::build方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_Bitfield_Builder::build方法的具体用法?PHP vB_Bitfield_Builder::build怎么用?PHP vB_Bitfield_Builder::build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vB_Bitfield_Builder的用法示例。


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

示例1: print_cp_no_permission

    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('forumid' => TYPE_INT, 'moderatorid' => TYPE_UINT, 'userid' => TYPE_UINT, 'modusername' => TYPE_STR, 'redir' => TYPE_NOHTML));
// ############################# LOG ACTION ###############################
log_admin_action($vbulletin->GPC['moderatorid'] != 0 ? " moderator id = " . $vbulletin->GPC['moderatorid'] : ($vbulletin->GPC['forumid'] != 0 ? "forum id = " . $vbulletin->GPC['forumid'] : ($vbulletin->GPC['userid'] != 0 ? "user id = " . $vbulletin->GPC['userid'] : (!empty($vbulletin->GPC['modusername']) ? "mod username = " . $vbulletin->GPC['modusername'] : ''))));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['moderator_manager']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ###################### Start add / edit moderator #######################
if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit' or $_REQUEST['do'] == 'editglobal') {
    require_once DIR . '/includes/class_bitfield_builder.php';
    if (vB_Bitfield_Builder::build(false) !== false) {
        $myobj =& vB_Bitfield_Builder::init();
        if (sizeof($myobj->data['misc']['moderatorpermissions']) != sizeof($vbulletin->bf_misc_moderatorpermissions) or sizeof($myobj->data['misc']['moderatorpermissions2']) != sizeof($vbulletin->bf_misc_moderatorpermissions2)) {
            $myobj->save($db);
            define('CP_REDIRECT', $vbulletin->scriptpath);
            print_stop_message('rebuilt_bitfields_successfully');
        }
    } else {
        echo "<strong>error</strong>\n";
        print_r(vB_Bitfield_Builder::fetch_errors());
    }
    if ($_REQUEST['do'] == 'editglobal') {
        $moderator = $db->query_first("\n\t\t\tSELECT user.username, user.userid,\n\t\t\tmoderator.forumid, moderator.permissions, moderator.permissions2, moderator.moderatorid\n\t\t\tFROM " . TABLE_PREFIX . "user AS user\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "moderator AS moderator ON (moderator.userid = user.userid AND moderator.forumid = -1)\n\t\t\tWHERE user.userid = " . $vbulletin->GPC['userid']);
        print_form_header('moderator', 'update');
        construct_hidden_code('forumid', '-1');
        construct_hidden_code('modusername', $moderator['username'], false);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:moderator.php

示例2: print_table_header

     print_table_header(construct_phrase($vbphrase['edit_permissions_for_x_in_y'], $usergroup_info['title'], $project['title_clean']), sizeof($issuetype_options) + 1);
     // fetch the custom perms, row per type this time
     $customperms = array();
     $customperms_data = $db->query_read("\n\t\t\tSELECT *\n\t\t\tFROM " . TABLE_PREFIX . "pt_projectpermission\n\t\t\tWHERE usergroupid = {$usergroup_info['usergroupid']}\n\t\t\t\tAND projectid = {$project['projectid']}\n\t\t");
     while ($customperm = $db->fetch_array($customperms_data)) {
         $perms = $customperm;
         unset($perms['usergroupid'], $perms['projectid'], $perms['issuetypeid']);
         $customperms["{$customperm['issuetypeid']}"] = $perms;
     }
 } else {
     // editing global permissions
     print_table_header(construct_phrase($vbphrase['edit_permissions_for_x'], $usergroup_info['title']), sizeof($issuetype_options) + 1);
     $customperms = array();
 }
 require_once DIR . '/includes/class_bitfield_builder.php';
 vB_Bitfield_Builder::build(false);
 $builder =& vB_Bitfield_Builder::init();
 $perms = array();
 $has_custom = array();
 if (!$project) {
     // these are the global-only (settable in one place) permissions for the project tools
     print_description_row($vbphrase['global_project_tools_permissions'], false, 4, 'thead');
     foreach ($builder->data['ugp']['ptpermissions'] as $bitname => $permvalue) {
         $bit = $permvalue['value'];
         print_yes_no_row($vbphrase["{$permvalue['phrase']}"], "ugpermissions[{$bit}]", intval($usergroup_info['ptpermissions']) & intval($bit) ? 1 : 0);
     }
     print_description_row('<span class="smallfont"><a href="#" onclick="js_open_help(\'projectpermission\', \'edit\', \'about_reports\'); return false;">' . $vbphrase['what_are_reports'] . '</a></span>', false, 2, '', 'right');
     print_table_break();
     print_table_header(construct_phrase($vbphrase['project_tools_permissions_for_x'], $usergroup_info['title']), sizeof($issuetype_options) + 1);
 } else {
     // project specific -- let's check the general permissions for this group
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:projectpermission.php

示例3: return_data

 /**
  * Returns a multi-dimensional array of all defined bitfields, including <nocache> and disabled products
  *
  * $vbulletin->bf_ugp_forumpermissions['canview'] would be returned as $array['ugp']['forumpermissions']['canview']
  *
  * @return	array
  */
 function return_data()
 {
     if (vB_Bitfield_Builder::build(true, true) === false) {
         return false;
     }
     $obj =& vB_Bitfield_Builder::init();
     return $obj->data;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:15,代码来源:class_bitfield_builder.php

示例4: build_project_bitfields

/**
* Builds the cache of project bitfields (for perms) into $vbulletin->pt_bitfields.
* Accessed as [groupid][bitname] => value
*
* @return	array	Bitfield cache
*/
function build_project_bitfields()
{
    global $vbulletin;
    require_once DIR . '/includes/class_bitfield_builder.php';
    vB_Bitfield_Builder::build(false);
    $builder =& vB_Bitfield_Builder::init();
    $bits = array();
    if ($builder->data['pt_permissions']) {
        foreach ($builder->data['pt_permissions'] as $groupid => $permission_group) {
            foreach ($permission_group as $bitname => $permvalue) {
                $bits["{$groupid}"]["{$bitname}"] = intval(is_array($permvalue) ? $permvalue['value'] : $permvalue);
            }
        }
    }
    build_datastore('pt_bitfields', serialize($bits), 1);
    $vbulletin->pt_bitfields = $bits;
    return $bits;
}
开发者ID:holandacz,项目名称:nb4,代码行数:24,代码来源:adminfunctions_projecttools.php


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