1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

list_new plugin - admin logging, plugin.xml, odd checks

This commit is contained in:
e107steved
2008-12-11 22:38:06 +00:00
parent 6ee09faaef
commit 627aea856f
8 changed files with 230 additions and 238 deletions

View File

@@ -11,15 +11,19 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/admin_list_config.php,v $
| $Revision: 1.4 $
| $Date: 2008-11-20 20:35:24 $
| $Revision: 1.5 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
//include and require several classes
require_once("../../class2.php");
if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
if(!getperms("1") || !plugInstalled('list_new'))
{
header("location:".e_BASE."index.php");
exit ;
}
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
@@ -30,34 +34,42 @@ require_once($listplugindir."list_class.php");
$rc = new listclass;
//get language file
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
@include_lan($listplugindir."languages/".e_LANGUAGE.".php");
//get all sections to use (and reload if new e_list.php files are added)
$rc -> getSections();
//update preferences in database
if(isset($_POST['update_menu'])){
while(list($key, $value) = each($_POST)){
if($value != LIST_ADMIN_2){ $list_pref[$tp->toDB($key)] = $tp->toDB($value); }
if(isset($_POST['update_menu']))
{
$list_pref = $rc -> getListPrefs(); // Get the preferences so we've got a reference for changes
$temp = array();
while(list($key, $value) = each($_POST))
{
if($value != LIST_ADMIN_2){ $temp[$tp->toDB($key)] = $tp->toDB($value); }
}
$tmp = $eArrayStorage->WriteArray($list_pref);
$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='list' ");
$message = LIST_ADMIN_3;
if ($admin_log->logArrayDiffs($temp, $list_pref, 'LISTNEW_01'))
{
$tmp = $eArrayStorage->WriteArray($list_pref);
$sql -> db_Update("core", "e107_value='{$tmp}' WHERE e107_name='list' ");
$message = LIST_ADMIN_3;
}
else
{
$message = LIST_ADMIN_LAN_41;
}
}
//check preferences from database
$list_pref = $rc -> getListPrefs();
//$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
//$iconlist = $fl->get_files($listplugindir."images/", "", $rejectlist);
$iconlist = $fl->get_files($listplugindir."images/");
//render message if set
if(isset($message)){
if(isset($message))
{
$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}

View File

@@ -11,138 +11,13 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $
| $Revision: 1.4 $
| $Date: 2008-12-08 07:57:21 $
| $Author: lisa_ $
| $Revision: 1.5 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
define("LIST_PLUGIN_1", "List");
define("LIST_PLUGIN_2", "This plugin allows you to view a list of recent additions in all e107 categories. You can either view the list with data since your last visit, or view a general latest additions list. Besides the page a menu is also present. Every section is configurable in the admin area.");
define("LIST_PLUGIN_3", "Configure Main Menu");
define("LIST_PLUGIN_4", "The List_new plugin is now ready to be used.");
define("LIST_PLUGIN_5", "list");
define("LIST_PLUGIN_6", "This plugin is not installed.");
define("LIST_ADMIN_1", "recent");
define("LIST_ADMIN_2", "update settings");
define("LIST_ADMIN_3", "settings updated");
define("LIST_ADMIN_4", "section");
define("LIST_ADMIN_5", "menu");
define("LIST_ADMIN_6", "page");
define("LIST_ADMIN_7", "enabled");
define("LIST_ADMIN_8", "disabled");
define("LIST_ADMIN_9", "open");
define("LIST_ADMIN_10", "closed");
define("LIST_ADMIN_11", "update");
define("LIST_ADMIN_12", "choose");
define("LIST_ADMIN_13", "Welcome to the Recent page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the most recent additions in these sections.");
define("LIST_ADMIN_14", "recent additions");
define("LIST_ADMIN_15", "new since your last visit");
define("LIST_ADMIN_16", "Welcome to the New page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the additions in these sections since your last visit.");
define("LIST_ADMIN_SECT_1", "sections");
define("LIST_ADMIN_SECT_2", "choose which sections to show");
define("LIST_ADMIN_SECT_3", "");
define("LIST_ADMIN_SECT_4", "display style");
define("LIST_ADMIN_SECT_5", "choose which sections are opened by default");
define("LIST_ADMIN_SECT_6", "");
define("LIST_ADMIN_SECT_7", "author");
define("LIST_ADMIN_SECT_8", "choose if the author should be displayed");
define("LIST_ADMIN_SECT_9", "");
define("LIST_ADMIN_SECT_10", "category");
define("LIST_ADMIN_SECT_11", "choose if the category should be displayed");
define("LIST_ADMIN_SECT_12", "");
define("LIST_ADMIN_SECT_13", "date");
define("LIST_ADMIN_SECT_14", "choose if the date should be displayed");
define("LIST_ADMIN_SECT_15", "");
define("LIST_ADMIN_SECT_16", "amount items");
define("LIST_ADMIN_SECT_17", "choose how many items should be displayed for each section");
define("LIST_ADMIN_SECT_18", "");
define("LIST_ADMIN_SECT_19", "order items");
define("LIST_ADMIN_SECT_20", "choose the order in which sections should be displayed");
define("LIST_ADMIN_SECT_21", "");
define("LIST_ADMIN_SECT_22", "icon");
define("LIST_ADMIN_SECT_23", "choose an icon for each section");
define("LIST_ADMIN_SECT_24", "");
define("LIST_ADMIN_SECT_25", "caption");
define("LIST_ADMIN_SECT_26", "define a caption for each section");
define("LIST_ADMIN_SECT_27", "");
define("LIST_ADMIN_OPT_1", "general");
define("LIST_ADMIN_OPT_2", "recent page");
define("LIST_ADMIN_OPT_3", "recent menu");
define("LIST_ADMIN_OPT_4", "new page");
define("LIST_ADMIN_OPT_5", "new menu");
define("LIST_ADMIN_OPT_6", "options");
define("LIST_ADMIN_MENU_2", "icon : default");
define("LIST_ADMIN_MENU_3", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_MENU_4", "");
define("LIST_ADMIN_LAN_2", "caption");
define("LIST_ADMIN_LAN_3", "define a caption");
define("LIST_ADMIN_LAN_4", "");
define("LIST_ADMIN_LAN_5", "icon : use");
define("LIST_ADMIN_LAN_6", "use icon from each section");
define("LIST_ADMIN_LAN_7", "");
define("LIST_ADMIN_LAN_8", "characters");
define("LIST_ADMIN_LAN_9", "choose how many characters of the heading will be shown");
define("LIST_ADMIN_LAN_10", "leave blank to show full heading");
define("LIST_ADMIN_LAN_11", "postfix");
define("LIST_ADMIN_LAN_12", "choose a postfix if the heading is larger then the given amount of characters");
define("LIST_ADMIN_LAN_13", "leave blank to show no postfix");
define("LIST_ADMIN_LAN_14", "date");
define("LIST_ADMIN_LAN_15", "choose a date style");
define("LIST_ADMIN_LAN_16", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_17", "today date");
define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
define("LIST_ADMIN_LAN_19", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_20", "columns");
define("LIST_ADMIN_LAN_21", "choose an amount of columns");
define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will separate the page into an equal amount of columns");
define("LIST_ADMIN_LAN_23", "welcome text");
define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
define("LIST_ADMIN_LAN_25", "");
define("LIST_ADMIN_LAN_26", "show empty");
define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
define("LIST_ADMIN_LAN_28", "");
define("LIST_ADMIN_LAN_29", "icon : default");
define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_LAN_31", "");
define("LIST_ADMIN_LAN_32", "timelapse:days");
define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
define("LIST_ADMIN_LAN_34", "");
define("LIST_ADMIN_LAN_35", "days");
define("LIST_ADMIN_LAN_36", "timelapse");
define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
define("LIST_ADMIN_LAN_38", "");
define("LIST_ADMIN_LAN_39", "open if records exist");
define("LIST_ADMIN_LAN_40", "should sections that contain records be opened by default?");
define("LIST_ADMIN_LAN_41", "");
define("LIST_MENU_1", "recent additions");
define("LIST_MENU_2", "by");
define("LIST_MENU_3", "on");

View File

@@ -0,0 +1,152 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>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/list_new/languages/English_admin_list_new.php,v $
| $Revision: 1.1 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
define("LIST_PLUGIN_1", "List");
define("LIST_PLUGIN_2", "This plugin allows you to view a list of recent additions in all e107 categories. You can either view the list with data since your last visit, or view a general latest additions list. Besides the page a menu is also present. Every section is configurable in the admin area.");
define("LIST_PLUGIN_3", "Configure Main Menu");
define("LIST_PLUGIN_4", "The List_new plugin is now ready to be used.");
define("LIST_PLUGIN_5", "list");
define("LIST_PLUGIN_6", "This plugin is not installed.");
define("LIST_ADMIN_1", "recent");
define("LIST_ADMIN_2", "update settings");
define("LIST_ADMIN_3", "settings updated");
define("LIST_ADMIN_4", "section");
define("LIST_ADMIN_5", "menu");
define("LIST_ADMIN_6", "page");
define("LIST_ADMIN_7", "enabled");
define("LIST_ADMIN_8", "disabled");
define("LIST_ADMIN_9", "open");
define("LIST_ADMIN_10", "closed");
define("LIST_ADMIN_11", "update");
define("LIST_ADMIN_12", "choose");
define("LIST_ADMIN_13", "Welcome to the Recent page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the most recent additions in these sections.");
define("LIST_ADMIN_14", "recent additions");
define("LIST_ADMIN_15", "new since your last visit");
define("LIST_ADMIN_16", "Welcome to the New page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the additions in these sections since your last visit.");
define("LIST_ADMIN_SECT_1", "sections");
define("LIST_ADMIN_SECT_2", "choose which sections to show");
define("LIST_ADMIN_SECT_3", "");
define("LIST_ADMIN_SECT_4", "display style");
define("LIST_ADMIN_SECT_5", "choose which sections are opened by default");
define("LIST_ADMIN_SECT_6", "");
define("LIST_ADMIN_SECT_7", "author");
define("LIST_ADMIN_SECT_8", "choose if the author should be displayed");
define("LIST_ADMIN_SECT_9", "");
define("LIST_ADMIN_SECT_10", "category");
define("LIST_ADMIN_SECT_11", "choose if the category should be displayed");
define("LIST_ADMIN_SECT_12", "");
define("LIST_ADMIN_SECT_13", "date");
define("LIST_ADMIN_SECT_14", "choose if the date should be displayed");
define("LIST_ADMIN_SECT_15", "");
define("LIST_ADMIN_SECT_16", "amount items");
define("LIST_ADMIN_SECT_17", "choose how many items should be displayed for each section");
define("LIST_ADMIN_SECT_18", "");
define("LIST_ADMIN_SECT_19", "order items");
define("LIST_ADMIN_SECT_20", "choose the order in which sections should be displayed");
define("LIST_ADMIN_SECT_21", "");
define("LIST_ADMIN_SECT_22", "icon");
define("LIST_ADMIN_SECT_23", "choose an icon for each section");
define("LIST_ADMIN_SECT_24", "");
define("LIST_ADMIN_SECT_25", "caption");
define("LIST_ADMIN_SECT_26", "define a caption for each section");
define("LIST_ADMIN_SECT_27", "");
define("LIST_ADMIN_OPT_1", "general");
define("LIST_ADMIN_OPT_2", "recent page");
define("LIST_ADMIN_OPT_3", "recent menu");
define("LIST_ADMIN_OPT_4", "new page");
define("LIST_ADMIN_OPT_5", "new menu");
define("LIST_ADMIN_OPT_6", "options");
define("LIST_ADMIN_MENU_2", "icon : default");
define("LIST_ADMIN_MENU_3", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_MENU_4", "");
define("LIST_ADMIN_LAN_2", "caption");
define("LIST_ADMIN_LAN_3", "define a caption");
define("LIST_ADMIN_LAN_4", "");
define("LIST_ADMIN_LAN_5", "icon : use");
define("LIST_ADMIN_LAN_6", "use icon from each section");
define("LIST_ADMIN_LAN_7", "");
define("LIST_ADMIN_LAN_8", "characters");
define("LIST_ADMIN_LAN_9", "choose how many characters of the heading will be shown");
define("LIST_ADMIN_LAN_10", "leave blank to show full heading");
define("LIST_ADMIN_LAN_11", "postfix");
define("LIST_ADMIN_LAN_12", "choose a postfix if the heading is larger then the given amount of characters");
define("LIST_ADMIN_LAN_13", "leave blank to show no postfix");
define("LIST_ADMIN_LAN_14", "date");
define("LIST_ADMIN_LAN_15", "choose a date style");
define("LIST_ADMIN_LAN_16", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_17", "today date");
define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
define("LIST_ADMIN_LAN_19", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_20", "columns");
define("LIST_ADMIN_LAN_21", "choose an amount of columns");
define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will separate the page into an equal amount of columns");
define("LIST_ADMIN_LAN_23", "welcome text");
define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
define("LIST_ADMIN_LAN_25", "");
define("LIST_ADMIN_LAN_26", "show empty");
define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
define("LIST_ADMIN_LAN_28", "");
define("LIST_ADMIN_LAN_29", "icon : default");
define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_LAN_31", "");
define("LIST_ADMIN_LAN_32", "timelapse:days");
define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
define("LIST_ADMIN_LAN_34", "");
define("LIST_ADMIN_LAN_35", "days");
define("LIST_ADMIN_LAN_36", "timelapse");
define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
define("LIST_ADMIN_LAN_38", "");
define("LIST_ADMIN_LAN_39", "open if records exist");
define("LIST_ADMIN_LAN_40", "should sections that contain records be opened by default?");
define("LIST_ADMIN_LAN_41", 'Nothing changed - not updated');
// Admin log messages
//-------------------
define('LAN_AL_LISTNEW_01', 'List New preferences updated');
define('LAN_AL_LISTNEW_02', '');
?>

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
require_once("../../class2.php");
@@ -22,10 +22,9 @@ $listplugindir = e_PLUGIN."list_new/";
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
require_once(HEADERF);
$ns -> tablerender("", LIST_PLUGIN_6);
require_once(FOOTERF);
if (!plugInstalled('list_new'))
{
header("Location: ".e_BASE."index.php");
exit;
}
require_once($listplugindir."list_shortcodes.php");
@@ -43,15 +42,20 @@ require_once(HEADERF);
global $tp;
// check query
if(e_QUERY){
if(e_QUERY)
{
$qs = explode(".", e_QUERY);
if($qs[0] == "new"){
if($qs[0] == "new")
{
$mode = $qs[0];
}
}
if(isset($mode) && $mode == "new"){
if(isset($mode) && $mode == "new")
{
$mode = "new_page";
}else{
}
else
{
$mode = "recent_page"; //default to 'page'
}

View File

@@ -11,15 +11,16 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_new_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
if (!plugInstalled('list_new'))
{
return;
}

View File

@@ -11,16 +11,18 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_recent_menu.php,v $
| $Revision: 1.2 $
| $Date: 2007-08-08 19:34:34 $
| $Revision: 1.3 $
| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if (!isset($pref['plug_installed']['list_new'])) return;
if (!plugInstalled('list_new'))
{
return;
}
global $sysprefs, $tp, $eArrayStorage;

View File

@@ -1,76 +0,0 @@
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| code adapted from original by Lolo Irie (lolo_irie@e107coders.org)
|
| <20>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).
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $PLUGINS_DIRECTORY;
$lan_file = e_PLUGIN."list_new/languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."list_new/languages/English.php");
// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = LIST_PLUGIN_1;
$eplug_version = "1.0";
$eplug_author = "Eric Vanderfeesten (lisa)";
$eplug_logo = "";
$eplug_url = "http://eindhovenseschool.net";
$eplug_email = "lisa@eindhovenseschool.net";
$eplug_description = LIST_PLUGIN_2;
$eplug_compatible = "e107v0.7+";
$eplug_readme = ""; // leave blank if no readme file
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "list_new";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = array("list_new_menu.php", "list_recent_menu.php");
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_list_config.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/icon/list_32.png";
$eplug_icon_small = $eplug_folder."/icon/list_16.png";
$eplug_caption = LIST_PLUGIN_3;
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array();
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = "";
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = "";
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$eplug_link = TRUE;
$eplug_link_name = LIST_PLUGIN_5;
$eplug_link_url = e_PLUGIN."list_new/list.php";
// Text to display after plugin successfully installed ------------------------------------------------------------------
$eplug_done = LIST_PLUGIN_4;
// upgrading ... //
$upgrade_add_prefs = "";
$upgrade_remove_prefs = "";
$upgrade_alter_tables = "";
$eplug_upgrade_done = "";
?>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id: plugin.xml,v 1.1 2008-12-11 22:38:06 e107steved Exp $ -->
<e107Plugin name="LIST_PLUGIN_1" version="1.0" compatibility="0.8" installRequired="true">
<author name="Eric Vanderfeesten (lisa)" url="http://eindhovenseschool.net" email="lisa@eindhovenseschool.net" />
<description>LIST_PLUGIN_2</description>
<compatibility>e107v0.7+</compatibility>
<folder>list_new</folder>
<logLanguageFile filename="languages/--LAN--_admin_list_new.php" />
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
<administration>
<configFile>admin_list_config.php</configFile>
<icon>icon/list_32.png</icon>
<iconSmall>icon/list_16.png</iconSmall>
<caption>LIST_PLUGIN_3</caption>
<installDone>LIST_PLUGIN_4</installDone>
</administration>
<menuLink name="LIST_PLUGIN_5" url="list_new/list.php" />
<mainPrefs>
</mainPrefs>
</e107Plugin>