1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

featurebox - admin logging, plugin.xml created

This commit is contained in:
e107steved 2008-12-10 22:41:39 +00:00
parent a96c38306f
commit b9bd926c65
5 changed files with 87 additions and 121 deletions

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/admin_config.php,v $
| $Revision: 1.4 $
| $Date: 2008-11-20 20:35:24 $
| $Revision: 1.5 $
| $Date: 2008-12-10 22:41:39 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -26,12 +26,13 @@ require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."userclass_class.php");
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
//$rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', 'null*');
$rejecthumb = '~^thumb_|^th_';
$templatelist = $fl->get_files(e_PLUGIN."featurebox/templates/",$rejecthumb);
$templatelist = $fl->get_files(e_PLUGIN."featurebox/templates/");
if (e_QUERY) {
list($action, $id) = explode(".", e_QUERY);
if (e_QUERY)
{
$qs = explode(".", e_QUERY);
$action = varset($qs[0],FALSE);
$id = intval(varset($qs[1],0));
}
else
{
@ -39,44 +40,47 @@ else
$id = FALSE;
}
if(isset($_POST['createFB']))
if(isset($_POST['createFB']) || isset($_POST['updateFB']))
{
if ($_POST['fb_title'] && $_POST['fb_text']) {
$fb_title = $tp -> toDB($_POST['fb_title']);
$fb_text = $tp -> toDB($_POST['fb_text']);
$fb_mode = $_POST['fb_mode'];
$fb_class = $_POST['fb_class'];
$fb_rendertype = $_POST['fb_rendertype'];
$fb_template = $_POST['fb_template'];
$sql->db_Insert("featurebox", "0, '$fb_title', '$fb_text', '$fb_mode', '$fb_class', '$fb_rendertype', '$fb_template'");
$message = FBLAN_15;
} else {
if ($_POST['fb_title'] && $_POST['fb_text'])
{
$fbInfo = array();
$fbInfo['fb_title'] = $tp -> toDB($_POST['fb_title']);
$fbInfo['fb_text'] = $tp -> toDB($_POST['fb_text']);
$fbInfo['fb_mode'] = intval($_POST['fb_mode']);
$fbInfo['fb_class'] = intval($_POST['fb_class']);
$fbInfo['fb_rendertype'] = intval($_POST['fb_rendertype']);
$fbInfo['fb_template'] = $tp -> toDB($_POST['fb_template']);
if(isset($_POST['createFB']))
{
$sql->db_Insert("featurebox", $fbInfo);
$admin_log->logArrayAll('FBLAN_01',$fbInfo);
$message = FBLAN_15;
}
if(isset($_POST['updateFB']))
{
$sql->db_UpdateArray('featurebox',$fbInfo, 'WHERE `fb_id`='.intval($_POST['fb_id']));
$admin_log->logArrayAll('FBLAN_02',$fbInfo);
$message = FBLAN_16;
}
}
else
{
$message = FBLAN_17;
}
}
if(isset($_POST['updateFB']))
{
if ($_POST['fb_title'] && $_POST['fb_text']) {
$fb_title = $tp -> toDB($_POST['fb_title']);
$fb_text = $tp -> toDB($_POST['fb_text']);
$fb_mode = $_POST['fb_mode'];
$fb_class = $_POST['fb_class'];
$fb_rendertype = $_POST['fb_rendertype'];
$fb_template = $_POST['fb_template'];
$sql->db_Update("featurebox", "fb_title='$fb_title', fb_text='$fb_text', fb_mode='$fb_mode', fb_class='$fb_class', fb_rendertype='$fb_rendertype', fb_template='$fb_template' WHERE fb_id=".$_POST['fb_id']);
$message = FBLAN_16;
} else {
$message = FBLAN_17;
}
}
if($action == "delete") {
$sql->db_Delete("featurebox", "fb_id=$id");
if (($action == "delete") && $id)
{
$sql->db_Delete("featurebox", "fb_id=".$id);
$admin_log->log_event('FBLAN_03',$id,E_LOG_INFORMATIVE,'');
$message = FBLAN_18;
}
if (isset($message)) {
if (isset($message))
{
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
@ -118,7 +122,7 @@ $ns->tablerender(FBLAN_06, $text);
if($action == "edit")
{
if($sql->db_Select("featurebox", "*", "fb_id=$id"))
if($sql->db_Select("featurebox", "*", "fb_id=".$id))
{
$row = $sql->db_Fetch();
extract($row);
@ -136,14 +140,14 @@ $text = "<div style='text-align:center'>
<tr>
<td style='width:50%' class='forumheader3'>".FBLAN_07."</td>
<td style='width:50%; text-align: left;' class='forumheader3'>
<input class='tbox' type='text' name='fb_title' style='width: 80%' value='$fb_title' maxlength='200' />
<input class='tbox' type='text' name='fb_title' style='width: 80%' value='{$fb_title}' maxlength='200' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".FBLAN_08."</td>
<td style='width:50%; text-align: left;' class='forumheader3'>
<textarea class='tbox' name='fb_text' style='width: 90%' rows='6'>$fb_text</textarea>
<textarea class='tbox' name='fb_text' style='width: 90%' rows='6'>{$fb_text}</textarea>
</td>
</tr>
@ -193,7 +197,7 @@ $text .= "</select>
</tr>
</table>
".($action == "edit" ? "<input type='hidden' name='fb_id' value='$fb_id' />" : "")."
".($action == "edit" ? "<input type='hidden' name='fb_id' value='{$fb_id}' />" : "")."
</form>
</div>";

View File

@ -0,0 +1,10 @@
CREATE TABLE featurebox (
fb_id int(10) unsigned NOT NULL auto_increment,
fb_title varchar(200) NOT NULL default '',
fb_text text NOT NULL,
fb_mode tinyint(3) unsigned NOT NULL default '0',
fb_class tinyint(3) unsigned NOT NULL default '0',
fb_rendertype tinyint(1) unsigned NOT NULL default '0',
fb_template varchar(50) NOT NULL default '',
PRIMARY KEY (fb_id)
) TYPE=MyISAM;

View File

@ -10,13 +10,14 @@
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/languages/English.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:10 $
| $Author: mcfly_e107 $
| $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/languages/English_admin_featurebox.php,v $
| $Revision: 1.1 $
| $Date: 2008-12-10 22:41:39 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
define("FBLAN_01", "Feature Box");
define("FBLAN_02", "This plugin allows you to display a box above your news items with features / whatever you like in it. The messages can either be revolved randomly or dynamically faded.");
define("FBLAN_03", "Configure feature box");
@ -44,4 +45,10 @@ define("FBLAN_24", "Plain");
define("FBLAN_25", "Template");
define("FBLAN_26", "you can use a different template for each message, add templates to e107_plugins/featurebox/templates/ folder");
// Admin log messages
define('LAN_AL_FBLAN_01', 'Featurebox created');
define('LAN_AL_FBLAN_02', 'Featurebox updated');
define('LAN_AL_FBLAN_03', 'Featurebox deleted');
?>

View File

@ -1,77 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| ©Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/plugin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:10 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@include_once(e_PLUGIN."featurebox/languages/".e_LANGUAGE.".php");
@include_once(e_PLUGIN."featurebox/languages/English.php");
// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = FBLAN_01;
$eplug_version = "1.0";
$eplug_author = "Steve Dunstan (jalist)";
$eplug_url = "http://e107.org";
$eplug_email = "jalist@e107.org";
$eplug_description = FBLAN_02;
$eplug_compatible = "e107v0.7+";
$eplug_readme = "";
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "featurebox";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = "";
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_config.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/images/featurebox_32.png";
$eplug_icon_small = $eplug_folder."/images/featurebox_16.png";
$eplug_caption = FBLAN_03;
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array("fb_active" => 1);
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = array("featurebox");
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = array(
"CREATE TABLE ".MPREFIX."featurebox (
fb_id int(10) unsigned NOT NULL auto_increment,
fb_title varchar(200) NOT NULL default '',
fb_text text NOT NULL,
fb_mode tinyint(3) unsigned NOT NULL default '0',
fb_class tinyint(3) unsigned NOT NULL default '0',
fb_rendertype tinyint(1) unsigned NOT NULL default '0',
fb_template varchar(50) NOT NULL default '',
PRIMARY KEY (fb_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$eplug_link = FALSE;
$eplug_link_name = "";
$eplug_link_url = "";
// Text to display after plugin successfully installed ------------------------------------------------------------------
$eplug_done = FBLAN_04; // "To activate please go to your menus screen and select the pm_menu into one of your menu areas.";
?>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id: plugin.xml,v 1.1 2008-12-10 22:41:39 e107steved Exp $ -->
<e107Plugin name="FBLAN_01" version="1.0" compatibility="0.8" installRequired="true">
<author name="Steve Dunstan (jalist)" url="http://e107.org" email="jalist@e107.org" />
<description>FBLAN_02</description>
<logLanguageFile filename="languages/--LAN--_admin_featurebox.php" />
<compatibility>e107v0.7+</compatibility>
<folder>featurebox</folder>
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
<administration>
<configFile>admin_config.php</configFile>
<icon>images/featurebox_32.png</icon>
<iconSmall>images/featurebox_16.png</iconSmall>
<caption>Configure feature box</caption>
<installDone>FBLAN_04</installDone>
</administration>
<mainPrefs>
<pref name="fb_active" value="1" />
</mainPrefs>
</e107Plugin>