2009-11-24 14:48:34 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* e107 website system
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008-2009 e107 Inc (e107.org)
|
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
2009-12-08 17:21:36 +00:00
|
|
|
* Custom Featurebox install/uninstall/update routines
|
2009-11-24 14:48:34 +00:00
|
|
|
*
|
|
|
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/featurebox_setup.php,v $
|
2010-02-10 18:18:01 +00:00
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
* $Author$
|
2009-11-24 14:48:34 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-12-08 17:21:36 +00:00
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
2009-11-24 14:48:34 +00:00
|
|
|
class featurebox_setup
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
function install_pre($var)
|
|
|
|
{
|
|
|
|
// print_a($var);
|
|
|
|
// echo "custom install 'pre' function<br /><br />";
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
function install_post($var)
|
|
|
|
{
|
2009-12-08 17:21:36 +00:00
|
|
|
e107::includeLan(e_PLUGIN.'featurebox/languages/'.e_LANGUAGE.'_admin_featurebox.php');
|
2009-11-24 14:48:34 +00:00
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
2009-12-08 17:21:36 +00:00
|
|
|
$query = array();
|
|
|
|
$query['fb_category_id'] = 0;
|
|
|
|
$query['fb_category_title'] = 'General';
|
2009-12-09 18:33:43 +00:00
|
|
|
$query['fb_category_template'] = 'default';
|
2009-12-08 17:21:36 +00:00
|
|
|
$query['fb_category_random'] = 0;
|
|
|
|
$query['fb_category_class'] = e_UC_PUBLIC;
|
|
|
|
$query['fb_category_limit'] = 1;
|
|
|
|
$inserted = e107::getDb()->db_Insert('featurebox_category', $query);
|
|
|
|
$status = $inserted ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
|
|
|
$mes->add(FBLAN_INSTALL_01, $status);
|
2009-11-24 14:48:34 +00:00
|
|
|
|
2009-12-08 17:21:36 +00:00
|
|
|
if($inserted)
|
|
|
|
{
|
|
|
|
$query = array();
|
|
|
|
$query['fb_id'] = 0;
|
|
|
|
$query['fb_category'] = $inserted;
|
|
|
|
$query['fb_title'] = 'Default Title';
|
|
|
|
$query['fb_text'] = 'Default Message';
|
|
|
|
$query['fb_mode'] = 0;
|
|
|
|
$query['fb_class'] = e_UC_PUBLIC;
|
|
|
|
$query['fb_rendertype'] = 0;
|
|
|
|
$query['fb_template'] = 'default';
|
|
|
|
$query['fb_order'] = 0;
|
|
|
|
$query['fb_image'] = '';
|
2009-12-09 18:33:43 +00:00
|
|
|
$query['fb_imageurl'] = '';
|
2009-12-08 17:21:36 +00:00
|
|
|
$status = e107::getDb('sql2')->db_Insert('featurebox', $query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$status = E_MESSAGE_ERROR;
|
|
|
|
}
|
|
|
|
$mes->add(FBLAN_INSTALL_02, $status);
|
2009-11-24 14:48:34 +00:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
function uninstall_options()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function uninstall_post($var)
|
|
|
|
{
|
|
|
|
// print_a($var);
|
|
|
|
}
|
|
|
|
|
|
|
|
function upgrade_post($var)
|
|
|
|
{
|
|
|
|
// $sql = e107::getDb();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
?>
|