Location: PHPKode > projects > O-blog > upload/admin/global.php
<?php
/*
+--------------------------------------------------------+
| O-BLOG - PHP Blog System                               |
| Copyright (c) 2004 phpBlog.CN                          |
| Support : http://www.phpBlog.cn                        |
| Author : ShiShiRui (hide@address.com)                 |
|--------------------------------------------------------+
*/
error_reporting(7);

require_once('class/forms.php');
require_once('functions.php');
require_once('class/mysql.php');
require_once('class/build.php');
require_once('../class/ubb.php');
require_once('class/chinese.php');
require_once('mysql.php');

$var = "2.6";
define("BLOG", "INOBLOG");
$FORM = new cpForms;
$UBB = new Ubb();
$DB = new DB_MySQL;
$mysql = $DB->connect($mysql_add,$mysql_user,$mysql_pass,$mysql_dbname);
$HTML = new build;
$HTML->root = "";
$articleNum = "200";	//ÎÄÕ½ØÈ¡×ÖÊý

$uploadrandomfilename = true;		//ÉÏ´«µÄÎļþÃûÊÇ·ñ¼ÓÑéÖ¤Âë¡£true,false

//ÔÊÐíÉÏ´«µÄÎļþÀàÐÍ
$allow_file_type = array("rar","zip","7z","tar.gz","wmv","wma","wav","mp3","mp4","3gp","torrent","rm","rmvb","txt","doc","xls","ppt","wps","jpg","gif","bmp","png","psd","ttf","ai");

//ÅäÖòÎÊý
$config = $DB->fetch_one_array("SELECT * FROM `".$mysql_prefix."config`");
$blogurl = trim($config['blogurl']);
$makehtml = intval($config['makehtml']);
$index_show_number = intval($config['index_show_number']);
$discribe = trim($config['blogdescribe']);
$TemplateName = trim($config['template']);
$blogName = trim($config['blogname']);
$showNum = intval($config['lastblog']);
$gb_show_num = intval($config['gb_show_num']);
$fullarticle = intval($config['fullarticle']);
$extraname = trim($config['extraname']);
$tb_name = trim($config['blogname']);
$date_format = trim($config['date_format']);
$date_format_remark = trim($config['date_format_remark']);
$date_format_gb = trim($config['date_format_gb']);
$keep_page_way = trim($config['keep_page_way']);
$archive_folder = trim($config['archive_folder']);
$superadmin = trim($config['superadmin']);
$show_viewcount = intval($config['show_viewcount']);
$servertimezone = trim($config['servertimezone']);
$clienttimezone = trim($config['clienttimezone']);
$lastblog_cut_char = intval($config['lastblog_cut_char']);


$static_blog_name = $blogName;

$userid = @intval($_COOKIE['ob_userid']);
$current_auth_char = @$DB->fetch_one("SELECT `auth` FROM `".$mysql_prefix."admin` WHERE `id`=".$userid);

