diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 7ea38106a..352462008 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/comment_class.php,v $ - | $Revision: 1.33 $ - | $Date: 2009-11-18 01:04:43 $ - | $Author: e107coders $ + | $Revision: 1.34 $ + | $Date: 2009-12-28 21:36:13 $ + | $Author: e107steved $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) @@ -827,7 +827,7 @@ class comment function getCommentData($amount = '', $from = '', $qry = '', $cdvalid = FALSE, $cdreta = FALSE) { - global $pref,$menu_pref,$sql,$sql2,$tp; + global $pref,$sql,$sql2,$tp; $from1 = ($from ? $from : '0'); $amount1 = ($amount ? $amount : '10'); $valid = ($cdvalid ? $cdvalid : '0'); diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index 324a1423f..347843c66 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -9,18 +9,18 @@ * e107 Main * * $Source: /cvs_backup/e107_0.8/e107_handlers/online_class.php,v $ - * $Revision: 1.9 $ - * $Date: 2009-12-28 17:53:10 $ + * $Revision: 1.10 $ + * $Date: 2009-12-28 21:36:13 $ * $Author: e107steved $ */ /** - * * @package e107 * @subpackage e107_handlers - * @version $Id: online_class.php,v 1.9 2009-12-28 17:53:10 e107steved Exp $; + * @version $Id: online_class.php,v 1.10 2009-12-28 21:36:13 e107steved Exp $; * + * Handler to keep track of online users */ /* diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index 075a628d8..1890d06db 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -9,49 +9,64 @@ * Banner Administration * * $Source: /cvs_backup/e107_0.8/e107_plugins/banner/admin_banner.php,v $ - * $Revision: 1.4 $ - * $Date: 2009-11-18 01:05:22 $ - * $Author: e107coders $ + * $Revision: 1.5 $ + * $Date: 2009-12-28 21:36:13 $ + * $Author: e107steved $ * */ -require_once("../../class2.php"); -if (!getperms("D")) +/** + * e107 Banner management plugin + * + * Handles the display and sequencing of banners on web pages, including counting impressions + * + * @package e107_plugins + * @subpackage banner + * @version $Id: admin_banner.php,v 1.5 2009-12-28 21:36:13 e107steved Exp $; + * + * @todo language file issues to resolve + */ + +require_once('../../class2.php'); +if (!getperms('D')) { - header("location:".e_BASE."index.php"); + header('location:'.e_BASE.'index.php'); exit; } $e_sub_cat = 'banner'; -require_once(e_ADMIN."auth.php"); -require_once(e_HANDLER."form_handler.php"); +require_once(e_ADMIN.'auth.php'); +require_once(e_HANDLER.'form_handler.php'); $frm = new e_form(); -require_once(e_HANDLER."userclass_class.php"); -require_once(e_HANDLER."file_class.php"); +require_once(e_HANDLER.'userclass_class.php'); +require_once(e_HANDLER.'file_class.php'); $fl = new e_file; -require_once(e_HANDLER."message_handler.php"); +require_once(e_HANDLER.'message_handler.php'); $emessage = eMessage::getInstance(); //@FIXME mix up in banner language files -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"); -include_lan(e_PLUGIN."banner/languages/".e_LANGUAGE.".php"); +//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_menus.php'); +include_lan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'.php'); +include_lan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'_menu_banner.php'); if(e_QUERY) { - list($action, $sub_action, $id) = explode(".", e_QUERY); + list($action, $sub_action, $id) = explode('.', e_QUERY); } -$images = $fl->get_files(e_IMAGE."banners/","","standard"); +$images = $fl->get_files(e_IMAGE.'banners/','','standard'); + +$menu_pref = e107::getConfig('menu')->getPref(''); if (isset($_POST['update_menu'])) { - $menu_pref['banner_caption'] = $e107->tp->toDB($_POST['banner_caption']); - $menu_pref['banner_amount'] = intval($_POST['banner_amount']); - $menu_pref['banner_rendertype'] = intval($_POST['banner_rendertype']); + $temp['banner_caption'] = $e107->tp->toDB($_POST['banner_caption']); + $temp['banner_amount'] = intval($_POST['banner_amount']); + $temp['banner_rendertype'] = intval($_POST['banner_rendertype']); if (isset($_POST['multiaction_cat_active'])) { @@ -63,12 +78,22 @@ if (isset($_POST['update_menu'])) } $cat = substr($cat, 0, -1);*/ $cat = implode('|', $e107->tp->toDB($_POST['multiaction_cat_active'])); - $menu_pref['banner_campaign'] = $cat; + $temp['banner_campaign'] = $cat; } + if ($admin_log->logArrayDiffs($temp,$menu_pref,'BANNER_01')) + { + $menuPref = e107::getConfig('menu'); + //e107::getConfig('menu')->setPref('', $menu_pref); + //e107::getConfig('menu')->save(false, true, false); + foreach ($temp as $k => $v) + { + $menuPref->setPref($k, $v); + } + $menuPref->save(false, true, false); - $sysprefs->setArray('menu_pref'); - banners_adminlog('01', $menu_pref['banner_caption'].'[!br!]'.$menu_pref['banner_amount'].', '.$menu_pref['banner_rendertype'].'[!br!]'.$menu_pref['banner_campaign']); - $emessage->add(BANNER_MENU_L2, E_MESSAGE_SUCCESS); + //banners_adminlog('01', $menu_pref['banner_caption'].'[!br!]'.$menu_pref['banner_amount'].', '.$menu_pref['banner_rendertype'].'[!br!]'.$menu_pref['banner_campaign']); + $emessage->add(BANNER_MENU_L2, E_MESSAGE_SUCCESS); + } } diff --git a/e107_plugins/banner/banner.php b/e107_plugins/banner/banner.php index d31074b9e..931e7a9d2 100644 --- a/e107_plugins/banner/banner.php +++ b/e107_plugins/banner/banner.php @@ -9,9 +9,19 @@ * * * $Source: /cvs_backup/e107_0.8/e107_plugins/banner/banner.php,v $ - * $Revision: 1.3 $ - * $Date: 2009-11-19 13:46:29 $ - * $Author: e107coders $ + * $Revision: 1.4 $ + * $Date: 2009-12-28 21:36:13 $ + * $Author: e107steved $ + */ + +/** + * e107 Banner management plugin + * + * Handles the display and sequencing of banners on web pages, including counting impressions + * + * @package e107_plugins + * @subpackage banner + * @version $Id: banner.php,v 1.4 2009-12-28 21:36:13 e107steved Exp $; */ if (!defined('e107_INIT')) diff --git a/e107_plugins/banner/banner_menu.php b/e107_plugins/banner/banner_menu.php index 60e410d04..77485d087 100644 --- a/e107_plugins/banner/banner_menu.php +++ b/e107_plugins/banner/banner_menu.php @@ -9,9 +9,19 @@ * * * $Source: /cvs_backup/e107_0.8/e107_plugins/banner/banner_menu.php,v $ - * $Revision: 1.5 $ - * $Date: 2009-11-19 22:02:19 $ - * $Author: marj_nl_fr $ + * $Revision: 1.6 $ + * $Date: 2009-12-28 21:36:13 $ + * $Author: e107steved $ + */ + +/** + * e107 Banner management plugin + * + * Handles the display and sequencing of banners on web pages, including counting impressions + * + * @package e107_plugins + * @subpackage banner + * @version $Id: banner_menu.php,v 1.6 2009-12-28 21:36:13 e107steved Exp $; */ if (!defined('e107_INIT')) { exit; } @@ -27,21 +37,22 @@ To define your own banner to use here ... 3. Save file */ -include_lan(e_PLUGIN."banner/languages/".e_LANGUAGE."_menu_banner.php"); +include_lan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'_menu_banner.php'); -if(file_exists(THEME."banner_template.php")) +if(file_exists(THEME.'banner_template.php')) { - require_once (THEME."banner_template.php"); + require_once (THEME.'banner_template.php'); } else { - require_once (e_THEME."templates/banner_template.php"); + require_once (e_THEME.'templates/banner_template.php'); } +$menu_pref = e107::getConfig('menu')->getPref(''); if(isset($campaign)) { $parm = $campaign; - $bannersccode = file_get_contents(e_FILE."shortcode/banner.sc"); + $bannersccode = file_get_contents(e_FILE.'shortcode/banner.sc'); $BANNER = eval($bannersccode); $txt = $BANNER_MENU_START; $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); @@ -54,7 +65,7 @@ else { if(strstr($menu_pref['banner_campaign'], "|")) { - $campaignlist = explode("|", $menu_pref['banner_campaign']); + $campaignlist = explode('|', $menu_pref['banner_campaign']); $amount = ($menu_pref['banner_amount'] < 1 ? '1' : $menu_pref['banner_amount']); $amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount); $keys = array_rand($campaignlist, $amount); @@ -73,7 +84,7 @@ else $txt = $BANNER_MENU_START; foreach ($parms as $parm) { - $bannersccode = file_get_contents(e_FILE."shortcode/banner.sc"); + $bannersccode = file_get_contents(e_FILE.'shortcode/banner.sc'); $BANNER = eval($bannersccode); $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); } diff --git a/e107_plugins/banner/config.php b/e107_plugins/banner/config.php index 656f06a07..58021ed9e 100644 --- a/e107_plugins/banner/config.php +++ b/e107_plugins/banner/config.php @@ -9,11 +9,24 @@ * Banner Menu Configuration (OLD - redirects to e107_admin/banner.php) * * $Source: /cvs_backup/e107_0.8/e107_plugins/banner/config.php,v $ - * $Revision: 1.3 $ - * $Date: 2009-11-18 01:05:23 $ - * $Author: e107coders $ + * $Revision: 1.4 $ + * $Date: 2009-12-28 21:36:13 $ + * $Author: e107steved $ * */ + +/** + * e107 Banner management plugin + * + * Handles the display and sequencing of banners on web pages, including counting impressions + * + * @package e107_plugins + * @subpackage banner + * @version $Id: config.php,v 1.4 2009-12-28 21:36:13 e107steved Exp $; + * + * @todo - try and access file for menu config without a redirect + */ + $eplug_admin = TRUE; require_once("../../class2.php"); @@ -21,7 +34,7 @@ require_once("../../class2.php"); * The same, cleaned up code is already part of banner.php * FIXME - we should be able to combine all core menus in a nice way... somehow */ -header('Location:'.e_ADMIN_ABS.'banner.php?menu'); +header('Location:'.e_PLUGIN_ABS.'banner/admin_banner.php?menu'); exit; if (!getperms("1")) // Access to those who can change prefs, theme etc diff --git a/e107_plugins/banner/e_shortcode.php b/e107_plugins/banner/e_shortcode.php index 2deaaf24e..24237565f 100644 --- a/e107_plugins/banner/e_shortcode.php +++ b/e107_plugins/banner/e_shortcode.php @@ -1,11 +1,21 @@ getPref(''); -global $menu_pref; $indexArray = array('clock_dateprefix','clock_format','clock_datesuffix1','clock_datesuffix2','clock_datesuffix3','clock_datesuffix4'); foreach($indexArray as $ind) { @@ -36,7 +47,7 @@ foreach($indexArray as $ind) } } -$ec_dir = e_PLUGIN."clock_menu/"; +$ec_dir = e_PLUGIN.'clock_menu/'; $text = "\n\n\n