]> git.mxchange.org Git - mailer.git/commitdiff
Rewrote handling of 'menu adverts' to a filter. This allows e.g. ext-clickbanner...
authorRoland Häder <roland@mxchange.org>
Tue, 27 Nov 2012 23:48:03 +0000 (23:48 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Nov 2012 23:48:03 +0000 (23:48 +0000)
.gitattributes
inc/extensions/ext-menu.php
inc/extensions/ext-sql_patches.php
inc/filter/menu_filter.php [new file with mode: 0644]
inc/mysql-manager.php
theme/business/css/general.css
theme/default/css/general.css
theme/desert/css/general.css

index a02b84851c1ebab82e15d8048701482a1062245b..662e05498a191d121a00da795b21daeb1f93b64a 100644 (file)
@@ -234,6 +234,7 @@ inc/filter/coupon_filter.php svneol=native#text/plain
 inc/filter/earning_filter.php svneol=native#text/plain
 inc/filter/forced_filter.php svneol=native#text/plain
 inc/filter/mediadata_filter.php svneol=native#text/plain
+inc/filter/menu_filter.php svneol=native#text/plain
 inc/filter/online_filter.php svneol=native#text/plain
 inc/filter/order_filter.php svneol=native#text/plain
 inc/filter/other_filter.php svneol=native#text/plain
index df067466fa42a159106fe0deb7611a9ca9402dac..ef88dc00f0f16f2270de6312f9b041a08e35cbc8 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.0.4');
+setThisExtensionVersion('0.0.5');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0','0.0.1','0.0.2','0.0.3', '0.0.4'));
+setExtensionVersionHistory(array('0.0.0','0.0.1','0.0.2','0.0.3', '0.0.4', '0.0.5'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
@@ -57,6 +57,12 @@ switch (getExtensionMode()) {
                addAdminMenuSql('menu','memedit','Mitgliedsmen&uuml; editieren','Mitgliedsmen&uuml; editieren oder l&ouml;schen',4);
                addAdminMenuSql('menu','guest_add','G&auml;ste-Men&uuml; hinzuf&uuml;gen','F&uuml;gen Sie weitere Men&uuml;punkte dem G&auml;ste-Men&uuml; hinzu.',5);
                addAdminMenuSql('menu','guestedit','G&auml;ste-Men&uuml; editieren','G&auml;ste-Men&uuml; editieren, l&ouml;schen',6);
+
+               // Unregister filter
+               unregisterFilter(__FILE__, __LINE__, 'guest_menu_advert', 'ADD_GENERIC_MENU_ADVERT', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'member_menu_advert', 'ADD_GENERIC_MENU_ADVERT', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'guest_menu_advert_end', 'ADD_GENERIC_MENU_ADVERT_END', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'member_menu_advert_end', 'ADD_GENERIC_MENU_ADVERT_END', TRUE, isExtensionDryRun());
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -108,6 +114,16 @@ switch (getExtensionMode()) {
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("VARCHAR(50) ist zu kurz f&uuml;r Linktitel (wegen der dynamischen Anteile).");
                                break;
+
+                       case '0.0.5': // SQL queries for v0.0.5
+                               registerFilter(__FILE__, __LINE__, 'guest_menu_advert', 'ADD_GENERIC_MENU_ADVERT', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'member_menu_advert', 'ADD_GENERIC_MENU_ADVERT', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'guest_menu_advert_end', 'ADD_GENERIC_MENU_ADVERT_END', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'member_menu_advert_end', 'ADD_GENERIC_MENU_ADVERT_END', FALSE, TRUE, isExtensionDryRun());
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Filter hinzugef&uuml;gt, die Werbeeinblendungen hinzuf&uuml;gen. Auf diese Filter kann sp&auml;ter auch z.B. <strong>ext-clickbanner</strong> sich registrieren, damit die Werbung &quot;exklusiv&quot; angezeigt wird, muss das Flag <strong>exclusive</strong> auf <em>TRUE</em> gesetzt werden.");
+                               break;
                } // END - switch
                break;
 
index a4cb1d7e67c03e1f0f1de45063d5ebb1d3eaf37d..169365ac929abf27f541b822025e83dceeee97b6 100644 (file)
@@ -109,6 +109,7 @@ IN (
                unregisterFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'determine_menu_mode', 'DETERMINE_MENU_MODE_GENERIC', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
diff --git a/inc/filter/menu_filter.php b/inc/filter/menu_filter.php
new file mode 100644 (file)
index 0000000..efbccdf
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 11/28/2012 *
+ * ===================                          Last change: 11/28/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : menu_filter.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext-                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Filter fuer ext-                                 *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Filter for adding generic menu advert template (+ separator)
+function FILTER_ADD_GENERIC_MENU_ADVERT ($filterData) {
+       // Should we display adverts in this menu?
+       if (($filterData['exclusive'] === FALSE) && (getConfig($filterData['mode'] . '_menu_advert_enabled') == 'Y') && ($filterData['action'] != 'admin')) {
+               // Display advert template
+               $filterData['output'] .= loadTemplate('menu_' . $filterData['mode'] . '_advert_' . $filterData['action'], TRUE);
+
+               // Add separator again
+               $filterData['output'] .= loadTemplate('menu_separator', TRUE, $filterData['mode']);
+       } // END - if
+
+       // Return filter data
+       return $filterData;
+}
+
+// Filter to add generic advert to end of menu
+function FILTER_ADD_GENERIC_MENU_ADVERT_END ($filterData) {
+       // Should we display adverts in this menu?
+       if (($filterData['exclusive']) && (getConfig($filterData['mode'] . '_menu_advert_enabled') == 'Y') && ($filterData['action'] != 'admin')) {
+               // Add separator again
+               $filterData['content'] .= loadTemplate('menu_separator', TRUE, $filterData['mode']);
+
+               // Display advert template
+               $filterData['content'] .= loadTemplate('menu_' . $filterData['mode'] . '_advert_end', TRUE);
+       } // END - if
+
+       // Return filter data
+       return $filterData;
+}
+
+// [EOF]
+?>
index 679d415d40235a35dd061089cef05002e0006c7f..69b023ff4c58576c78812acc8180bf803588c20f 100644 (file)
@@ -354,28 +354,38 @@ ORDER BY
                                // Add separator
                                $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
 
-                               // Should we display adverts in this menu?
-                               if ((isExtensionInstalledAndNewer('menu', '0.0.1')) && (getConfig($mode . '_menu_advert_enabled') == 'Y') && ($action != 'admin')) {
-                                       // Display advert template
-                                       $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_' . $action, TRUE);
+                               // Prepare filter data array
+                               $filterData = array(
+                                       'output'    => '',
+                                       'exclusive' => FALSE,
+                                       'action'    => $action,
+                                       'mode'      => $mode,
+                               );
 
-                                       // Add separator again
-                                       $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
-                               } // END - if
+                               // Run filter chain
+                               $filterData = runFilterChain($mode . '_menu_advert', $filterData);
+
+                               // Add content output
+                               $GLOBALS['rows'] .= $filterData['output'];
                        } // END - if
                } // END - while
 
                // Free memory
                SQL_FREERESULT($result_main);
 
-               // Should we display adverts in this menu?
-               if ((isExtensionInstalledAndNewer('menu', '0.0.1')) && (getConfig($mode . '_menu_advert_enabled') == 'Y')) {
-                       // Add separator again
-                       $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
+               // Prepare filter data array
+               $filterData = array(
+                       'output'    => '',
+                       'exclusive' => FALSE,
+                       'action'    => $action,
+                       'mode'      => $mode,
+               );
+
+               // Run filter chain
+               $filterData = runFilterChain($mode . '_menu_advert_end', $filterData);
 
-                       // Display advert template
-                       $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_end', TRUE);
-               } // END - if
+               // Add content output
+               $GLOBALS['rows'] .= $filterData['output'];
 
                // Prepare data
                $content = array(
index 62c550a01ca861f8218e8e9fb684dc08fdfbdcec..3ea07060a26601d45a6a387c495e1a8cfe16c18c 100644 (file)
@@ -594,7 +594,7 @@ ul.show_timings_block {
        border: solid 1px #000000;
        background-color: #eeeeff;
        font-size: 10px;
-       width: 645px;
+       width: 685px;
        height: 20px;
        list-style: none inside;
 }
@@ -602,7 +602,7 @@ ul.show_timings_block {
 .show_timings_column {
        background-color: #ffffff;
        margin-top: 2px;
-       width: 150px;
+       width: 160px;
        height: 14px;
 }
 
index 301efebc3f3e2a797b1f1d42537c4596d900f09e..f2e0ec517ab0962bb13050023eee49692917949e 100644 (file)
@@ -603,7 +603,7 @@ ul.copyright_box {
 ul.show_timings_block {
        border: solid 1px #00aa44;
        background-color: #ddeedd;
-       width: 645px;
+       width: 685px;
        height: 20px;
        list-style: none inside;
        padding-left:0px;
@@ -612,7 +612,7 @@ ul.show_timings_block {
 .show_timings_column {
        background-color: #eeffee;
        margin-top: 2px;
-       width: 150px;
+       width: 160px;
        height: 14px;
        font-size: 10px;
 }
index 8c4b02dd961a1e1b2a6349c75922761806d99a53..4f1c2ba563792ddcfba4116abfa0573925085319 100644 (file)
@@ -559,7 +559,7 @@ ul.show_timings_block {
        border: solid 1px #880000;
        background-color: #cccc99;
        font-size: 10px;
-       width: 645px;
+       width: 685px;
        height: 20px;
        list-style: none inside;
 }
@@ -567,7 +567,7 @@ ul.show_timings_block {
 .show_timings_column {
        background-color: #ffffcc;
        margin-top: 2px;
-       width: 150px;
+       width: 160px;
        height: 14px;
 }