1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-15 03:54:39 +01:00
php-e107/e107_plugins/forum/forum_setup.php

60 lines
1.2 KiB
PHP
Raw Normal View History

2009-10-20 03:58:47 +00:00
<?php
/*
* e107 website system
*
2009-11-18 01:49:18 +00:00
* Copyright (C) 2008-2009 e107 Inc (e107.org)
2009-10-20 03:58:47 +00:00
* 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 $
2010-02-10 18:18:01 +00:00
* $Revision$
* $Date$
* $Author$
2009-10-20 03:58:47 +00:00
*
*/
class forum_setup
{
function install_pre($var)
2009-10-20 03:58:47 +00:00
{
// print_a($var);
// echo "custom install 'pre' function<br /><br />";
2009-10-20 03:58:47 +00:00
}
function install_post($var)
2009-10-20 03:58:47 +00:00
{
$sql = e107::getDb();
$mes = e107::getMessage();
2009-10-20 03:58:47 +00:00
/*if($sql -> db_Update("user", "user_forums='0'")) // deprecated in 0.8
2009-10-20 03:58:47 +00:00
{
$mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS);
}*/
2009-10-20 03:58:47 +00:00
}
function uninstall_post($var)
2009-10-20 03:58:47 +00:00
{
$sql = e107::getDb();
$mes = e107::getMessage();
2009-10-20 03:58:47 +00:00
/* if($sql -> db_Update("user", "user_forums='0'")) // deprecated in 0.8
2009-10-20 03:58:47 +00:00
{
$mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS);
}*/
2009-10-20 03:58:47 +00:00
}
function upgrade_post($var)
2009-10-20 03:58:47 +00:00
{
$sql = e107::getDb();
$mes = e107::getMessage();
2009-10-20 03:58:47 +00:00
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);
}
}
}