//ȨÏÞÁбí
$auth[] = array(
	"name" => "²ÎÊýÉèÖÃ",
	"action" => "config,doconfig",
	"check" => 0,
);
$auth[] = array(
	"name" => "PHPINFO",
	"action" => "phpinfo",
	"check" => 0,
);
$auth[] = array(
	"name" => "Ìí¼ÓÈÕÖ¾",
	"action" => "addBlog,doaddBlog",
	"check" => 1,
);
$auth[] = array(
	"name" => "±à¼­ÈÕÖ¾",
	"action" => "editBlog,modBlog,domodBlog,delBlog,buildBlog,dosomeBlog",
	"check" => 1,
);
$auth[] = array(
	"name" => "ÆÀÂÛ¹ÜÀí",
	"action" => "remarkManager,dosomeRemark,delRemark,checkRemark,banRemark,modRemark,domodRemark",
	"check" => 1,
);
$auth[] = array(
	"name" => "Ìí¼Ó·ÖÀà",
	"action" => "addSort,doaddSort",
	"check" => 1,
);
$auth[] = array(
	"name" => "±à¼­·ÖÀà",
	"action" => "editSort,delSort,modSort,domodSort,dosomeSort",
	"check" => 1,
);
$auth[] = array(
	"name" => "Ìí¼ÓÁ´½Ó",
	"action" => "addLink,doaddLink",
	"check" => 0,
);
$auth[] = array(
	"name" => "±à¼­Á´½Ó",
	"action" => "editLink,delLink,modLink,domodLink,dosomeLink",
	"check" => 0,
);
$auth[] = array(
	"name" => "±¸·Ý/»Ö¸´Êý¾Ý¿â",
	"action" => "bak,dobak,import",
	"check" => 0,
);
$auth[] = array(
	"name" => "Ö´ÐÐSQL²éѯ",
	"action" => "runsql,dorunsql",
	"check" => 0,
);
$auth[] = array(
	"name" => "ÓÅ»¯/ÐÞ¸´Êý¾Ý",
	"action" => "optimize,repair,dooptimize,dorepair",
	"check" => 1,
);
$auth[] = array(
	"name" => "RSSµ¼Èë/µ¼³ö",
	"action" => "rssImport,doRssImport,rssImportSort,rssExport,doRssExport",
	"check" => 0,
);
$auth[] = array(
	"name" => "²Ù×÷¼Ç¼",
	"action" => "actlog,cleanActlog",
	"check" => 0,
);
$auth[] = array(
	"name" => "µÇ½¼Ç¼",
	"action" => "userlog,cleanUserlog",
	"check" => 0,
);
$auth[] = array(
	"name" => "ÐÞ¸ÄÃÜÂë",
	"action" => "password,updatepassword",
	"check" => 1,
);
$auth[] = array(
	"name" => "ÁôÑÔ¹ÜÀí",
	"action" => "guestbook,modgb,domodgb,replygb,doreplygb,delgb,dosomeGb",
	"check" => 1,
);
$auth[] = array(
	"name" => "¹ýÂ˹ÜÀí",
	"action" => "banned,dobanned",
	"check" => 0,
);
$auth[] = array(
	"name" => "Ìí¼Ó¼ÇÊÂ",
	"action" => "addNote,doaddNote",
	"check" => 0,
);
$auth[] = array(
	"name" => "¹ÜÀí¼ÇÊÂ",
	"action" => "editNote,viewNote,modNote,domodNote,delNote",
	"check" => 0,
);
$auth[] = array(
	"name" => "Îļþ¹ÜÀí",
	"action" => "uploadManager",
	"check" => 0,
);
$auth[] = array(
	"name" => "±¸·ÝÎļþ¹ÜÀí",
	"action" => "bakManager",
	"check" => 0,
);
$auth[] = array(
	"name" => "Îļþ/Êý¾Ýɾ³ý",
	"action" => "delFile",
	"check" => 0,
);
$auth[] = array(
	"name" => "Öؽ¨¾²Ì¬Ò³Ãæ",
	"action" => "rebuild,dobuild",
	"check" => 0,
);
$auth[] = array(
	"name" => "ÎļþÉÏ´«",
	"action" => "upload,doupload",
	"check" => 0,
);
$auth[] = array(
	"name" => "Ìí¼ÓÓû§",
	"action" => "addUser,doaddUser",
	"check" => 0,
);
$auth[] = array(
	"name" => "±à¼­Óû§",
	"action" => "editUser,modUser,domodUser,delUser",
	"check" => 0,
);
$auth[] = array(
	"name" => "ͨ¸æÒýÓùÜÀí",
	"action" => "editTrackback,modTrackback,domodTrackback,delTrackback,dosomeTrackback",
	"check" => 1,
);
$auth[] = array(
	"name" => "×Ô¶¯Á´½Ó",
	"action" => "addAutolink,editAutolink,doaddAutolink,updateAutolink,delAutolink",
	"check" => 1,
);
$auth[] = array(
	"name" => "Ä£°å±à¼­",
	"action" => "selectTemplate,editTemplate,saveTemplate",
	"check" => 0,
);
$auth[] = array(
	"name" => "others",
	"action" => "logout",
	"check" => 0,
);

@chdir("../");

require_once("class/template/class.smarttemplate.php");
$TemplateName = $DB->fetch_one("SELECT `template` FROM `".$mysql_prefix."config` ");
function template($name) {
	global $TemplateName;
	Return new SmartTemplate('templates/'.$TemplateName.'/'.$name.'.htm');
}

?>
Return current item: O-blog