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


PHP vB_Bitfield_Builder::save方法代码示例

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


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

示例1: disable

 /**
  * Disable a product, not delete
  *
  */
 public function disable($productid = null)
 {
     $productid = $productid ? $productid : $this->productinfo['productid'];
     $this->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "product\n\t\t\tSET active = 0\n\t\t\tWHERE productid = '" . $this->db->escape_string($productid) . "'\n\t\t");
     vBulletinHook::build_datastore($this->db);
     build_product_datastore();
     // build bitfields to remove/add this products bitfields
     require_once DIR . '/includes/class_bitfield_builder.php';
     vB_Bitfield_Builder::save($this->db);
     // Products can enable a cron entries, so we need to rebuild that as well
     require_once DIR . '/includes/functions_cron.php';
     build_cron_next_run();
     // Purge cache -- doesn't apply to pre-vB4 versions
     if (class_exists('vB_Cache')) {
         vB_Cache::instance()->purge('vb_types.types');
     }
     // Reload blocks and block types -- doesn't apply to pre-vB4 versions
     if (class_exists('vB_BlockManager')) {
         $blockmanager = vB_BlockManager::create($this->registry);
         $blockmanager->reloadBlockTypes();
         $blockmanager->getBlocks(true, true);
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:class_upgrade_product.php

示例2:

		echo "<p>&nbsp;</p></blockquote>";
	}
	else
	{
		echo "<blockquote><p>&nbsp;</p>";
		echo "$vbphrase[upgrade_wrong_version]";
		echo "<p>&nbsp;</p></blockquote>";
		print_upgrade_footer();
	}
}

