<script type="text/javascript">
function insertunit(field) {
	var value = $('#creditsformula').val();
	$('#creditsformula').val(value + field);
}
</script>
<table class="tab">
	<tr>
		<th>网站名称</th>
		<td><?php echo CHtml::textField('settings[cfg_webname]', $settings['cfg_webname']);?></td>
	</tr>
	<tr>
		<th>站点根网址</th>
		<td><?php echo CHtml::textField('settings[cfg_basehost]', $settings['cfg_basehost']);?></td>
	</tr>
	<tr>
		<th>WEB站根网址</th>
		<td><?php echo CHtml::textField('settings[cfg_webhost]', $settings['cfg_webhost']);?>(必须以http://开头 /结尾)</td>
	</tr>
	<tr>
		<th>安装目录</th>
		<td><?php echo CHtml::textField('settings[cfg_path]', $settings['cfg_path']);?>(若放在子目录则必须以/结尾，根域名下留空即可)</td>
	</tr>
	<tr>
		<th>网站密钥</th>
		<td><?php echo CHtml::textField('settings[cfg_key]', $settings['cfg_key']);?>(必须设置，设置后尽量不要修改)</td>
	</tr>
    <tr>
        <th>网站状态</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_closesite]', $settings['cfg_closesite'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
    </tr>
    <tr>
        <th>关闭原因</th>
        <td><?php echo CHtml::textArea('settings[cfg_reason]', $settings['cfg_reason'], array('rows'=>5,'cols'=>40));?></td>
    </tr>
    <tr>
        <th>调试网站</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_debug]', $settings['cfg_debug'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
    </tr>
    <tr>
        <th>网站模板</th>
        <td><?php echo CHtml::textField('settings[cfg_template]', $settings['cfg_template']);?>(默认为default，模板统一放在templates目录)</td>
    </tr>
    <tr>
        <th>网站主货币名</th>
        <td><?php echo CHtml::textField('settings[cfg_creditname]', $settings['cfg_creditname']);?></td>
    </tr>
    <tr>
		<th>新注册用户默认等级组</th>
		<td><?php echo CHtml::textField('settings[cfg_defaultgid]', $settings['cfg_defaultgid']);?>(必须有)</td>
	</tr>
    <tr>
        <th>新注册用户奖励积分</th>
        <td><?php echo CHtml::textField('settings[cfg_regaward]', $settings['cfg_regaward']);?> (0表示不奖励)</td>
    </tr>
    <tr>
        <th>每日第一次登录奖励积分</th>
        <td><?php echo CHtml::textField('settings[cfg_loginaward]', $settings['cfg_loginaward']);?> (同上)</td>
    </tr>
    <tr>
        <th>每日会员抽奖提示</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_adstips]', $settings['cfg_adstips'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?>(开启后每天第一次登录的时候会提示用户抽奖，如果用户反感，可以关闭)</td>
    </tr>
    <tr>
        <th>非手机用户是否可以抽奖</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_adsnomobile]', $settings['cfg_adsnomobile'], array(1=>'可以',0=>'不可以'), array('separator'=>' '));?>(开启后非手机用户也可以抽奖，否则只能签到)</td>
    </tr>
    <tr>
        <th>每日会员抽奖次数</th>
        <td><?php echo CHtml::textField('settings[cfg_adsnum]', $settings['cfg_adsnum']);?></td>
    </tr>
    <tr>
        <th>抽奖最高加分</th>
        <td><?php echo CHtml::textField('settings[cfg_ads_largest_poin]', $settings['cfg_ads_largest_poin']);?></td>
    </tr>
    <tr>
        <th>抽奖最低加分</th>
        <td><?php echo CHtml::textField('settings[cfg_ads_least_point]', $settings['cfg_ads_least_point']);?></td>
    </tr>
    <tr>
        <th>每日会员自动外站跳转</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_dayredirect]', $settings['cfg_dayredirect'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?>(开启后会员每天会自动随机跳一次外站，在下面可以设置积分高于多少的不跳)</td>
    </tr>
    <tr>
        <th>外站跳转积分限制</th>
        <td><?php echo CHtml::textField('settings[cfg_dayredirectlimit]', $settings['cfg_dayredirectlimit']);?>(总积分高于这个的不会跳转)</td>
    </tr>
    <tr>
        <th>每日非会员自动外站跳转</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_dayredirecta]', $settings['cfg_dayredirecta'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?>(类似上面的，每天一次，可用来跟导航站换量，如果用户流失过多，建议关闭)</td>
    </tr>
	<tr>
		<th>URL重写(只对WEB有效)</th>
		<td><?php echo CHtml::radioButtonList('settings[cfg_urlrewrite]', $settings['cfg_urlrewrite'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
	</tr>
	<tr>
		<th>地址重写后缀</th>
		<td><?php echo CHtml::textField('settings[cfg_urlsuffix]', $settings['cfg_urlsuffix']);?></td>
	</tr>
	<tr>
		<th>重写地址分割符</th>
		<td><?php echo CHtml::textField('settings[cfg_depr]', $settings['cfg_depr']);?></td>
	</tr>
    <tr>
        <th>开启全站动态</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_isfeed]', $settings['cfg_isfeed'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
    </tr>
	<tr>
		<th>推荐注册奖励</th>
		<td><?php echo CHtml::textField('settings[cfg_reward]', $settings['cfg_reward']);?></td>
	</tr>
	<tr>
		<th>允许注册</th>
		<td><?php echo CHtml::radioButtonList('settings[cfg_register]', $settings['cfg_register'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
	</tr>
    <tr>
		<th>禁止注册IP</th>
		<td><?php echo CHtml::textArea('settings[cfg_denyregister]', $settings['cfg_denyregister'],array('cols'=>40,'rows'=>10));?>（用|隔开）</td>
	</tr>
    <tr>
        <th>非会员访问提示注册</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_regprompt]', $settings['cfg_regprompt'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?>(开启后未注册用户每访问30次会提示他注册或者登录，此功能可以提升网站注册量，建议开启)</td>
    </tr>
	<tr>
		<th>开启访问统计</th>
		<td><?php echo CHtml::radioButtonList('settings[cfg_log]', $settings['cfg_log'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
	</tr>
    <tr>
        <th>开启推广统计</th>
        <td><?php echo CHtml::radioButtonList('settings[cfg_rewardlog]', $settings['cfg_rewardlog'], array(1=>'开启',0=>'关闭'), array('separator'=>' '));?></td>
    </tr>
    <tr>
        <th>统计数据存放数据库</th>
        <td><?php echo CHtml::textField('settings[cfg_logdb]', $settings['cfg_logdb']);?>("访问统计"开启后有效)</td>
    </tr>
	<tr>
		<th>在线保持时间(分)</th>
		<td><?php echo CHtml::textField('settings[cfg_onlinehold]', $settings['cfg_onlinehold'], array('size'=>4));?></td>
	</tr>
	<tr>
		<th>用户在线时间更新时长(分钟)</th>
		<td><?php echo CHtml::textField('settings[cfg_oltimespan]', $settings['cfg_oltimespan'], array('size'=>4));?>  (本设置用以设定更新用户在线时间的时间频率。例如设置为 10，则用户每在线 10 分钟更新一次记录。本设置值越小，则统计越精确，但消耗资源越大。建议设置为 5～30 范围内，0 为不记录用户在线时间)</td>
	</tr>
	<tr>
		<th>缓存策略</th>
		<td><?php echo CHtml::dropDownList('settings[cfg_cachecore]', $settings['cfg_cachecore'], array('File'=>'文件','Memcache'=>'Memcache'))?></td>
	</tr>
	<tr>
		<th>敏感词过滤</th>
		<td><?php echo CHtml::textArea('settings[cfg_denyword]', $settings['cfg_denyword'],array('cols'=>60,'rows'=>10));?></td>
	</tr>
    <tr>
		<th>黑名单用户列表</th>
		<td><?php echo CHtml::textArea('settings[cfg_blackulist]', $settings['cfg_blackulist'],array('cols'=>60,'rows'=>10));?>(在此名单内的用户将不能申请版主、书管及其他一些职务,填UID，用逗号隔开)</td>
	</tr>
    <tr>
		<th>GM用户列表</th>
		<td><?php echo CHtml::textField('settings[cfg_gmlist]', $settings['cfg_gmlist']);?>(特殊帐号ID，在前台拥有最高权限，必须有一个)</td>
	</tr>
    <tr>
		<th>在线时间每增加一小时奖励</th>
		<td><?php echo CHtml::textField('settings[cfg_olcredit]', $settings['cfg_olcredit']);?></td>
	</tr>
    <tr>
        <th>每月书管工资</th>
        <td><?php echo CHtml::textField('settings[cfg_bmwages]', $settings['cfg_bmwages']);?>(0表示不发)</td>
    </tr>
    <tr>
        <th>每月超管工资</th>
        <td><?php echo CHtml::textField('settings[cfg_sbmwages]', $settings['cfg_sbmwages']);?>(同上)</td>
    </tr>
    <tr>
        <th>每月版主工资</th>
        <td><?php echo CHtml::textField('settings[cfg_bbsmwages]', $settings['cfg_bbsmwages']);?>(同上)</td>
    </tr>
	<tr>
	<?php $credits = unserialize($settings['cfg_extcredits']);?>
		<th>总积分计算公式
		</th>
		<td>
		<span class="formulaeditor">
		<?php if (!empty($credits)):?>
			<?php foreach ($credits as $key => $credit):?>
				<?php echo CHtml::link($credit['title'],'javascript:void(0)',array('onclick'=>'insertunit("'.$key.'")'));?>
			<?php endforeach;?>
			<br/>
		<?php endif;?>
		<?php echo CHtml::link('精华帖数','javascript:void(0)',array('onclick'=>'insertunit("digestposts")'));?> <?php echo CHtml::link('发帖数', 'javascript:void(0)', array('onclick'=>'insertunit("posts")'));?>  <?php echo CHtml::link('在线时间(小时)','javascript:void(0)',array('onclick'=>'insertunit("oltime")'));?>   <?php echo CHtml::link('+','javascript:void(0)',array('onclick'=>'insertunit("+")'));?>   <?php echo CHtml::link('-','javascript:void(0)',array('onclick'=>'insertunit("-")'));?>    <?php echo CHtml::link('*','javascript:void(0)',array('onclick'=>'insertunit("*")'));?>    <?php echo CHtml::link('/','javascript:void(0)',array('onclick'=>'insertunit("/")'));?>   <?php echo CHtml::link('()','javascript:void(0)',array('onclick'=>'insertunit("()")'));?>
		</span>
		<br/> 
        <?php echo CHtml::textArea('settings[cfg_creditsformula]', $settings['cfg_creditsformula'], array('cols'=>50,'rows'=>5,'id'=>'creditsformula'));?>
		</td>
	</tr>
</table>