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


PHP build_bbcode_cache函数代码示例

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


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

示例1: 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

示例2:

		'userid',
		array('userid', 'readtime')
	);

	$upgrade->execute();
}

// #############################################################################
// FINAL step (notice the SCRIPTCOMPLETE define)
if ($vbulletin->GPC['step'] == 2)
{
	// tell log_upgrade_step() that the script is done
	define('SCRIPTCOMPLETE', true);

	// need to reflect new options
	build_bbcode_cache();
}

// #############################################################################

print_next_step();
print_upgrade_footer();

/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 25470 $
|| ####################################################################
\*======================================================================*/
?>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:upgrade_370b5.php

示例3: 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


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