// #############################################################################
if ($vbulletin->GPC['step'] == 1)
{
	require_once(DIR . '/includes/class_bitfield_builder.php');
	vB_Bitfield_Builder::save($db);

	$upgrade->add_index(
		sprintf($upgrade_phrases['upgrade_300b3.php']['altering_x_table'], 'socialgroup', 1, 4),
		'socialgroup',
		'visible',
		'visible'
	);

	$upgrade->add_index(
		sprintf($upgrade_phrases['upgrade_300b3.php']['altering_x_table'], 'socialgroup', 2, 4),
		'socialgroup',
		'picturecount',
		'picturecount'
	);
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:upgrade_370b5.php

示例3: implode

            }
            $vbulletin->input->clean_gpc('r', "num{$group}", vB_Cleaner::TYPE_UINT);
            for ($i = 0; $i < $vbulletin->GPC["num{$group}"]; $i++) {
                $vbulletin->GPC['navprefs'][] = $group . "_{$i}";
            }
        }
        $vbulletin->GPC['navprefs'] = implode(',', $vbulletin->GPC['navprefs']);
    } else {
        $vbulletin->GPC['navprefs'] = '';
    }
    $vbulletin->GPC['navprefs'] = preg_replace('#[^a-z0-9_,]#i', '', $vbulletin->GPC['navprefs']);
    $_REQUEST['do'] = 'savenavprefs';
}
if ($_REQUEST['do'] == 'buildbitfields') {
    require_once DIR . '/includes/class_bitfield_builder.php';
    vB_Bitfield_Builder::save();
    build_channel_permissions();
    print_stop_message2('rebuilt_bitfields_successfully', 'index');
}
if ($_REQUEST['do'] == 'buildvideo' and (vB::getUserContext()->hasAdminPermission('canadminstyles') or vB::getUserContext()->hasAdminPermission('canadmintemplates'))) {
    require_once DIR . '/includes/functions_databuild.php';
    build_bbcode_video();
    print_cp_header();
    vB_Library::instance('style')->buildAllStyles();
    print_stop_message2('rebuilt_video_bbcodes_successfully', 'index');
}
if ($_REQUEST['do'] == 'buildnavprefs') {
    $vbulletin->input->clean_array_gpc('r', array('prefs' => vB_Cleaner::TYPE_STR, 'dowhat' => vB_Cleaner::TYPE_STR, 'id' => vB_Cleaner::TYPE_INT));
    $vbulletin->GPC['prefs'] = preg_replace('#[^a-z0-9_,]#i', '', $vbulletin->GPC['prefs']);
    $_tmp = preg_split('#,#', $vbulletin->GPC['prefs'], -1, PREG_SPLIT_NO_EMPTY);
    $_navprefs = array();
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:index.php

示例4: step_7

    /**
     * Step #7 - Default User Setup...
     *
     */
    function step_7($data = null)
    {
        if ($data['response']) {
            array_map('trim', $data['htmldata']);
            $errors = array();
            if (empty($data['htmldata']['username'])) {
                $errors['username'] = $this->phrase['install']['error_username'];
            }
            if (empty($data['htmldata']['email']) or !is_valid_email($data['htmldata']['email'])) {
                $errors['email'] = $this->phrase['install']['error_email'];
            }
            if (empty($data['htmldata']['password']) or empty($data['htmldata']['confirmpassword'])) {
                if (empty($data['htmldata']['password'])) {
                    $errors['password'] = $this->phrase['install']['error_password'];
                } else {
                    if (empty($data['htmldata']['confirmpassword'])) {
                        $errors['confirmpassword'] = $this->phrase['install']['error_confirmpassword'];
                    }
                }
            } else {
                if ($data['htmldata']['password'] != $data['htmldata']['confirmpassword']) {
                    $errors['mismatch'] = $this->phrase['install']['error_password_not_match'];
                } else {
                    if ($data['htmldata']['password'] == $data['htmldata']['username'] and !defined('ALLOW_SAME_USERNAME_PASSWORD')) {
                        $errors['samepasswordasusername'] = $this->phrase['install']['error_same_password_as_username'];
                    }
                }
            }
            // check if a user already exists. If so, DO NOT CREATE A NEW USER.
            $vbexists = $this->fetch_vbexists();
            if (!$vbexists) {
                $errors[] = $this->phrase['install']['user_table_missing'];
                // we can't create a user without a user table.
            } else {
                // assuming if user table exists, userid will exist. If a user exists, DO NOT CREATE A NEW USER
                if ($this->db->query_first("SELECT userid FROM " . trim($this->registry->config['Database']['tableprefix']) . "user LIMIT 1")) {
                    $errors[] = $this->phrase['install']['user_already_exists'];
                }
            }
            if (empty($errors)) {
                require_once DIR . '/includes/class_bitfield_builder.php';
                vB_Bitfield_Builder::save($this->db);
                $admin_defaults = array('vbasset_enable', 'showsignatures', 'showavatars', 'showimages', 'adminemail', 'dstauto', 'receivepm', 'showusercss', 'receivefriendemailrequest', 'vm_enable');
                $admin_useroption = 0;
                foreach ($admin_defaults as $bitfield) {
                    $admin_useroption |= $this->registry->bf_misc_useroptions["{$bitfield}"];
                }
                require_once DIR . '/includes/functions_user.php';
                //for now we'll just include these to get the define for the salt length.  Should investigate
                //using the DM to add the initial admin user, but there may be issues with doing that without
                //a proper user session (which we can't have until we require the user.
                require_once DIR . '/includes/class_dm.php';
                require_once DIR . '/includes/class_dm_user.php';
                $salt = fetch_user_salt(SALT_LENGTH);
                /*insert query*/
                $this->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "user\n\t\t\t\t\t\t(username, salt, password, email, usertitle, joindate, lastvisit, lastactivity, usergroupid, passworddate, options, showvbcode)\n\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . $this->db->escape_string(htmlspecialchars_uni($data['htmldata']['username'])) . "',\n\t\t\t\t\t\t'" . $this->db->escape_string($salt) . "',\n\t\t\t\t\t\t'" . $this->db->escape_string(md5(md5($data['htmldata']['password']) . $salt)) . "',\n\t\t\t\t\t\t'" . $this->db->escape_string($data['htmldata']['email']) . "',\n\t\t\t\t\t\t'" . $this->db->escape_string($this->phrase['install']['usergroup_admin_usertitle']) . "',\n\t\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t\t6,\n\t\t\t\t\t\tFROM_UNIXTIME(" . TIMENOW . "),\n\t\t\t\t\t\t{$admin_useroption},\n\t\t\t\t\t\t2\n\t\t\t\t\t)\n\t\t\t\t");
                $userid = $this->db->insert_id();
                /*insert query*/
                $this->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "usertextfield\n\t\t\t\t\t\t(userid)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$userid})\n\t\t\t\t");
                /*insert query*/
                $this->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "userfield\n\t\t\t\t\t\t(userid)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$userid})\n\t\t\t\t");
                /*insert query*/
                $this->db->query_write("INSERT INTO " . TABLE_PREFIX . "administrator\n\t\t\t\t\t(userid, adminpermissions)\n\t\t\t\tVALUES\n\t\t\t\t\t({$userid}, " . (array_sum($this->registry->bf_ugp_adminpermissions) - 3) . ")\n\t\t\t\t");
                /*insert query*/
                $this->db->query_write("INSERT INTO " . TABLE_PREFIX . "moderator\n\t\t\t\t\t(userid, forumid, permissions, permissions2)\n\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\t{$userid},\n\t\t\t\t\t\t-1,\n\t\t\t\t\t\t" . (array_sum($this->registry->bf_misc_moderatorpermissions) - ($this->registry->bf_misc_moderatorpermissions['newthreademail'] + $this->registry->bf_misc_moderatorpermissions['newpostemail'])) . ",\n\t\t\t\t\t\t" . array_sum($this->registry->bf_misc_moderatorpermissions2) . "\n\t\t\t\t\t)\n\t\t\t\t");
                build_image_cache('smilie');
                build_image_cache('avatar');
                build_image_cache('icon');
                build_bbcode_cache();
                require_once DIR . '/includes/functions_databuild.php';
                build_user_statistics();
                require_once DIR . '/includes/adminfunctions_forums.php';
                build_forum_child_lists();
                build_forum_permissions();
                require_once DIR . '/includes/functions_cron.php';
                build_cron_next_run();
                require_once DIR . '/includes/adminfunctions_attachment.php';
                build_attachment_permissions();
                require_once DIR . '/includes/class_block.php';
                $blockmanager = vB_BlockManager::create($this->registry);
                $blockmanager->reloadBlockTypes();
                $this->show_message($this->phrase['install']['administrator_account_created']);
                return;
            } else {
                foreach ($errors as $key => $value) {
                    $errors["{$key}"] = '<span class="usererror">' . $value . '</span>';
                }
            }
        } else {
            $data['htmldata'] = array();
        }
        $html = '<table cellspacing="0" cellpadding="4" border="0" align="center" width="100%" id="cpform_table" class="" style="border-collapse: separate;">
