1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 16:17:14 +02:00

featurebox front-end - work in progress

This commit is contained in:
secretr
2009-12-08 17:21:36 +00:00
parent 0df76288bb
commit 11d37fdc76
15 changed files with 398 additions and 131 deletions

View File

@@ -6,15 +6,17 @@
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Custom FAQ install/uninstall/update routines
* Custom Featurebox install/uninstall/update routines
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/featurebox_setup.php,v $
* $Revision: 1.2 $
* $Date: 2009-11-26 17:15:46 $
* $Revision: 1.3 $
* $Date: 2009-12-08 17:21:31 $
* $Author: secretr $
*
*/
if (!defined('e107_INIT')) { exit; }
class featurebox_setup
{
/*
@@ -26,25 +28,41 @@ class featurebox_setup
*/
function install_post($var)
{
$sql = e107::getDb();
e107::includeLan(e_PLUGIN.'featurebox/languages/'.e_LANGUAGE.'_admin_featurebox.php');
$mes = e107::getMessage();
$query = "
INSERT INTO #featurebox (`fb_id`, `fb_title`, `fb_text`, `fb_mode`, `fb_class`, `fb_rendertype`, `fb_template`, `fb_order`, `fb_image`, `fb_imageurl`, `fb_category`) VALUES
(1, 'Default Title', 'Default Message', 0, 0, 0, '0', 0, '', '', 0);
";
$query = array();
$query['fb_category_id'] = 0;
$query['fb_category_title'] = 'General';
$query['fb_category_layout'] = '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);
$query2 = "
INSERT INTO #featurebox_category (`fb_category_id`, `fb_category_title`, `fb_category_class`, `fb_category_order`) VALUES
(1, 'General', 0, 0);
";
//FIXME - I should be able to put both INSERTs into the same $query. MySQL class issue.
$status = ($sql->db_Select_gen($query)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add("Adding Default table data.",$status);
$status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add("Adding Default table data.",$status);
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'] = 0;
$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);
}
/*
function uninstall_options()