1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00
php-e107/e107_plugins/featurebox/featurebox_setup.php

85 lines
1.9 KiB
PHP
Raw Normal View History

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)
*
* 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
*
*/
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)
{
e107::includeLan(e_PLUGIN.'featurebox/languages/'.e_LANGUAGE.'_admin_featurebox.php');
2009-11-24 14:48:34 +00:00
$mes = e107::getMessage();
$query = array();
$query['fb_category_id'] = 0;
$query['fb_category_title'] = 'General';
$query['fb_category_template'] = 'default';
$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
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'] = '';
$query['fb_imageurl'] = '';
$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();
}
*/
}
?>