 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
03-02-2008, 07:08 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
Version Checker
ive started a version checker for my script but not shore of exactly how to doit .
1) i want it to show a message if its out of date and give a link
2) show a message to say its uptodate
any help would be appreciated i have designed the variable from the server but need this script to do rest
http://www.mysite.com/check.php?version=1.0.0
then if 1.0.0 the version is outdated but if 1.0.1 the version is current and uptodate
thank you
|
|
|
|
03-02-2008, 07:45 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Well, one of the most reliable ways is simply to make an file on your system which can be accessed remotely with file_get_contents(); or simply fopen or such. Then, it scans for the texts and if it finds 1.0.1 and then compares it to its own version, I'll notice that it's out of date.
I think that's the best, easy and reliable way.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-02-2008, 09:18 PM
|
#3 (permalink)
|
|
The Frequenter
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
|
Indeed, that's how most scripts do it. vBulletin for example uses some fancy Javascript ( http://version.vbulletin.com/versioncheck.js) for theirs but just a simple text file with the latest version number in it would work fine.
Alan
|
|
|
03-02-2008, 09:46 PM
|
#4 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Personally, I would use a remote XML file. Simply store it on your server and update it manually when you update your software. Have the software check the XML file periodically. Do not check for updates upon every page load as some individuals may not appreciate, although trivial, the bandwidth used upon each and every page load. Simply have it in the administrative area, for instance, and then only to individuals who have the ability to update the software -- if you have a hierarchy of administrators with differing permissions.
The good thing about XML is you can store lots of extra information in there. So you can have a version number, a download link, as well as a release log. The same goes for other similar storage formats, such as JSON.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
03-02-2008, 10:15 PM
|
#5 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
could someone give me an example as im not too shore really where to start and not sure if xml or php is better
|
|
|
|
03-02-2008, 11:35 PM
|
#6 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Try something like this  See attached.
Therefore to use it you would do something like the following, as DeMo suggested:
php Code:
$pVersion = new TalkPHP_VersionChecker (); $fCurrentVersion = 1. 0; $fLatestVersion = (float ) $pVersion-> getVersion(); if($fCurrentVersion < $fLatestVersion){ echo 'Version: ' . $fLatestVersion . '<br />'; echo 'Link: <a href="' . $pVersion-> getLink() . '">Download Update</a>'; }
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Last edited by Wildhoney : 03-03-2008 at 12:18 AM.
|
|
|
03-02-2008, 11:35 PM
|
#7 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Location: Brazil
Posts: 77
Thanks: 14
|
Here's a quick example, first we setup the XML file to hold the version information:
Code:
<?xml version="1.0" encoding="utf-8"?>
<version>
<number>2.3.0</number>
<releasedate>2008-03-02</releasedate>
<download>http://www.mysite.com/mysoft_230.zip</download>
</version>
Now for the PHP part.
We'll use a variable $current_version to hold the current version number. This can come from a database, from a file on the disk, another variable, a constant, you name it. Let's assume it came from somewhere and it's value is 2.2.0, so our software is not updated.
PHP Code:
<?php
// The current version
$current_version = "2.2.0";
// Let's load the XML with the version information
$xml = simplexml_load_file('http://www.mysite.com/version.xml');
// Do the version check
if ($current_version != $xml->number) {
// Versions are different
echo 'Your software is out of date!<br />';
echo 'Latest version: ' . $xml->number . '<br />';
echo 'Released: ' . $xml->releasedate . '<br />';
echo 'Download: ' . $xml->download;
} else {
// Versions are equal
echo 'Your software is up to date!';
}
?>
As you see, it compares $current_version to $xml->number and if they're different it shows the version information, if they're equal it shows a message that the software is updated.
This is a very simple system, if you change the version number to a lower version (say 1.1.0) it will still tell you that you need to update. One way to solve this is to remove the dots from the version numbers and then compare them, this way 2.2.0 becomes 220 and 1.1.0 becames 110, since 220 > 110 you know that you're up to date. 
|
|
|
03-03-2008, 12:06 AM
|
#8 (permalink)
|
|
The Contributor
Join Date: Sep 2007
Posts: 29
Thanks: 8
|
WARNING!
Using simplexml automatically makes your script PHP4 incompatible
|
|
|
|
03-03-2008, 03:53 AM
|
#9 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Location: Brazil
Posts: 77
Thanks: 14
|
Yes, but we all know that PHP4 has already received it's death sentence. 
Support for PHP4 will be avaliable until 2008-08-08, but ONLY to address security issues.
PHP4 will die, and since PHP6 has already been announced, everybody still living in the PHP4 age should really start moving to PHP5 now.
|
|
|
03-03-2008, 12:33 PM
|
#10 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
all the above are good by keep returning errors could someone help implement them as keet returning things like $end ect
|
|
|
|
03-03-2008, 01:43 PM
|
#11 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Have you tried looking up some tutorials or are you just following our advised blind? I am going to go with Wildhoney's method, and in addition mine. That's the best way. Once again, if you do not have any knowledge about it, or don't understand it, have your go with the fopen commands.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-03-2008, 01:55 PM
|
#12 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
i've looked at a few tutorials and on php.net about these things but implementing them is proving difficult
|
|
|
|
03-03-2008, 03:58 PM
|
#13 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
What is your current approach?
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-03-2008, 04:11 PM
|
#14 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
you mean what im trying prior to this or how ive tried implementing above methods?
|
|
|
|
03-03-2008, 04:13 PM
|
#15 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Quote:
Originally Posted by khile
you mean what im trying prior to this or how ive tried implementing above methods?
|
Correct. We'd appreciated it if you'd share your script with the community so we can help you out a bit better. We won't steal it or anything, if that's what you're wondering.  (some people do I guess...)
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-03-2008, 07:15 PM
|
#16 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
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
|
|
|
|
03-03-2008, 09:50 PM
|
#17 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Holy crap. That's a lot to go through but I will get to it a.s.a.p. Of course, if somebody beats me to it, that's OK as well. I'll get back to ya on that.
To clarify, can you sum up the lines which concerns your question?
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-04-2008, 09:44 AM
|
#18 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
Quote:
Originally Posted by ReSpawN
Holy crap. That's a lot to go through but I will get to it a.s.a.p. Of course, if somebody beats me to it, that's OK as well. I'll get back to ya on that.
To clarify, can you sum up the lines which concerns your question?
|
PHP Code:
//$aeburl = 'http://localhost/".global['usite']"/updates.php?version='.$globals['version']; $aeburl = 'http://www.".global['usite']".com/aebinfo.js?version='.$globals['version'];
</span></span>
|
|
|
|
03-04-2008, 10:36 AM
|
#19 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Well that won't work I guess. You're opening the variable with a single quote and escaping it with a double quote.
It should be;
PHP Code:
$aeburl = 'http://www.'$global['usite'].'.com/aebinfo.js?version='.$globals['version'];
You can also check the version with;
PHP Code:
$versionCheck = file_get_contents('http://www.'$global['usite'].'.com/aebinfo.js'); $versionCheck = explode('::', $versionCheck); foreach ($versionCheck as $key => $value) { echo $versionCheck[$key]. '<br>'; }
The source of that will will look like;
VersionName::Version::Publisher::TalkPHP::WhatEver
And it'll display it all with an enter.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
03-04-2008, 12:38 PM
|
#20 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 50
Thanks: 0
|
hmm maybe im doing something wrong keep getting Connection refused
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|