<tbody>
<tr valign="top">
	<td class="alt1">' . $this->phrase['install']['username'] . $errors['username'] . '
		<span id="htmldata[username]_error" class="usererror hidden">' . $this->phrase['install']['field_required'] . '</span>
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:class_upgrade_install.php

示例5: install_product


//.........这里部分代码省略.........
				" . intval($faq['displayorder']) . ",
				1,
				'" . $db->escape_string($info['productid']) . "')
			";
		}

		if ($sql)
		{
			/*insert query*/
			$db->query_write("
				REPLACE INTO " . TABLE_PREFIX . "faq
					(faqname, faqparent, displayorder, volatile, product)
				VALUES
					" . implode(',', $sql) . "
			");
		}
	}

	// Check if the plugin system is disabled. If it is, enable it.
	if (!$vbulletin->options['enablehooks'])
	{
		$db->query_write("
			UPDATE " . TABLE_PREFIX . "setting
			SET value = '1'
			WHERE varname = 'enablehooks'
		");

		$rebuild['options'] = true;
	}

	// Now rebuild everything we need...
	if ($rebuild['plugins'])
	{
		vBulletinHook::build_datastore($db);

		if ($active)
		{
			$plugin_data = $db->query_read("
				SELECT *
				FROM " . TABLE_PREFIX . "datastore
				WHERE title IN ('pluginlist', 'pluginlistadmin')
			");
			while ($plugin_info = $db->fetch_array($plugin_data))
			{
				if ($plugin_info['title'] == 'pluginlist')
				{
					$vbulletin->pluginlist = unserialize($plugin_info['data']);
				}
				else if ($plugin_info['title'] == 'pluginlistadmin')
				{
					$vbulletin->pluginlistadmin = unserialize($plugin_info['data']);
				}
			}

			// enable any hooks -- this is mainly necessary for importing templates (template_safe_functions hook)
			if (!defined('DISABLE_HOOKS'))
			{
				if (!empty($vbulletin->pluginlistadmin) AND is_array($vbulletin->pluginlistadmin))
				{
					$vbulletin->pluginlist = array_merge($vbulletin->pluginlist, $vbulletin->pluginlistadmin);
					unset($vbulletin->pluginlistadmin);
				}
				vBulletinHook::set_pluginlist($vbulletin->pluginlist);
			}
		}
	}

	if ($rebuild['templates'])
	{
		build_all_styles();
	}
	if ($rebuild['phrases'])
	{
		require_once(DIR . '/includes/adminfunctions_language.php');
		build_language();
	}
	if ($rebuild['options'])
	{
		build_options();
	}
	if ($rebuild['cron'])
	{
		require_once(DIR . '/includes/functions_cron.php');
		build_cron_next_run();
	}

	build_product_datastore();

	// build bitfields to remove/add this products bitfields
	vB_Bitfield_Builder::save($db);

	// reload block types
	$blockmanager = vB_BlockManager::create($vbulletin);
	$blockmanager->reloadBlockTypes();

	print_dots_stop();

	$info['need_merge'] = ($rebuild['templates'] AND $installed_version);
	return $info;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:adminfunctions_plugin.php

示例6: process_script_end

 /**
  * Things to do after each script is processed
  *
  */
 protected function process_script_end()
 {
     build_bbcode_cache();
     build_options();
     require_once DIR . '/includes/functions_databuild.php';
     build_bbcode_video(true);
     require_once DIR . '/includes/class_bitfield_builder.php';
     vB_Bitfield_Builder::save($this->db);
     build_forum_permissions();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:14,代码来源:class_upgrade.php

示例7: install_product


//.........这里部分代码省略.........
            $scheduling['day'] = intval($scheduling['day']);
            $scheduling['hour'] = intval($scheduling['hour']);
            $scheduling['minute'] = explode(',', preg_replace('#[^0-9,-]#i', '', $scheduling['minute']));
            if (count($scheduling['minute']) == 0) {
                $scheduling['minute'] = array(0);
            } else {
                $scheduling['minute'] = array_map('intval', $scheduling['minute']);
            }
            /*insert query*/
            $cronSql[] = array('weekday' => $scheduling['weekday'], 'day' => $scheduling['day'], 'hour' => $scheduling['hour'], 'minute' => serialize($scheduling['minute']), 'filename' => $cron['filename'], 'loglevel' => $cron['loglevel'], 'active' => $cron['active'], 'varname' => $cron['varname'], 'volatile' => 1, 'product' => $info['productid']);
            $cronid = $assertor->assertQuery('replaceValues', array('values' => $cronSql, 'table' => 'cron', 'returnId' => true));
            if ($cronid) {
                build_cron_item($cronid);
            }
            $rebuild['cron'] = true;
        }
    }
    // ############## import faq
    if (isset($arr['faqentries']['faq']) and is_array($arr['faqentries']['faq'])) {
        $faq_entries =& $arr['faqentries']['faq'];
        if (!isset($faq_entries[0])) {
            $faq_entries = array($faq_entries);
        }
        $sql = array();
        foreach ($faq_entries as $faq) {
            $sql[] = array('faqname' => $faq['faqname'], 'faqparent' => $faq['faqparent'], 'displayorder' => intval($faq['displayorder']), 'volatile' => 1, 'product' => $info['productid']);
        }
        if ($sql) {
            /*insert query*/
            $assertor->assertQuery('replaceValues', array('values' => $sql, 'table' => 'faq'));
        }
    }
    // ############## import widgets
    if (isset($arr['widgets']['widget']) and is_array($arr['widgets']['widget'])) {
        $widgetImporter = new vB_Xml_Import_Widget($info['productid']);
        $widgetImporter->importFromParsedXML($arr['widgets']);
    }
    // ############## import pagetemplates
    if (isset($arr['pagetemplates']['pagetemplate']) and is_array($arr['pagetemplates']['pagetemplate'])) {
        $pageTemplateImporter = new vB_Xml_Import_PageTemplate($info['productid']);
        $pageTemplateImporter->importFromParsedXML($arr['pagetemplates']);
    }
    // ############## import page
    if (isset($arr['pages']['page']) and is_array($arr['pages']['page'])) {
        $pageImporter = new vB_Xml_Import_Page($info['productid']);
        $pageImporter->importFromParsedXML($arr['pages']);
    }
    // ############## import channels
    if (isset($arr['channels']['channel']) and is_array($arr['channels']['channel'])) {
        $channelImporter = new vB_Xml_Import_Channel($info['productid']);
        $channelImporter->importFromParsedXML($arr['channels']);
    }
    // ############## import routes
    if (isset($arr['routes']['route']) and is_array($arr['routes']['route'])) {
        $routeImporter = new vB_Xml_Import_Route($info['productid']);
        $routeImporter->importFromParsedXML($arr['routes']);
    }
    if (isset($routeImporter)) {
        // update pages and channels with new route ids
        if (isset($pageImporter)) {
            $pageImporter->updatePageRoutes();
        }
        if (isset($channelImporter)) {
            $channelImporter->updateChannelRoutes();
        }
    }
    // Check if the hook system is disabled. If it is, enable it.
    if (!$vbulletin->options['enablehooks']) {
        $assertor->update('setting', array('value' => 1), array('varname' => 'enablehooks'));
        $rebuild['options'] = true;
    }
    // Now rebuild everything we need...
    if ($rebuild['hooks']) {
        vB_Api::instanceInternal("Hook")->buildHookDatastore();
    }
    if ($rebuild['templates']) {
        if ($error = build_all_styles(0, 0, '', false, $verbose)) {
            return $error;
        }
    }
    if ($rebuild['phrases']) {
        require_once DIR . '/includes/adminfunctions_language.php';
        build_language();
    }
    if ($rebuild['options']) {
        vB::getDatastore()->build_options();
    }
    if ($rebuild['cron']) {
        require_once DIR . '/includes/functions_cron.php';
        build_cron_next_run();
    }
    build_product_datastore();
    // build bitfields to remove/add this products bitfields
    vB_Bitfield_Builder::save();
    if ($verbose) {
        print_dots_stop();
    }
    $info['need_merge'] = ($rebuild['templates'] and $installed_version);
    return $info;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:101,代码来源:adminfunctions_product.php


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