Create infusion
Geschrieben von gozoc am 11. Juni 2009 16:43
In BS-Fusion, it is no longer required to define the listing of its own infusions with infusionname_panel, because BS-Fusion uses an additional directory panels, in which all panel files can be stored.
The filename for this folder, has to be infusionname_panel.php.

The infusion.php for installation:
<?php
############## Check for direct call to the file ###################
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }

######### Inclusion of the language file ##############
if (file_exists(INFUSIONS."infusionname/locale/".LANGUAGE.".php")) {
    include INFUSIONS."infusionname/locale/".LANGUAGE.".php";
} else {
    include INFUSIONS."infusionname/locale/German.php";
}

########  Informations about the infusion ##########

$inf_title = $locale['xxxxxx'];
$inf_description = $locale['xxxxxx'];
$inf_version = "1.0";
$inf_developer = "developer";
$inf_email = "developer email";
$inf_weburl = "developer homepage";
$inf_folder = "infusionname";


########## Informations with infusions with administration ##############

// The icon for the infusion-admin must be in /administration/images/

$inf_admin_image = "infusion_panel.gif"; 

// Admin-file

$inf_admin_panel = "infusionsadmin.php";

// Admin rights for this iInfusion
/*
If you dont want to give any admin the "IP" access to the admin area of the infusion, then there is a token to their own rights. The law allows a maximum of 4 characters. The right may not exist, because the infusion is not correctly installed. If this variable is empty, the "IP" law used.
*/

$inf_admin_rights = "IP";

/*
This variable is used to which panels are included.
If you want to uninstall the infusion, then these panels are deleted from the database, so that no errors arise.
*/

$inf_panels = array("infusionname_panel","infusionname_other_panel");

#########  Information for the  Sitelinks ############

/**
Fill these variables only, if a page link should be created in the navigation panel.
*/

$inf_link_name = "";             // Linkname
$inf_link_url = "";                  // Linkurl
$inf_link_visibility = "0";       // Userlevel for visibility

########## Database informations #################

$inf_newtables = 1;                   // Number of new tables
$inf_insertdbrows = 1;              // Number of new table entries
$inf_altertables = 0;                   // Number of changes in tables
$inf_deldbrows = 0;                   // Number of table deletes

// delete entries, which are not needed.

$inf_newtable_[1] = "tablename (
feld1 SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
feld2 TINYINT(5) UNSIGNED DEFAULT '1' NOT NULL,
feld3 VARCHAR(200) DEFAULT '' NOT NULL,
feld4 VARCHAR(50) DEFAULT '' NOT NULL,
PRIMARY KEY (feld1)
) TYPE=MyISAM;";

$inf_insertdbrow_[1] = "tablename (feld1, feld2, feld3, feld4) VALUES('', '', '', '')";

$inf_altertable_[1] = "tablename ADD etc";

$inf_deldbrow_[1] = "tablename WHERE-KLAUSEL";

// Löschung der Tabelle bei Deinstallation
$inf_droptable_[1] = "tablename";

//  tablename without the DB_PREFIX

?>
New file:filename.php
<?php
/*---------------------------------------------------------+
| BS-Fusion 1.00 - Content Management System
+----------------------------------------------------------+
| Copyright © 2009 Manuel Kurz
| http://www.bs-fusion.org/
+----------------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------------+
| Code based on PHP-Fusion
| http://www.php-fusion.co.uk/
+----------------------------------------------------------*/
require_once "../../maincore.php";

#########  embedding the language file ##############
if (file_exists(INFUSIONS."infusionname/locale/".LANGUAGE.".php")) {
    include INFUSIONS."infusionname/locale/".LANGUAGE.".php";
} else {
    include INFUSIONS."infusionname/locale/German.php";
}

// Give your own page title
$tpl->add_to_title('New title");

// insert the subheader file
require_once BASEDIR."subheader.php";

########### Linke Panels einbinden ###############
define("LEFT_OFF",false);                     
// true = Panels nicht anzeigen; false=Panels anzeigen
require_once BASEDIR."side_left.php";

##############  Hier beginnt dein Code ############

########### Rechte Panels einbinden ##############
define("RIGHT_OFF",false);
// true = Panels nicht anzeigen; false = Panels anzeigen
require_once BASEDIR."side_right.php";

############ Footerdatei einbinden ################
require_once BASEDIR."footer.php";
?>