File: /var/www/ilya/data/www/kamforum.ru/modules/mod_example.php
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.1.5
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Sun, 09 Oct 2005 11:51:26 GMT
| Release: 1a47e28f0443faa9f14d0c0a45151e54
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > MODULE FILE (EXAMPLE)
| > Module written by Matt Mecham
| > Date started: Thu 14th April 2005 (17:59)
|
+--------------------------------------------------------------------------
*/
//=====================================
// Define class, this must be the same
// in all modules
//=====================================
class module
{
//=====================================
// Define vars if required
//=====================================
var $ipsclass;
var $class = "";
var $module = "";
var $html = "";
var $result = "";
//=====================================
// Constructer, called and run by IPB
//=====================================
function run_module()
{
//=====================================
// Do any set up here, like load lang
// skin files, etc
//=====================================
$this->ipsclass->load_language('lang_boards');
$this->ipsclass->load_template('skin_boards');
//=====================================
// Set up structure
//=====================================
switch( $this->ipsclass->input['cmd'] )
{
case 'dosomething':
$this->do_something();
break;
default:
$this->do_something();
break;
}
print $this->result;
exit();
}
//------------------------------------------
// do_something
//
// Test sub, show if admin or not..
//
//------------------------------------------
function do_something()
{
if ( $this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'] )
{
$this->result = "You're an admin!";
}
else
{
$this->result = "You're not an admin!";
}
}
}
?>