<?php
define('THIS_SCRIPT', 'boardhelp');
require_once 'global.php';
$lang = load_lang($lang, 'boardhelp' );
global $title_num,$action,$reaction;
$stats = $lang['help.info56'];
$bbs_stat=$fsetting['forumname'];
$title_num = array(
	0=>array('linktitle'=>$lang['template.str1'])
	);
head(1,0,0,$title_num);// print head;
PageLoad();
footer();
function PageLoad(){
	global $title_val,$boardid,$title,$body,$act,$fir,$lang,$RegUpMoney,$LoginUpMoney,$PostUpMoney,$ReplyUpMoney,$IsBestUpMoney,$RegUpEP,$LoginUpEP,$PostUpEP,$ReplyUpEP,$IsBestUpEP,$IsDelUpEP,$RegUpCP,$LoginUpCP,$PostUpCP,$ReplyUpCP,$IsBestUpCP,$IsDelUpCP,$IsDelUpMoney,$RedClor,$OpenHtml,$OpenUBB,$OpenImage,$OpenFlash,$OpenPlayer,$OpenEmcode,$info_val,$PicUrl,$GroupPic,$GroupName,$MinArticle,$user_gain_more,$fsetting,$board_settings,$OpenUpLoad,$MaxLengh;
	global $OpenMoney,$OpenEP,$OpenCP,$OpenPower,$OpenArticle,$OpenReplay,$OpenBuy,$boardid;
	$RedClor=$lang['template.RedClor'];
	$boardid=$_GET['boardid'];
	sub_main();
	read_info();
	user_gain();
	get_group_info();
include_once printout('boardhelp');//print fileshow.htm;
}
function sub_main(){
	global $view,$boardid,$title_val,$dv,$db;
	$title_val=array();
	$result=$db->query("select h_id,h_parentid,h_title from {$dv}help where h_id!=1 order by h_id");
	while($arr=$db->fetch_array($result)){
		$title_val[]=$arr;		
	}
$db->free_result($result);
}
function read_info(){
	global $title,$body,$dv,$db,$act;
	$sql="select h_id,h_title,h_content,h_stype,h_bgimg,h_addtime from {$dv}help where h_id='".intval($act)."'";
	$result=$db->query($sql);
	$arr=$db->fetch_array($result);
	$title=$arr['h_title'];
	$body=$arr['h_content'];
	$db->free_result($result);
}
function get_group_info(){
	global $dv,$db,$PicUrl,$lang,$user_gain_more;
	$result=$db->query("select usertitle,minarticle,grouppic from {$dv}usergroups where minarticle!=-1 order by minarticle");
	while($arr=$db->fetch_array($result)){
		$user_gain=str_replace('{$GroupName}',$arr['usertitle'],$lang['user.gain']);
		$user_gain=str_replace('{$MinArticle}',$arr['minarticle'],$user_gain);
		$user_gain=str_replace('{$GroupPic}',$arr['grouppic'],$user_gain);
		$user_gain_more.=$user_gain;
	}
	$db->free_result($result);
}
Function user_gain(){
	global $lang, $RegUpMoney,$LoginUpMoney,$PostUpMoney,$ReplyUpMoney,$IsBestUpMoney,$RegUpEP,$LoginUpEP,$PostUpEP,$ReplyUpEP,$IsBestUpEP,$IsDelUpEP,$RegUpCP,$LoginUpCP,$PostUpCP,$ReplyUpCP,$IsBestUpCP,$IsDelUpCP,$IsDelUpMoney,$OpenHtml,$OpenUBB,$OpenImage,$OpenFlash,$OpenPlayer,$OpenEmcode,$fsetting,$OpenUpLoad,$MaxLengh,$board_settings,$OpenMoney,$OpenEP,$OpenCP,$OpenPower,$OpenArticle,$OpenReplay,$OpenBuy,$boardid;
	$integral=explode(",",$fsetting['userpoint']);
	$boardid=$_GET['boardid'];
	$uploadpic=explode("|",$fsetting['uploadsetting']);
	//'½πΗ®
	$RegUpMoney=$integral[0];
	$LoginUpMoney=$integral[4];
	$PostUpMoney=$integral[1];
	$ReplyUpMoney=$integral[2];
	$IsBestUpMoney=$integral[15];
	$IsDelUpMoney=$integral[3];
	//'Ύ­Ρι
	$RegUpEP=$integral[5];
	$LoginUpEP=$integral[9];
	$PostUpEP=$integral[6];
	$ReplyUpEP=$integral[7];
	$IsBestUpEP=$integral[17];
	$IsDelUpEP=$integral[8];
	//'χΘΑ¦
	$RegUpCP=$integral[10];
	$LoginUpCP=$integral[14];
	$PostUpCP=$integral[11];
	$ReplyUpCP=$integral[12];
	$IsBestUpCP=$integral[16];
	$IsDelUpCP=$integral[13];
	//UBB
	if(intval($_GET['boardid'])>0){
		$OpenHtml = ($fsetting['signhtmlcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenUBB = ($fsetting['signubbcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenImage = ($fsetting['signimgcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenFlash = ($fsetting['signflashcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenPlayer = ($board_settings[71]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenEmcode = ($board_settings[69]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenUpLoad = ($uploadpic[0]?$lang['template.gain1']:$lang['template.gain2']);
		$MaxLengh = ceil($board_settings[49]/1024);
		$OpenMoney= ($board_settings[72]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenEP= ($board_settings[73]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenCP= ($board_settings[74]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenPower= ($board_settings[75]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenArticle= ($board_settings[76]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenReplay= ($board_settings[77]?$lang['template.gain1']:$lang['template.gain2']);
		$OpenBuy= ($board_settings[78]?$lang['template.gain1']:$lang['template.gain2']);
	}
	else{
		$OpenHtml = ($fsetting['signhtmlcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenUBB = ($fsetting['signubbcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenImage = ($fsetting['signimgcode']?$lang['template.gain1']:$lang['template.gain2']);
		$OpenFlash = ($fsetting['signflashcode']?$lang['template.gain1']:$lang['template.gain2']);
	}
}
?>