⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_groups.php

📁 一个全功能的国外博客商业程序
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?
$page = "admin_groups.php";
include "admin_header.php";

if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }


if($task == "newgroup_or_setdefault") {
$submit = $_POST['submit'];

if($submit == "$admin_groups70") { $task = "newgroup"; }
elseif($submit == "$admin_groups71") { 
$default_group = $_POST['default_group'];
mysql_query("UPDATE bhost_groups SET default_group='0'");
mysql_query("UPDATE bhost_groups SET default_group='1' WHERE g_id='$default_group'");
echo $head;
echo "
<h2>$admin_groups73</h2>
$admin_groups74
<br><br>
<form action='admin_groups.php' method='POST'>
<input type='submit' class='button' value='$admin_groups3'>
</form>
";
echo $foot;
exit();
}}


if($task == "edit" OR $task == "newgroup") {
if(isset($_GET['g_id'])) { $g_id = $_GET['g_id']; } elseif(isset($_POST['g_id'])) { $g_id = $_POST['g_id']; } else { $g_id = ""; }
echo $head;

if($task == "edit") { 
if(mysql_num_rows(mysql_query("SELECT g_id FROM bhost_groups WHERE g_id='$g_id'")) != 1) { exit(); }
$group_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_groups WHERE g_id='$g_id'"));
$title = "$admin_groups54"; 
$description = "$admin_groups55";
$submit = "$admin_groups56";
}

elseif($task == "newgroup") {
$group_info[g_id] = "";
$group_info[group_name] = "";
$group_info[default_group] = "0";
$group_info[allow_comments] = "1";
$group_info[allow_members] = "1";
$group_info[allow_privacy] = "1";
$group_info[allow_mailinglist] = "1";
$group_info[allow_rss] = "1";
$group_info[allow_uploads] = "1";
$group_info[uploads_space] = "1024";
$group_info[uploads_extensions] = "jpeg,jpg,gif,bmp,png";
$group_info[allow_banning] = "1";
$group_info[allow_pinging] = "1";
$group_info[allow_trackback] = "1";
$group_info[allow_entry_cat] = "1";
$group_info[allow_edittemplate] = "1";
$group_info[allow_language] = "0";
$group_info[show_ad] = "0";
$group_info[html_ad] = "";
$group_info[html_ad_bottom] = "";
$group_info[announcements] = "";

$group_info[templates] = "";
$count = 0;
$templates = mysql_query("SELECT t_id FROM bhost_templates");
$num_templates = mysql_num_rows($templates);
while($template_info = mysql_fetch_assoc($templates)) {
 $count = $count+1;
 $group_info[templates] .= "$template_info[t_id]";
 if($count != $num_templates) { $group_info[templates] .= ","; }
}

$title = "$admin_groups57";
$description = "$admin_groups58";
$submit = "$admin_groups59";
}

echo "
<h2>$title</h2>
$description 
<br><br>

<form action='admin_groups.php' method='POST' name='info'>

$admin_groups49<br>
<input type='text' class='text' size='30' maxlength='30' name='group_name' value='$group_info[group_name]'>
<br><br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups91</td></tr>
<tr>
<td class='box'>
$admin_groups92
<br><br>
<table width='100%' cellpadding='0' cellspacing='0'>
<tr><td><textarea rows='15' cols='60' name='announcements' style='font-family: \"Courier New\", verdana, arial; width: 100%;'>$group_info[announcements]</textarea></td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups5</td></tr>
<tr>
<td class='box'>
$admin_groups6
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_comments' value='1'"; if($group_info[allow_comments] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups7</td></tr>
<tr><td><input type='radio' name='allow_comments' value='0'"; if($group_info[allow_comments] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups8</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups9</td></tr>
<tr>
<td class='box'>
$admin_groups10
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_members' value='1'"; if($group_info[allow_members] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups11</td></tr>
<tr><td><input type='radio' name='allow_members' value='0'"; if($group_info[allow_members] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups12</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups13</td></tr>
<tr>
<td class='box'>
$admin_groups14 
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_privacy' value='1'"; if($group_info[allow_privacy] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups15</td></tr>
<tr><td><input type='radio' name='allow_privacy' value='0'"; if($group_info[allow_privacy] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups16</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups17</td></tr>
<tr>
<td class='box'>
$admin_groups18
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_mailinglist' value='1'"; if($group_info[allow_mailinglist] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups19</td></tr>
<tr><td><input type='radio' name='allow_mailinglist' value='0'"; if($group_info[allow_mailinglist] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups20</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups21</td></tr>
<tr>
<td class='box'>
$admin_groups22
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_rss' value='1'"; if($group_info[allow_rss] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups23</td></tr>
<tr><td><input type='radio' name='allow_rss' value='0'"; if($group_info[allow_rss] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups24</td></tr>
</table>
</td>
</tr>
</table>

<br>


<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups26</td></tr>
<tr>
<td class='box'>
$admin_groups27
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_uploads' value='1'"; if($group_info[allow_uploads] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups28</td></tr>
<tr><td><input type='radio' name='allow_uploads' value='0'"; if($group_info[allow_uploads] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups29</td></tr>
</table>
<br>
$admin_groups30
<br><br>
$admin_groups31
<select name='uploads_space'>
<option value='100'"; if($group_info[uploads_space] == "100") { echo " SELECTED"; } echo ">100 KB</option>
<option value='250'"; if($group_info[uploads_space] == "250") { echo " SELECTED"; } echo ">250 KB</option>
<option value='500'"; if($group_info[uploads_space] == "500") { echo " SELECTED"; } echo ">500 KB</option>
<option value='1024'"; if($group_info[uploads_space] == "1024") { echo " SELECTED"; } echo ">1 MB</option>
<option value='2048'"; if($group_info[uploads_space] == "2048") { echo " SELECTED"; } echo ">2 MB</option>
<option value='3072'"; if($group_info[uploads_space] == "3072") { echo " SELECTED"; } echo ">3 MB</option>
<option value='4096'"; if($group_info[uploads_space] == "4096") { echo " SELECTED"; } echo ">4 MB</option>
<option value='5120'"; if($group_info[uploads_space] == "5120") { echo " SELECTED"; } echo ">5 MB</option>
<option value='10240'"; if($group_info[uploads_space] == "10240") { echo " SELECTED"; } echo ">10 MB</option>
<option value='15360'"; if($group_info[uploads_space] == "15360") { echo " SELECTED"; } echo ">15 MB</option>
<option value='20480'"; if($group_info[uploads_space] == "20480") { echo " SELECTED"; } echo ">20 MB</option>
<option value='25600'"; if($group_info[uploads_space] == "25600") { echo " SELECTED"; } echo ">25 MB</option>
<option value='51200'"; if($group_info[uploads_space] == "51200") { echo " SELECTED"; } echo ">50 MB</option>
<option value='102400'"; if($group_info[uploads_space] == "102400") { echo " SELECTED"; } echo ">100 MB</option>
<option value='204800'"; if($group_info[uploads_space] == "204800") { echo " SELECTED"; } echo ">200 MB</option>
<option value='307200'"; if($group_info[uploads_space] == "307200") { echo " SELECTED"; } echo ">300 MB</option>
<option value='409600'"; if($group_info[uploads_space] == "409600") { echo " SELECTED"; } echo ">400 MB</option>
<option value='512000'"; if($group_info[uploads_space] == "512000") { echo " SELECTED"; } echo ">500 MB</option>
<option value='614400'"; if($group_info[uploads_space] == "614400") { echo " SELECTED"; } echo ">600 MB</option>
<option value='716800'"; if($group_info[uploads_space] == "716800") { echo " SELECTED"; } echo ">700 MB</option>
<option value='819200'"; if($group_info[uploads_space] == "819200") { echo " SELECTED"; } echo ">800 MB</option>
<option value='921600'"; if($group_info[uploads_space] == "921600") { echo " SELECTED"; } echo ">900 MB</option>
<option value='unlimited'"; if($group_info[uploads_space] == "unlimited") { echo " SELECTED"; } echo ">Unlimited</option>
</select>
&nbsp;&nbsp;
$admin_groups32
<input type='text' class='text' name='uploads_extensions' value='$group_info[uploads_extensions]'>
<br><br>
$admin_groups72
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups35</td></tr>
<tr>
<td class='box'>
$admin_groups36
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_banning' value='1'"; if($group_info[allow_banning] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups37</td></tr>
<tr><td><input type='radio' name='allow_banning' value='0'"; if($group_info[allow_banning] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups38</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups39</td></tr>
<tr>
<td class='box'>
$admin_groups40
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_pinging' value='1'"; if($group_info[allow_pinging] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups41</td></tr>
<tr><td><input type='radio' name='allow_pinging' value='0'"; if($group_info[allow_pinging] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups42</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups105</td></tr>
<tr>
<td class='box'>
$admin_groups106
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_trackback' value='1'"; if($group_info[allow_trackback] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups107</td></tr>
<tr><td><input type='radio' name='allow_trackback' value='0'"; if($group_info[allow_trackback] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups108</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups87</td></tr>
<tr>
<td class='box'>
$admin_groups88
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_entry_cat' value='1'"; if($group_info[allow_entry_cat] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups89</td></tr>
<tr><td><input type='radio' name='allow_entry_cat' value='0'"; if($group_info[allow_entry_cat] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups90</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups93</td></tr>
<tr>
<td class='box'>
$admin_groups94
<br><br>
<table cellpadding='0' cellspacing='0'>
<tr><td><input type='radio' name='allow_edittemplate' value='1'"; if($group_info[allow_edittemplate] == 1) { echo " CHECKED"; } echo "></td><td>$admin_groups95</td></tr>
<tr><td><input type='radio' name='allow_edittemplate' value='0'"; if($group_info[allow_edittemplate] == 0) { echo " CHECKED"; } echo "></td><td>$admin_groups96</td></tr>
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr>
<td class='header'>$admin_groups109</td></tr>
<tr>
<td class='box'>
$admin_groups110
<br><br>
<table cellpadding='0' cellspacing='0'>
";

$count = 0;
$template_array = explode(",", $group_info[templates]);
$templates = mysql_query("SELECT * FROM bhost_templates");
$num_templates = mysql_num_rows($templates);
while($template_info = mysql_fetch_assoc($templates)) {
 if($count%3 == 0) {
   echo "<tr><td><input type='checkbox' name='template_$template_info[t_id]' value='1'"; if(in_array($template_info[t_id], $template_array)) { echo " CHECKED"; } echo "></td><td style='padding-right: 20px;'><a href='../example.php?t_id=$template_info[t_id]' target='_blank'>$template_info[name]</a></td>";
 } elseif($count%3 == 1) {
   echo "<td><input type='checkbox' name='template_$template_info[t_id]' value='1'"; if(in_array($template_info[t_id], $template_array)) { echo " CHECKED"; } echo "></td><td style='padding-right: 20px;'><a href='../example.php?t_id=$template_info[t_id]' target='_blank'>$template_info[name]</a></td>";
 } else {
   echo "<td><input type='checkbox' name='template_$template_info[t_id]' value='1'"; if(in_array($template_info[t_id], $template_array)) { echo " CHECKED"; } echo "></td><td><a href='../example.php?t_id=$template_info[t_id]' target='_blank'>$template_info[name]</a></td></tr>";
 }
 $count = $count + 1;
}

if($num_templates%3 != 0) { echo "</tr>"; }

echo "
</table>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -