1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 00:54:49 +02:00

Adding setup files

This commit is contained in:
CaMer0n
2009-10-20 03:58:47 +00:00
parent 5656cce43d
commit a9050cc2a3
5 changed files with 224 additions and 3 deletions

View File

@@ -0,0 +1,59 @@
<?php
/*
* e107 website system
*
* Copyright ( c ) 2001-2008 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Custom forum install/uninstall/update routines
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_setup.php,v $
* $Revision: 1.1 $
* $Date: 2009-10-20 03:58:47 $
* $Author: e107coders $
*
*/
class forum_setup
{
function forum_install_pre(&$var)
{
print_a($var);
echo "custom install 'pre' function<br /><br />";
}
function forum_install_post(&$var)
{
$sql = e107::getDb();
$mes = eMessage::getInstance();
if($sql -> db_Update("user", "user_forums='0'"))
{
$mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS);
}
}
function forum_uninstall_post(&$var)
{
$sql = e107::getDb();
$mes = eMessage::getInstance();
if($sql -> db_Update("user", "user_forums='0'"))
{
$mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS);
}
}
function forum_upgrade_post(&$var)
{
$sql = e107::getDb();
$mes = eMessage::getInstance();
if(version_compare($var['current_plug']['plugin_version'], "1.2", "<"))
{
$qry = "ALTER TABLE #forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;";
$sql->db_Select_gen($qry);
}
}
}