| khile |
03-03-2008 07:15 PM |
the too files in question are
PHP Code:
<?php
if(!defined('AEB')) { die('Restricted access'); }
function coreset_theme(){
global $globals, $theme, $error; //Admin Headers includes Global Headers adminhead('Administration Center - Core Settings'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/controlpanel.png"> </td> <td align="left" class="adcbg1"> <font class="adgreen">Core Settings</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> This is the place for changing the Core settings of the board. Please take great care while changing these settings as the Board will stop functioning if something is incorrect. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="coresetform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> Core Settings </td> </tr> <tr> <td width="45%" class="adbg"> <b>Board URL :</b><br /> <font class="adexp">The URL of the board.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="url" value="<?php echo (empty($_POST['url']) ? $globals['url'] : $_POST['url']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Site Name :</b><br /> <font class="adexp">The name of the board.</font> </td> <td class="adbg" align="left"> <input type="text" size="30" name="sn" value="<?php echo (empty($_POST['sn']) ? $globals['sn'] : $_POST['sn']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Board Email :</b><br /> <font class="adexp">The email of the board.</font> </td> <td class="adbg" align="left"> <input type="text" size="30" name="board_email" value="<?php echo (empty($_POST['board_email']) ? $globals['board_email'] : $_POST['board_email']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>AeonBoard Folder :</b><br /> <font class="adexp">The folder where all the AeonBoard files are stored.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="server_url" value="<?php echo (empty($_POST['server_url']) ? $globals['server_url'] : $_POST['server_url']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>AeonBoard Main Files :</b><br /> <font class="adexp">The folder where all the Main AeonBoard files are stored.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="mainfiles" value="<?php echo (empty($_POST['mainfiles']) ? $globals['mainfiles'] : $_POST['mainfiles']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Themes Folder :</b><br /> <font class="adexp">The folder where all the themes reside.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="themesdir" value="<?php echo (empty($_POST['themesdir']) ? $globals['themesdir'] : $_POST['themesdir']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Cookie Name :</b><br /> </td> <td class="adbg" align="left"> <input type="text" size="30" name="cookie_name" value="<?php echo (empty($_POST['cookie_name']) ? $globals['cookie_name'] : $_POST['cookie_name']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Compress Output :</b><br /> <font class="adexp">This will compress output and saves alot of bandwidth.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="gzip" <?php echo ($globals['gzip'] ? 'checked="checked"' : '');?> /> </td> </tr>
</table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="center" class="adbg"> <input type="submit" name="editcoreset" value="Submit" /> </td> </tr> </table> </form> <?php adminfoot(); }
function mysqlset_theme(){
global $globals, $theme, $error; //Admin Headers includes Global Headers adminhead('Administration Center - MySQL Settings'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/controlpanel.png"> </td> <td align="left" class="adcbg1"> <font class="adgreen">MySQL Settings</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> This is the place for changing the MySQL settings of the board. Please take great care while changing these settings as the Board will stop functioning if something is incorrect. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="mysqlsetform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> MySQL Settings </td> </tr> <tr> <td width="45%" class="adbg"> <b>Server :</b><br /> <font class="adexp">The server on which the database resides. Generally 'localhost'.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="server" value="<?php echo (empty($_POST['server']) ? $globals['server'] : $_POST['server']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>MySQL User :</b><br /> <font class="adexp">The user of the MySQL database.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="user" value="<?php echo (empty($_POST['user']) ? $globals['user'] : $_POST['user']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>MySQL password :</b><br /> <font class="adexp">The password of the MySQL database.</font> </td> <td class="adbg" align="left"> <input type="password" size="40" name="password" value="<?php echo (empty($_POST['password']) ? $globals['password'] : $_POST['password']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>MySQL database :</b><br /> <font class="adexp">The name of the MySQL database.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="database" value="<?php echo (empty($_POST['database']) ? $globals['database'] : $_POST['database']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>MySQL DB Tables Prefix :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="dbprefix" value="<?php echo (empty($_POST['dbprefix']) ? $globals['dbprefix'] : $_POST['dbprefix']);?>" /> </td> </tr> </table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="center" class="adbg"> <input type="submit" name="editmysqlset" value="Submit" /> </td> </tr> </table> </form> <?php adminfoot(); }
function onoff_theme(){
global $globals, $theme, $error; //Admin Headers includes Global Headers adminhead('Administration Center - Turn Board On/Off'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/controlpanel.png"> </td> <td align="left" class="adcbg1"> <font class="adgreen">Turn Board On/Off</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> Here you can put the board under maintenance mode. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="onoffform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> Turn Board On/Off </td> </tr> <tr> <td width="45%" class="adbg"> <b>Turn Board Off :</b><br /> <font class="adexp">Only permitted users will be able to see the board for maintenance purpose.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="maintenance" <?php echo ($globals['maintenance'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Maintenance Subject :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="maintenance_subject" value="<?php echo (empty($_POST['maintenance_subject']) ? $globals['maintenance_subject'] : $_POST['maintenance_subject']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Maintenance Message :</b> </td> <td class="adbg" align="left"> <textarea cols="40" rows="6" name="maintenance_message" ><?php echo (empty($_POST['maintenance_message']) ? $globals['maintenance_message'] : $_POST['maintenance_message']);?></textarea> </td> </tr> </table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="center" class="adbg"> <input type="submit" name="editonoff" value="Submit" /> </td> </tr> </table> </form> <?php adminfoot(); }
//Board mail settings function mailset_theme(){
global $globals, $theme, $error; //Admin Headers includes Global Headers adminhead('Administration Center - Mail Settings'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/controlpanel.png"> </td> <td align="left" class="adcbg1"> <font class="adgreen">Mail Settings</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> Here you can manage Mail Settings for the board. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="mailsetform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> Mail Settings </td> </tr> <tr> <td width="45%" class="adbg"> <b>Mail Delivery Method :</b><br /> <font class="adexp">Send mails using PHP mail() function or your SMTP server.</font> </td> <td class="adbg" align="left"> <select name="mail"> <option value="1" <?php echo (isset($_POST['mail']) && $_POST['mail'] == 1 ? 'selected="selected"' : ($globals['mail'] == 1 ? 'selected="selected"' : '' ));?> >PHP Mail</option> <option value="0" <?php echo (isset($_POST['mail']) && $_POST['mail'] == 0 ? 'selected="selected"' : ($globals['mail'] == 0 ? 'selected="selected"' : '' ));?> >SMTP</option> </select> </td> </tr> <tr> <td class="adbg"> <b>SMTP Server :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="mail_server" value="<?php echo (empty($_POST['mail_server']) ? $globals['mail_server'] : $_POST['mail_server']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>SMTP Port :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="mail_port" value="<?php echo (empty($_POST['mail_port']) ? $globals['mail_port'] : $_POST['mail_port']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>SMTP Username :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="mail_user" value="<?php echo (empty($_POST['mail_user']) ? $globals['mail_user'] : $_POST['mail_user']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>SMTP Password :</b> </td> <td class="adbg" align="left"> <input type="text" size="40" name="mail_pass" value="<?php echo (empty($_POST['mail_pass']) ? $globals['mail_pass'] : $_POST['mail_pass']);?>" /> </td> </tr> </table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="center" class="adbg"> <input type="submit" name="editmailset" value="Submit" /> </td> </tr> </table> </form> <?php adminfoot(); }
//Board General settings function genset_theme(){
global $globals, $theme, $error, $lang_folders; //Admin Headers includes Global Headers adminhead('Administration Center - General Settings'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/controlpanel.png"> </td> <td align="left" class="adcbg1"> <font class="adgreen">General Settings</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> Here you can manage General Settings of the board. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="gensetform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> General Settings </td> </tr> <tr> <td width="45%" class="adbg"> <b>Enable notifications :</b><br /> <font class="adexp">If disabled all notifcations of topics and posts will be disabled.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="notifications" <?php echo ($globals['notifications'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td width="45%" class="adbg"> <b>Subscribe Automatically :</b><br /> <font class="adexp">The default while posting if notifications are enabled.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="subscribeauto" <?php echo ($globals['subscribeauto'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Session Timeout :</b><br /> <font class="adexp">Seconds before an unused session timeout.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="session_timeout" value="<?php echo (empty($_POST['session_timeout']) ? $globals['session_timeout'] : $_POST['session_timeout']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Last Activity Time :</b><br /> <font class="adexp">The time gap from the last activity of a user to consider the user as active. (in minutes)</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="last_active_span" value="<?php echo (empty($_POST['last_active_span']) ? $globals['last_active_span'] : $_POST['last_active_span']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Make login compulsory :</b><br /> <font class="adexp">If enabled all guests will have to login for browsing the forum.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="only_users" <?php echo ($globals['only_users'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Maitain daily stats :</b> </td> <td class="adbg" align="left"> <input type="checkbox" name="stats" <?php echo ($globals['stats'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Allow members to hide their email :</b> </td> <td class="adbg" align="left"> <input type="checkbox" name="memhideemail" <?php echo ($globals['memhideemail'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Can Guests see Member Details ?</b> </td> <td class="adbg" align="left"> <input type="checkbox" name="showmemdetails" <?php echo ($globals['showmemdetails'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Show Users Visited Today :</b><br /> <font class="adexp">If enabled it will show the users who have visited today. It will be shown on the Board Index. (Will take One Query)</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="users_visited_today" <?php echo ($globals['users_visited_today'] ? 'checked="checked"' : '');?> /> </td> </tr> <tr> <td class="adbg"> <b>Active users to show in list :</b><br /> <font class="adexp">The number of active users to show in the active users list.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="maxactivelist" value="<?php echo (empty($_POST['maxactivelist']) ? $globals['maxactivelist'] : $_POST['maxactivelist']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Num. Members to show in list :</b><br /> <font class="adexp">The number of members to show in the members list.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="maxmemberlist" value="<?php echo (empty($_POST['maxmemberlist']) ? $globals['maxmemberlist'] : $_POST['maxmemberlist']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Num. subscriptions to show in list :</b><br /> <font class="adexp">The number of subscriptions to show in the subscriptions list.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="numsubinpage" value="<?php echo (empty($_POST['numsubinpage']) ? $globals['numsubinpage'] : $_POST['numsubinpage']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Num. of Recent Posts :</b><br /> <font class="adexp">The number of recent posts to show on the Main Index. Enter 0 - zero to disable. (Will take One Query) </font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="recent_posts" value="<?php echo (empty($_POST['recent_posts']) ? $globals['recent_posts'] : $_POST['recent_posts']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Language :</b><br /> <font class="adexp">Choose the Board's default language.</font> </td> <td class="adbg" align="left"> <select name="language" /> <?php foreach($lang_folders as $k => $v){ echo '<option value="'.$v.'" '.(empty($_POST['language']) && $globals['language'] == $v ? 'selected="selected"' : (trim($_POST['language']) == $v ? 'selected="selected"' : '') ).'>'.ucfirst($v).'</option>'; } ?> </select> </td> </tr> <tr> <td class="adcbg2" colspan="2"> Forum Settings </td> </tr> <tr> <td class="adbg"> <b>Count In-Board Posts :</b><br /> <font class="adexp">If this is enabled the inboard posts will also be counted.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="countinboardposts" <?php echo (isset($_POST['countinboardposts']) ? 'checked="checked"' : ($globals['countinboardposts'] ? 'checked="checked"' : ''));?> /> </td> </tr> <tr> <td class="adcbg2" colspan="2"> News Settings </td> </tr> <tr> <td class="adbg"> <b>Enable the News System :</b><br /> <font class="adexp">If this is enabled permitted users can submit news which can be approved by Admins.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="enablenews" <?php echo (isset($_POST['enablenews']) ? 'checked="checked"' : ($globals['enablenews'] ? 'checked="checked"' : ''));?> /> </td> </tr> </table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="center" class="adbg"> <input type="submit" name="editgenset" value="Submit" /> </td> </tr> </table> </form> <?php adminfoot(); }
//Shoutbox settings function shoutboxset_theme(){
global $globals, $theme, $error; //Admin Headers includes Global Headers adminhead('Administration Center - Shout Box Settings'); ?> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/chat.gif"> </td> <td align="left" class="adcbg1"> <font class="adgreen">Shout Box</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> Here you can manage the Shout Box of the board. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="shoutboxsetform"> <table width="100%" cellpadding="2" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> Shout Box Settings </td> </tr> <tr> <td class="adbg" width="45%"> <b>Enable ShoutBox :</b><br /> <font class="adexp">This is a good feature if you want the users to interact easily.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="enableshoutbox" <?php echo (isset($_POST['enableshoutbox']) ? 'checked="checked"' : ($globals['enableshoutbox'] ? 'checked="checked"' : ''));?> /> </td> </tr> <tr> <td class="adbg"> <b>Number of Shouts :</b><br /> <font class="adexp">This is the number of shouts to return on first-load or reload.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="shouts" value="<?php echo (empty($_POST['shouts']) ? $globals['shouts'] : $_POST['shouts']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Shout Life :</b><br /> <font class="adexp">After this time limit a Shout is deleted to cleanup some space.(In Minutes)<br />Recommended time is 1440 Minutes i.e. one day. Zero - 0 for no limit.</font> </td> <td class="adbg" align="left"> <input type="text" size="40" name="shoutboxtime" value="<?php echo (empty($_POST['shoutboxtime']) ? $globals['shoutboxtime'] : $_POST['shoutboxtime']);?>" /> </td> </tr> <tr> <td class="adbg"> <b>Enable Smilies :</b><br /> <font class="adexp">If checked smilies will be parsed in the shouts.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="shoutbox_emot" <?php echo (isset($_POST['shoutbox_emot']) ? 'checked="checked"' : ($globals['shoutbox_emot'] ? 'checked="checked"' : ''));?> /> </td> </tr> <tr> <td class="adbg"> <b>Enable Normal BBC :</b><br /> <font class="adexp">This will enable normal bbc like bold, underline, italics, strike, sup, sub, left, center, right, hr, font size, font family and font color.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="shoutbox_nbbc" <?php echo (isset($_POST['shoutbox_nbbc']) ? 'checked="checked"' : ($globals['shoutbox_nbbc'] ? 'checked="checked"' : ''));?> /> </td> </tr> <tr> <td class="adbg"> <b>Enable Special BBC :</b><br /> <font class="adexp">This will enable special bbc like URL, FTP, Email, Code, PHP, Quote, Images, Flash, List and autolinks. (We dont recommend this in the shoutbox)</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="shoutbox_sbbc" <?php echo (isset($_POST['shoutbox_sbbc']) ? 'checked="checked"' : ($globals['shoutbox_sbbc'] ? 'checked="checked"' : ''));?> /> </td> </tr> <tr> <td class="adbg" colspan="2" align="center"> <input type="submit" name="editshoutboxset" value="Submit" /> </td> </tr> </table> <br /><br /> <table width="100%" cellpadding="1" cellspacing="1" class="cbor"> <tr> <td class="adcbg" colspan="2"> Delete all Shouts </td> </tr> <tr> <td class="adbg" width="45%"> <b>Start Count again :</b><br /> <font class="adexp">This will truncate the shoutbox table and restart conuting. If it is not selected only the shouts will be deleted.</font> </td> <td class="adbg" align="left"> <input type="checkbox" name="truncatetable" checked="checked" /> </td> </tr> <tr> <td align="center" class="adbg" colspan="2"> <input type="submit" name="delallshouts" value="Delete" /> </td> </tr> </table> </form> <?php adminfoot(); }
//Updates function updates_theme(){
global $globals, $theme, $error, $info; //Admin Headers includes Global Headers adminhead('Administration Center - Update AEB'); ?> <table width="100%" cellpadding="1" cellspacing="0" class="cbor"> <tr> <td align="right" width="40%" class="adcbg1"> <img src="<?php echo $theme['images'];?>admin/updates.gif"> </td> <td align="left" class="adcbg1"> <font class="adgreen">Update your board</font><br /> </td> </tr> <tr> <td align="left" colspan="2" class="adbg"> Here you can install and update to the latest version of AeonBoard. Before proceeding we request you to please <b>take a backup of your Database</b>. </td> </tr> </table> <br /><br /> <?php error_handle($error, '100%'); ?> <form action="" method="post" name="updatesform"> <table width="100%" cellpadding="5" cellspacing="1" class="cbor"> <tr> <td class="adbg" width="45%"> <b>Current Version :</b> </td> <td class="adbg" align="left"> <?php echo $globals['version'];?> </td> </tr> <tr> <td class="adbg"> <b>Latest Version :</b> </td> <td class="adbg" align="left"> <?php echo (empty($info['version']) ? '<i>Could not connect to AEB</i>' : $info['version']);?> </td> </tr> <tr> <td class="adbg" colspan="2"> <?php echo $info['message'];?> </td> </tr> <tr> <td class="adbg" colspan="2" align="center"> <input type="submit" name="update" value="Submit" <?php echo (empty($info['link']) ? 'disabled="disabled"' : '');?> /> </td> </tr> </table> </form> <?php adminfoot(); }
?>
the above one handles the theme
PHP Code:
<?php
if(!defined('AEB')){
die('Restricted access');
}
function conpan(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme;
//The name of the file $theme['init_theme'] = 'admin/conpan'; //The name of the Page $theme['init_theme_name'] = 'Admin Center - Control Panel'; //Array of functions to initialize $theme['init_theme_func'] = array('coreset_theme', 'mysqlset_theme', 'onoff_theme', 'mailset_theme', 'genset_theme', 'shoutboxset_theme', 'updates_theme'); //My activity $globals['last_activity'] = 'acp';
//If a second Admin act is set then go by that if(isset($_GET['seadact']) && trim($_GET['seadact'])!==""){ $seadact = inputsec(htmlizer(trim($_GET['seadact']))); }else{ $seadact = ""; }
//The switch handler switch($seadact){ //This is for managing core settings default: case 'coreset': coreset(); break; //MySQL Settings case 'mysqlset': mysqlset(); break; //Turn Board On/Off case 'onoff': onoff(); break; //Mail Settings case 'mailset': mailset(); break; //General Settings case 'genset': genset(); break; //Shoutbox Settings case 'shoutboxset': shoutboxset(); break; //Updates case 'updates': updates(); break; }
}
//Function to manage core settings function coreset(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $url = ''; $sn = ''; $board_email = ''; $server_url = ''; $mainfiles = ''; $themesdir = ''; $gzip = 0; $cookie_name = ''; if(isset($_POST['editcoreset'])){ //The URL if(!(isset($_POST['url'])) || (trim($_POST['url']) == "")){ $error[] = 'The Board URL was not specified.'; }else{ $url = inputsec(htmlizer(trim($_POST['url']))); $url = rtrim($url, '/\\'); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The Site's Name if(!(isset($_POST['sn'])) || (trim($_POST['sn']) == "")){ $error[] = 'The Site name was not specified.'; }else{ $sn = inputsec(htmlizer(trim($_POST['sn']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The Board Email if(!(isset($_POST['board_email'])) || (trim($_POST['board_email']) == "")){ $error[] = 'The boards email address was not specified.'; }else{ $board_email = inputsec(htmlizer(trim($_POST['board_email']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The AEB Folder if(!(isset($_POST['server_url'])) || (trim($_POST['server_url']) == "")){ $error[] = 'The location of the ".global['usite']" Folder was not specified.'; }else{ $server_url = inputsec(htmlizer(trim($_POST['server_url']))); $server_url = rtrim($server_url, '/\\'); if(!file_exists($server_url.'/universal.php')){ $error[] = 'The location of the ".global['usite']" Folder is invalid.'; } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The ".global['usite']" Main Files if(!(isset($_POST['mainfiles'])) || (trim($_POST['mainfiles']) == "")){ $error[] = 'The location of the ".global['usite']" Main Files was not specified.'; }else{ $mainfiles = inputsec(htmlizer(trim($_POST['mainfiles']))); $mainfiles = rtrim($mainfiles, '/\\'); if(!file_exists($mainfiles.'/functions.php')){ $error[] = 'The location of the ".global['usite']" Main Files is invalid.'; } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The Themes Directory if(!(isset($_POST['themesdir'])) || (trim($_POST['themesdir']) == "")){ $error[] = 'The location of the themes directory was not specified.'; }else{ $themesdir = inputsec(htmlizer(trim($_POST['themesdir']))); $themesdir = rtrim($themesdir, '/\\'); if(!file_exists($themesdir.'/default')){ $error[] = 'The location of the themes directory is invalid.'; } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //The ".global['usite']" Folder if(!(isset($_POST['cookie_name'])) || (trim($_POST['cookie_name']) == "")){ $error[] = 'The Cookie name was not specified.'; }else{ $cookie_name = inputsec(htmlizer(trim($_POST['cookie_name']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'coreset_theme'; return false; } //Give compressed output if(isset($_POST['gzip'])){ $gzip = 1; } $coreset = array('url' => array($url, 0), 'sn' => array($sn, 0), 'board_email' => array($board_email, 0), 'server_url' => array($server_url, 0), 'mainfiles' => array($mainfiles, 0), 'themesdir' => array($themesdir, 0), 'gzip' => array($gzip, 1), 'cookie_name' => array($cookie_name, 0) ); if(!modify_universal($coreset)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=coreset'); return true; }else{ $theme['call_theme_func'] = 'coreset_theme'; }
}//End of function
//Function to manage mysql settings function mysqlset(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $muser = ''; $password = ''; $database = ''; $dbprefix = ''; $server = ''; if(isset($_POST['editmysqlset'])){ //The MySQL user if(!(isset($_POST['user'])) || (trim($_POST['user']) == "")){ $error[] = 'The MySQL user was not specified.'; }else{ $muser = inputsec(htmlizer(trim($_POST['user']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'mysqlset_theme'; return false; } //The MySQL password - May not be there if(isset($_POST['password']) && trim($_POST['password']) != ""){ $password = inputsec(htmlizer(trim($_POST['password']))); } //The MySQL database if(!(isset($_POST['database'])) || (trim($_POST['database']) == "")){ $error[] = 'The MySQL database was not specified.'; }else{ $database = inputsec(htmlizer(trim($_POST['database']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'mysqlset_theme'; return false; } //The MySQL dbprefix if(isset($_POST['dbprefix']) && trim($_POST['dbprefix']) != ""){ $dbprefix = inputsec(htmlizer(trim($_POST['dbprefix']))); } //The MySQL server if(!(isset($_POST['server'])) || (trim($_POST['server']) == "")){ $error[] = 'The MySQL server was not specified.'; }else{ $server = inputsec(htmlizer(trim($_POST['server']))); } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'mysqlset_theme'; return false; } $mysqlset = array('user' => array($muser, 0), 'password' => array($password, 0), 'database' => array($database, 0), 'dbprefix' => array($dbprefix, 0), 'server' => array($server, 0) ); if(!modify_universal($mysqlset)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=mysqlset'); return true; }else{ $theme['call_theme_func'] = 'mysqlset_theme'; }
}//End of function
//Function to Turn Board On/Off function onoff(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $maintenance = 0; $maintenance_subject = ''; $maintenance_message = ''; if(isset($_POST['editonoff'])){ //Enable Smileys if(isset($_POST['maintenance'])){ $maintenance = 1; //The Maintenance subject if(!(isset($_POST['maintenance_subject'])) || (trim($_POST['maintenance_subject']) == "")){ $error[] = 'The Maintenance subject was not specified.'; }else{ $maintenance_subject = inputsec(htmlizer(trim($_POST['maintenance_subject']))); } //The Maintenance subject if(!(isset($_POST['maintenance_message'])) || (trim($_POST['maintenance_message']) == "")){ $error[] = 'The Maintenance message was not specified.'; }else{ $maintenance_message = inputsec(htmlizer(trim($_POST['maintenance_message']))); } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'onoff_theme'; return false; } //The array containing the SMILEY SETTING Changes $onoff = array('maintenance' => $maintenance, 'maintenance_subject' => $maintenance_subject, 'maintenance_message' => $maintenance_message, ); if(!modify_registry($onoff)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=onoff'); return true; }else{ $theme['call_theme_func'] = 'onoff_theme'; }
}//End of function
//Function to manage mail settings function mailset(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $mail = 0; $mail_user = ''; $mail_pass = ''; $mail_server = ''; $mail_port = 0; if(isset($_POST['editmailset'])){ //The Mail type if(!(isset($_POST['mail'])) || (trim($_POST['mail']) == "")){ $error[] = 'The Mail type was not specified.'; }else{ $mail = (int) inputsec(htmlizer(trim($_POST['mail']))); if(!in_array($mail, array(0,1))){ $error[] = 'The Mail type is invalid.'; } } if($mail == 0){ //The SMTP Mail user if(!(isset($_POST['mail_user'])) || (trim($_POST['mail_user']) == "")){ $error[] = 'The SMTP mail username was not specified.'; }else{ $mail_user = inputsec(htmlizer(trim($_POST['mail_user']))); } //The SMTP Mail password if(!(isset($_POST['mail_pass'])) || (trim($_POST['mail_pass']) == "")){ $error[] = 'The password was not specified.'; }else{ $mail_pass = inputsec(htmlizer(trim($_POST['mail_pass']))); } //The SMTP Mail server if(!(isset($_POST['mail_server'])) || (trim($_POST['mail_server']) == "")){ $error[] = 'The SMTP server address was not specified.'; }else{ $mail_server = inputsec(htmlizer(trim($_POST['mail_server']))); } //The SMTP Mail port if(!(isset($_POST['mail_port'])) || (trim($_POST['mail_port']) == "")){ $error[] = 'The SMTP port was not specified.'; }else{ $mail_port = (int) inputsec(htmlizer(trim($_POST['mail_port']))); } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'mailset_theme'; return false; } //The array containing the MAIL SETTING Changes $mailset = array('mail' => $mail, 'mail_user' => $mail_user, 'mail_pass' => $mail_pass, 'mail_server' => $mail_server, 'mail_port' => $mail_port, ); if(!modify_registry($mailset)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=mailset'); return true; }else{ $theme['call_theme_func'] = 'mailset_theme'; }
}//End of function
//Function to manage general settings function genset(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error, $lang_folders; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $notifications = 0;//If notifications are allowed. $subscribeauto = 0;//If notifications are allowed then to subscribe automatically. $session_timeout = 0;//Delete sessions which are inactive greater than this(in seconds) $last_active_span = 0;//Users Active in the last X Minutes $only_users = 0;//Whether only users are allowed to view the forum.(Permission 'view_forum' is required) $stats = 0;//Track daily stats $memhideemail = 0;//Can the members hide email from one another $showmemdetails = 0;//Can the guests see the member details $maxactivelist = 0;//Maximum Active users in the active users list $maxmemberlist = 0;//Maximum Users in the Members list $numsubinpage = 0;//The number of subscriptions that can be seen in a page $countinboardposts = 0;//Count the inboard Posts $enablenews = 0;//Enable the News system $users_visited_today = 0;//Users who visited today $recent_posts = 0;//Recent Posts $lang_folders = array(); $folders = filelist($globals['server_url'].'/languages/', 0, 1); foreach($folders as $k => $v){ $lang_folders[$v['name']] = $v['name']; } //r_print($lang_folders); if(isset($_POST['editgenset'])){ //Enable Notifications if(isset($_POST['notifications'])){ $notifications = 1; } //Subscribe automatically if(isset($_POST['subscribeauto'])){ $subscribeauto = 1; } //Only users can browse if(isset($_POST['only_users'])){ $only_users = 1; } //Enable Stats if(isset($_POST['stats'])){ $stats = 1; } //Can members hide email if(isset($_POST['memhideemail'])){ $memhideemail = 1; } //Show members details to guests if(isset($_POST['showmemdetails'])){ $showmemdetails = 1; } //The session_timeout if(!(isset($_POST['session_timeout'])) || (trim($_POST['session_timeout']) == "")){ $error[] = 'The session timeout was not specified.'; }else{ $session_timeout = (int) inputsec(htmlizer(trim($_POST['session_timeout']))); } //The time for users to be considered active if(!(isset($_POST['last_active_span'])) || (trim($_POST['last_active_span']) == "")){ $error[] = 'The time for users to be considered active was not specified.'; }else{ $last_active_span = (int) inputsec(htmlizer(trim($_POST['last_active_span']))); } //The number of users to show in active list if(!(isset($_POST['maxactivelist'])) || (trim($_POST['maxactivelist']) == "")){ $error[] = 'The number of active users to show in the active users list was not specified.'; }else{ $maxactivelist = (int) inputsec(htmlizer(trim($_POST['maxactivelist']))); } //The number of members to show in the members list if(!(isset($_POST['maxmemberlist'])) || (trim($_POST['maxmemberlist']) == "")){ $error[] = 'The number of members to show in the members list was not specified.'; }else{ $maxmemberlist = (int) inputsec(htmlizer(trim($_POST['maxmemberlist']))); } //The number of subscriptions to show in the subscriptions list if(!(isset($_POST['numsubinpage'])) || (trim($_POST['numsubinpage']) == "")){ $error[] = 'The number of subscriptions to show in the subscriptions list was not specified.'; }else{ $numsubinpage = (int) inputsec(htmlizer(trim($_POST['numsubinpage']))); } //The number of recent posts was not specified if(!(isset($_POST['recent_posts'])) || (trim($_POST['recent_posts']) == "")){ $error[] = 'The number of recent posts was not specified.'; }else{ $recent_posts = (int) inputsec(htmlizer(trim($_POST['recent_posts']))); } //The language if(!(isset($_POST['language'])) || (trim($_POST['language']) == "")){ $error[] = 'The default board language was not specified.'; }else{ $language = inputsec(htmlizer(trim($_POST['language']))); if(!in_array($language, $lang_folders)){ $error[] = 'The language you specified does not exist.'; } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'genset_theme'; return false; } //Count inboard Posts if(isset($_POST['countinboardposts'])){ $countinboardposts = 1; } //Enable the News System if(isset($_POST['enablenews'])){ $enablenews = 1; } //Enable the News System if(isset($_POST['users_visited_today'])){ $users_visited_today = 1; } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'genset_theme'; return false; } //The array containing the GENERAL SETTING Changes $genset = array('notifications' => $notifications, 'subscribeauto' => $subscribeauto, 'numsubinpage' => $numsubinpage, 'session_timeout' => $session_timeout, 'last_active_span' => $last_active_span, 'only_users' => $only_users, 'stats' => $stats, 'memhideemail' => $memhideemail, 'showmemdetails' => $showmemdetails, 'maxactivelist' => $maxactivelist, 'maxmemberlist' => $maxmemberlist, 'countinboardposts' => $countinboardposts, 'enablenews' => $enablenews, 'users_visited_today' => $users_visited_today, 'recent_posts' => $recent_posts, 'language' => $language ); if(!modify_registry($genset)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=genset'); return true;
}else{ $theme['call_theme_func'] = 'genset_theme'; }
}//End of function
//Function to manage shoutbox settings function shoutboxset(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $enableshoutbox = 0;//Enable shoutbox $shouts = 0;//The number of shouts to return on first-load or reload $shoutboxtime = 0;//After this time limit a Shout is deleted to cleanup some space.(In Minutes) $shoutbox_emot = 0;//Allow smileys or not.
$shoutbox_nbbc = 0;//Allow Normal BBC or no
$shoutbox_sbbc = 0;//Allow Special BBC or no. if(isset($_POST['editshoutboxset'])){ //Enable ShoutBox if(isset($_POST['enableshoutbox'])){ $enableshoutbox = 1; } //Enable Smilies if(isset($_POST['shoutbox_emot'])){ $shoutbox_emot = 1; } //Enable Normal BBC if(isset($_POST['shoutbox_nbbc'])){ $shoutbox_nbbc = 1; } //Enable Special BBC if(isset($_POST['shoutbox_sbbc'])){ $shoutbox_sbbc = 1; } //The lifetime of a Shout if(!(isset($_POST['shoutboxtime'])) || (trim($_POST['shoutboxtime']) == "")){ $error[] = 'The lifetime of a Shout was not specified.'; }else{ $shoutboxtime = (int) inputsec(htmlizer(trim($_POST['shoutboxtime']))); } //The number of shouts on load if(!(isset($_POST['shouts'])) || (trim($_POST['shouts']) == "")){ $error[] = 'The number of shouts on load was not specified.'; }else{ $shouts = (int) inputsec(htmlizer(trim($_POST['shouts']))); if($shouts < 1){ $error[] = 'The number of shouts on load should be greater than 1.'; } } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'shoutboxset_theme'; return false; } //The array containing the GENERAL SETTING Changes $genset = array('enableshoutbox' => $enableshoutbox, 'shouts' => $shouts, 'shoutboxtime' => $shoutboxtime, 'shoutbox_emot' => $shoutbox_emot, 'shoutbox_nbbc' => $shoutbox_nbbc, 'shoutbox_sbbc' => $shoutbox_sbbc ); if(!modify_registry($genset)){ return false; } //Redirect redirect('act=admin&adact=conpan&seadact=shoutboxset'); return true;
}elseif(isset($_POST['delallshouts'])){ //Truncate table if(isset($_POST['truncatetable'])){ //Truncate Table $qresult = makequery("TRUNCATE TABLE ".$dbtables['shouts']); }else{ //Just Delete $qresult = makequery("DELETE FROM ".$dbtables['shouts']); } //Redirect redirect('act=admin&adact=conpan&seadact=shoutboxset'); return true; }else{ $theme['call_theme_func'] = 'shoutboxset_theme'; }
}//End of function
//Checks and installs updates function updates(){
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEB_SESS, $theme; global $error, $info; ///////////////////////////// // Define the necessary VARS ///////////////////////////// $error = array(); $info = array(); //$aeburl = 'http://localhost/".global['usite']"/updates.php?version='.$globals['version']; $aeburl = 'http://www.".global['usite']".com/aebinfo.js?version='.$globals['version']; $aebmessage = get_web_file($aeburl); if(empty($aebmessage)){ $info['message'] = 'We were unable to connect to <a href="http://www.".global['usite']".com">".global['usite']"</a>.'; } $info = aebunserialize($aebmessage);//r_print($info); //Was there some info recieved if(empty($info['version'])){ $info['message'] = 'We were unable to connect to <a href="http://www.".global['usite']".com">".global['usite']"</a>.'; } if(isset($_POST['update']) && !empty($info['link'])){ //Try to give some more time @set_time_limit(300); //Memory limit @ini_set('memory_limit', '128M'); $compressedfile = $globals['server_url'].'/'.basename($info['link']); //Get the file if(!get_web_file($info['link'], $compressedfile)){ $error[] = 'There were errors while downloading the file from the ".global['usite']" site.'; } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'updates_theme'; return false; } //Lets Decompress if(!decompress($compressedfile, $globals['server_url'], 1)){ $error[] = 'Could not decompress the Upgrade Files.'; } //on error call the form if(!empty($error)){ $theme['call_theme_func'] = 'updates_theme'; return false; } //Looks like everything went fine - Redirect header("Location: ".$globals['url'].$info['redirect']); return true;
}else{ $theme['call_theme_func'] = 'updates_theme'; }
}//End of function
?>
the above one is the main page its self that has all functions
|