ACP Prefs functions
| > Module written by Matt Mecham
| > Date started: 22nd May 2003
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "
Incorrect access
You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
$idx = new ad_prefs();
class ad_prefs {
var $base_url;
function ad_prefs() {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
//---------------------------------------
// Kill globals - globals bad, Homer good.
//---------------------------------------
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
foreach ( $tmp_in as $k => $v )
{
unset($$k);
}
//---------------------------------------
// Show the wee form
//---------------------------------------
if ( $IN['set'] == 1 )
{
$this->msg = 'Savings set';
if ( $IN['tx'] == "" or $IN['ty'] == "" )
{
$this->msg = 'Please complete the form';
print $this->get_html();
}
else
{
$std->my_setcookie( 'acpprefs', $IN['menu'] .','. $IN['tx'] .','. $IN['ty'] .','. $IN['preview']);
$this->msg = 'Settings saved';
$this->tx = $IN['tx'];
$this->ty = $IN['ty'];
if ( $IN['menu'] )
{
$this->s_yes = 'selected';
$this->s_no = '';
}
else
{
$this->s_yes = '';
$this->s_no = 'selected';
}
if ( $IN['preview'] )
{
$this->p_yes = 'selected';
$this->p_no = '';
}
else
{
$this->p_yes = '';
$this->p_no = 'selected';
}
print $this->get_html();
}
}
else
{
$state = 0;
$tx = 80;
$ty = 40;
if ( $cookie = $std->my_getcookie('acpprefs') )
{
list( $state, $tx, $ty, $prev_show ) = explode( ",", $cookie );
}
$this->tx = $tx;
$this->ty = $ty;
if ( $state )
{
$this->s_yes = 'selected';
$this->s_no = '';
}
else
{
$this->s_yes = '';
$this->s_no = 'selected';
}
if ( $prev_show )
{
$this->p_yes = 'selected';
$this->p_no = '';
}
else
{
$this->p_yes = '';
$this->p_no = 'selected';
}
print $this->get_html();
}
}
function get_html()
{
global $SKIN;
$hit_muhl = <<
IPB-ACP Prefs