NAVIGATION
This shows you the differences between two versions of the page.
|
english:phpwcms_replacer_rts:frontend_render:article-menu-archive:article-menu-archive-count [2009/08/16 00:49] Knut Heermann (flip-flop) |
english:phpwcms_replacer_rts:frontend_render:article-menu-archive:article-menu-archive-count [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{indexmenu_n>700}} | + | {{indexmenu_n>10}} |
| - | ====== Article menu (+archive) ====== | + | ====== Article menu (+counter +archive) ====== |
| + | (Simple version) | ||
| - | **RT like the CP Article menu, enhanced to show archived articles too.** | + | **RT like the CP Article menu, enhanced to show archived articles too and two counter: 1) Article hidden, 2) number of articles which can be displayed.** |
| - | **rt_article_menu_archive** V1.0 23.03.09 | + | <del>**rt_article_menu_archive** V1.0 23.03.09</del> \\ |
| + | **rt_article_menu_archive** V1.1 05.09.09 | ||
| - | **Update: 16.08.09 KH:** + counter for "How many leading articles must be hide" | + | **Update: 16.08.09 KH:** + counter for "How many of the first articles are to be hidden" //(0 = nothing hidden)// \\ |
| + | **Update: 05.09.09 KH:** + counter for "How many articles are to be shown" //(0 = all)// \\ | ||
| + | **Update: 10.12.09 KH:** + BBCode in titel and subtitel possible | ||
| **Syntax:** {ARTICLE_MENU_ARCHIVE:category-ID, count-hide} //(Both parameters must be set)// \\ | **Syntax:** {ARTICLE_MENU_ARCHIVE:category-ID, count-hide} //(Both parameters must be set)// \\ | ||
| + | **Syntax:** {ARTICLE_MENU_ARCHIVE:category-ID, count-hide, count-article} //(All three parameters must be set)// | ||
| - | E.g.:{ARTICLE_MENU_ARCHIVE:-1,0} //Actual category, no leading articles must be hide// \\ | + | E.g.:{ARTICLE_MENU_ARCHIVE:-1,0,0} //Actual category, none of the first articles is hidden , dipslay all articles// \\ |
| - | E.g.:{ARTICLE_MENU_ARCHIVE:23,2} //Article in category 23(ID), the first two articles must be hide// \\ | + | E.g.:{ARTICLE_MENU_ARCHIVE:23,2,5} //Article in category 23(ID), the first two articles are hidden, displays the the first five articles if avaialbel// \\ |
| Line 22: | Line 27: | ||
| **Autor:** K.Heermann (flip-flop) http://planmatrix.de \\ | **Autor:** K.Heermann (flip-flop) http://planmatrix.de \\ | ||
| **CMS version:** >= 1.4 \\ | **CMS version:** >= 1.4 \\ | ||
| - | **Version:** V1.0 \\ | + | **Version:** V1.1 \\ |
| Based on the cp article menu. | Based on the cp article menu. | ||
| - | Tag: **{ARTICLE_MENU_ARCHIVE:category-ID, count-hide}** or **{ARTICLE_MENU_ARCHIVE:-1, count-hide}** for the actual category | + | Tag: **{ARTICLE_MENU_ARCHIVE:category-ID, count-hide, count-article}** or **{ARTICLE_MENU_ARCHIVE:-1, count-hide, count-article}** for the actual category |
| Filename: **rt_article_menu_archive.php** | Filename: **rt_article_menu_archive.php** | ||
| - | Location: ** template/inc_script/frontend_init/ ** | + | Location: ** template/inc_script/frontend_render/ ** |
| **Condition:** -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\ | **Condition:** -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\ | ||
| Line 45: | Line 50: | ||
| /************************************************************************************* | /************************************************************************************* | ||
| Copyright notice | Copyright notice | ||
| - | + | ||
| (c) 2002-2008 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. | (c) 2002-2008 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. | ||
| Line 52: | Line 57: | ||
| the GNU General Public License as published by the Free Software Foundation; | 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. | either version 2 of the License, or (at your option) any later version. | ||
| - | + | ||
| The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html | The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html | ||
| - | A copy is found in the textfile GPL.txt and important notices to the license | + | A copy is found in the textfile GPL.txt and important notices to the license |
| from the author is found in LICENSE.txt distributed with these scripts. | from the author is found in LICENSE.txt distributed with these scripts. | ||
| - | + | ||
| - | This script is distributed in the hope that it will be useful, but WITHOUT ANY | + | This script 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 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
| PARTICULAR PURPOSE. See the GNU General Public License for more details. | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
| This copyright notice MUST APPEAR in all copies of the script! | This copyright notice MUST APPEAR in all copies of the script! | ||
| - | + | ||
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ||
| 15.03.09 KH (flip-flop) CP article menu cut out (frontend snippet) | 15.03.09 KH (flip-flop) CP article menu cut out (frontend snippet) | ||
| Enhanced for showing archived articles | Enhanced for showing archived articles | ||
| {ARTICLE_MENU_ARCHIVE:category-ID} | {ARTICLE_MENU_ARCHIVE:category-ID} | ||
| - | ...If you use the automatic for category-ID, please set category-ID = -1 (actual category is fetched) | + | If you use the automatic for category-ID, please set category-ID = -1 (the current category is selected) |
| E.g.:{ARTICLE_MENU_ARCHIVE:-1} | E.g.:{ARTICLE_MENU_ARCHIVE:-1} | ||
| - | + | ||
| - | 16.08.09 KH Update + counter for How many leading articles must be hide | + | 16.08.09 KH Update: + counter for "How many of the first articles are to be hidden" |
| {ARTICLE_MENU_ARCHIVE:category-ID, count-hide} | {ARTICLE_MENU_ARCHIVE:category-ID, count-hide} | ||
| E.g.:{ARTICLE_MENU_ARCHIVE:-1,0} (Both parameters must be set) | E.g.:{ARTICLE_MENU_ARCHIVE:-1,0} (Both parameters must be set) | ||
| - | *************************************************************************************/ | + | |
| + | 05.09.09 KH Update: + count_article for "How many of articles are to be shown" (if available) | ||
| + | {ARTICLE_MENU_ARCHIVE:category-ID, count-hide, count-articles} | ||
| + | E.g.:{ARTICLE_MENU_ARCHIVE:-1,0,4} (All three parameters must be set) | ||
| + | Automatic category-ID, no article hidden, show the first for articles | ||
| + | 10.12.09 KH Update: + BBCode in titel and subtitel possible | ||
| + | E.g.: [i]Title[/i] [b]Subtitle[/b] ...... | ||
| + | *************************************************************************************/ | ||
| + | |||
| // ---------------------------------------------------------------- | // ---------------------------------------------------------------- | ||
| // obligate check for phpwcms constants | // obligate check for phpwcms constants | ||
| Line 80: | Line 93: | ||
| die("You Cannot Access This Script Directly, Have a Nice Day."); } | die("You Cannot Access This Script Directly, Have a Nice Day."); } | ||
| // ---------------------------------------------------------------- | // ---------------------------------------------------------------- | ||
| - | + | ||
| + | |||
| //article menu enhanced | //article menu enhanced | ||
| - | // $catid: the category ID where the articles are (-1 = actual category)) | + | // $catid: the category ID where the articles are (-1 = current category)) |
| - | // $leading_article_hide: How many leading articles must be hide | + | // $leading_article_hide: How many of the first articles are to be hidden |
| - | + | // $count_article: How many articles are to be shown (0=all) | |
| - | function my_article_menu_archive ($catid = 0, $leading_article_hide = 0, $CNT_TMP = '') { | + | |
| + | function my_article_menu_archive ($catid = 0, $leading_article_hide = 0, $count_article, $CNT_TMP = '') { | ||
| + | |||
| + | |||
| + | // Test if all paramters have integer format | ||
| + | if (!(is_intval($catid) AND is_intval($leading_article_hide) AND is_intval($count_article)) ) { | ||
| + | echo '============================================ <br>'; | ||
| + | echo ' <b>ERROR</b>: Wrong integer parameter in {ARTICLE_MENU_ARCHIVE:...<br>'; | ||
| + | echo '============================================ <br>'; | ||
| + | return false; | ||
| + | } | ||
| + | |||
| + | |||
| global $aktion; | global $aktion; | ||
| - | + | ||
| + | |||
| // ===== Simulated CP paramter ================================================ | // ===== Simulated CP paramter ================================================ | ||
| + | |||
| // 0: all articles | // 0: all articles | ||
| // 1: article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() | // 1: article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() | ||
| // 2: article_archive_status=1 AND article_begin<NOW() AND article_end>NOW() | // 2: article_archive_status=1 AND article_begin<NOW() AND article_end>NOW() | ||
| // 3: article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() | // 3: article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() | ||
| + | |||
| // 4: article_archive_status=0 AND article_begin<NOW() AND article_end<NOW() | // 4: article_archive_status=0 AND article_begin<NOW() AND article_end<NOW() | ||
| // 5: article_archive_status=0 AND article_begin<NOW() AND article_end>NOW() | // 5: article_archive_status=0 AND article_begin<NOW() AND article_end>NOW() | ||
| // 6: article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() | // 6: article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() | ||
| + | |||
| $article_archive_status = 2; // Show entries with activated archive status? | $article_archive_status = 2; // Show entries with activated archive status? | ||
| - | + | ||
| - | + | ||
| - | // How many leading articles must be hide (hardcoded) ---------------------- | + | // How many of the first articles are to be hidden (hardcoded) ---------------------- |
| + | |||
| // $leading_article_hide = 1; // default: 0 (now article hide) | // $leading_article_hide = 1; // default: 0 (now article hide) | ||
| - | + | ||
| + | |||
| // CSS classes and IDs ---------------------- | // CSS classes and IDs ---------------------- | ||
| + | |||
| $alinkmenu['wrap_all'] = array('<div class="vlist">','</div>'); // Wrap around all | $alinkmenu['wrap_all'] = array('<div class="vlist">','</div>'); // Wrap around all | ||
| $alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end | $alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end | ||
| Line 118: | Line 142: | ||
| $alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end | $alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end | ||
| $alinkmenu['class_active_link'] = 'active_link'; // Active link class | $alinkmenu['class_active_link'] = 'active_link'; // Active link class | ||
| - | + | ||
| + | |||
| $alinkmenu["style_before"] = ''; // Format before every data set. | $alinkmenu["style_before"] = ''; // Format before every data set. | ||
| $alinkmenu["style_behind"] = ''; // Format behind every data set. | $alinkmenu["style_behind"] = ''; // Format behind every data set. | ||
| - | + | ||
| + | |||
| /* | /* | ||
| // CSS classes and IDs ---------------------- | // CSS classes and IDs ---------------------- | ||
| + | |||
| $alinkmenu['wrap_all'] = array('<div class="teaser_right">','</div>'); // Wrap around all | $alinkmenu['wrap_all'] = array('<div class="teaser_right">','</div>'); // Wrap around all | ||
| $alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end | $alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end | ||
| Line 133: | Line 157: | ||
| $alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end | $alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end | ||
| $alinkmenu['class_active_link'] = 'active_link'; // Active link class | $alinkmenu['class_active_link'] = 'active_link'; // Active link class | ||
| - | + | ||
| - | + | ||
| + | |||
| $alinkmenu["style_before"] = ''; // Format before every data set. | $alinkmenu["style_before"] = ''; // Format before every data set. | ||
| // Format behind every data set. | // Format behind every data set. | ||
| $alinkmenu["style_behind"] = '<div style="margin:5px 0 8px 0;padding:0;height:1px;border:0;border-bottom:1px dotted #CCCCCC;clear:both"><!-- line //--></div>'; | $alinkmenu["style_behind"] = '<div style="margin:5px 0 8px 0;padding:0;height:1px;border:0;border-bottom:1px dotted #CCCCCC;clear:both"><!-- line //--></div>'; | ||
| */ | */ | ||
| - | + | ||
| - | // Insert title/subtitle name and css for the virtual content part | + | // Insert title/subtitle name and css for the virtual content part |
| $virt_article_title = ''; // <div id="box02_top_header"><h1>MyTitle</h1></div> | $virt_article_title = ''; // <div id="box02_top_header"><h1>MyTitle</h1></div> | ||
| $virt_article_subtitle = ''; // <div id="box02_top_header"><h2>MySubTitle</h2></div> | $virt_article_subtitle = ''; // <div id="box02_top_header"><h2>MySubTitle</h2></div> | ||
| - | + | ||
| + | |||
| $alinkmenu['subtitle_on'] = 0; // Article sub title text output [0|1] | $alinkmenu['subtitle_on'] = 0; // Article sub title text output [0|1] | ||
| + | |||
| // Content part parameters ------------------ | // Content part parameters ------------------ | ||
| $alinkmenu['headertext'] = 0; // summary text [0|1] | $alinkmenu['headertext'] = 0; // summary text [0|1] | ||
| $alinkmenu['ul'] = 2; // 1: render as unordered list / 2: render as div / 3: render as table | $alinkmenu['ul'] = 2; // 1: render as unordered list / 2: render as div / 3: render as table | ||
| $alinkmenu['class'] = ''; // wrapped class | $alinkmenu['class'] = ''; // wrapped class | ||
| - | $alinkmenu['maxchar'] = 0; // maxchars summary | + | $alinkmenu['maxchar'] = 0; // maxchars summary |
| $alinkmenu['morelink'] = ' »'; // more link text | $alinkmenu['morelink'] = ' »'; // more link text | ||
| $alinkmenu['hideactive'] = 0; // hide active article in article menu | $alinkmenu['hideactive'] = 0; // hide active article in article menu | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | /* Sorting order for "second entry" | + | /* Sorting order for "second entry" |
| - | ------------------------------ | + | ------------------------------ |
| - | $ao[2] = ' article_sort ASC'; | + | $ao[2] = ' article_sort ASC'; |
| $ao[2] = ' article_sort DESC'; | $ao[2] = ' article_sort DESC'; | ||
| $ao[2] = ' article_created ASC'; | $ao[2] = ' article_created ASC'; | ||
| Line 175: | Line 199: | ||
| $ao[2] = ' article_priorize DESC,'.$ao[2]; | $ao[2] = ' article_priorize DESC,'.$ao[2]; | ||
| ------------------------------ */ | ------------------------------ */ | ||
| + | |||
| // Sorting order ---------------------------- | // Sorting order ---------------------------- | ||
| $ao['2'] = ' article_priorize DESC,'; // Don´t change | $ao['2'] = ' article_priorize DESC,'; // Don´t change | ||
| $ao['2'] .= ' article_sort ASC'; // second entry | $ao['2'] .= ' article_sort ASC'; // second entry | ||
| + | |||
| // ===== END defination ======================================================= | // ===== END defination ======================================================= | ||
| - | + | ||
| - | // catid = -1: The actual category is fetched | + | // catid = -1: The current category is selected |
| $alinkmenu["catid"] = ($catid < 0) ? $GLOBALS['content']['cat_id'] : $catid; // Article category-ID | $alinkmenu["catid"] = ($catid < 0) ? $GLOBALS['content']['cat_id'] : $catid; // Article category-ID | ||
| $alinkmenu['link'] = ''; // reserved, don´t change | $alinkmenu['link'] = ''; // reserved, don´t change | ||
| - | + | ||
| - | + | ||
| - | switch($article_archive_status) { | + | switch($article_archive_status) { |
| case 0: // article_archive_status ist not set | case 0: // article_archive_status ist not set | ||
| - | $alinkmenu['article_archive_status'] = ' '; | + | $alinkmenu['article_archive_status'] = ' '; |
| break; | break; | ||
| - | case 1: | + | case 1: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() '; |
| break; | break; | ||
| - | + | ||
| - | case 2: | + | case 2: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end>NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end>NOW() '; |
| break; | break; | ||
| - | + | ||
| - | case 3: | + | case 3: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() '; |
| break; | break; | ||
| - | + | ||
| - | case 4: | + | case 4: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin<NOW() AND article_end<NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin<NOW() AND article_end<NOW() '; |
| break; | break; | ||
| - | + | ||
| - | case 5: | + | case 5: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin<NOW() AND article_end>NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin<NOW() AND article_end>NOW() '; |
| break; | break; | ||
| - | + | ||
| - | case 6: | + | case 6: |
| - | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() '; | + | $alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() '; |
| break; | break; | ||
| - | + | ||
| - | default: | + | default: |
| $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() '; | $alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin<NOW() AND article_end<NOW() '; | ||
| } | } | ||
| - | + | ||
| + | |||
| $alink_sql = "SELECT article_id, article_title ,article_subtitle, article_cid, article_summary "; | $alink_sql = "SELECT article_id, article_title ,article_subtitle, article_cid, article_summary "; | ||
| $alink_sql .= "FROM ".DB_PREPEND."phpwcms_article "; | $alink_sql .= "FROM ".DB_PREPEND."phpwcms_article "; | ||
| Line 226: | Line 250: | ||
| $alink_sql .= 'AND article_cid='.intval($alinkmenu["catid"]).' '; | $alink_sql .= 'AND article_cid='.intval($alinkmenu["catid"]).' '; | ||
| $alink_sql .= $alinkmenu['article_archive_status']; | $alink_sql .= $alinkmenu['article_archive_status']; | ||
| + | |||
| if(!empty($alinkmenu['hideactive'])) { | if(!empty($alinkmenu['hideactive'])) { | ||
| + | |||
| $alink_sql .= 'AND article_id != '. $aktion[1] . ' '; | $alink_sql .= 'AND article_id != '. $aktion[1] . ' '; | ||
| } | } | ||
| $alink_sql .= 'ORDER BY ' . $ao[2] ; | $alink_sql .= 'ORDER BY ' . $ao[2] ; | ||
| - | + | ||
| + | |||
| $result = _dbQuery($alink_sql); | $result = _dbQuery($alink_sql); | ||
| - | + | ||
| + | |||
| if(isset($result[$leading_article_hide]['article_id'])) { | if(isset($result[$leading_article_hide]['article_id'])) { | ||
| - | + | ||
| - | $count = 0; | + | $count = 0; |
| + | // Max article output ( Input <= 0 --> All articles output ) | ||
| + | ($count_article <= 0) ? $count_art == -1000 : $count_art = 0; | ||
| + | |||
| foreach($result as $value) { | foreach($result as $value) { | ||
| + | |||
| if( $count >= $leading_article_hide ) { // Hide first articles? | if( $count >= $leading_article_hide ) { // Hide first articles? | ||
| - | + | ||
| - | $tempRowSpan = ''; | + | if( $count_article > $count_art ) { // Max article shown |
| - | + | ||
| - | $value['article_summary'] = preg_replace('/<br[^>]*?>$/i', '', $value['article_summary']); // article_summary | + | |
| - | + | $tempRowSpan = ''; | |
| - | + | ||
| - | if($alinkmenu['headertext'] && !empty($value['article_summary'])) { | + | $value['article_summary'] = preg_replace('/<br[^>]*?>$/i', '', $value['article_summary']); // article_summary |
| - | + | ||
| - | $alinkmenu['sum'] = $value['article_summary']; | + | |
| - | + | if($alinkmenu['headertext'] && !empty($value['article_summary'])) { | |
| - | + | ||
| - | if(!empty($alinkmenu['maxchar'])) { | + | $alinkmenu['sum'] = $value['article_summary']; |
| - | + | ||
| - | $alinkmenu['sum'] = clean_replacement_tags($alinkmenu['sum']); | + | |
| - | $alinkmenu['sum'] = remove_unsecure_rptags($alinkmenu['sum']); | + | if(!empty($alinkmenu['maxchar'])) { |
| - | $alinkmenu['sum'] = preg_replace('/\s/i', ' ', $alinkmenu['sum']); | + | |
| - | $alinkmenu['sum'] = preg_replace('/\s{2,}/i', ' ', $alinkmenu['sum']); | + | $alinkmenu['sum'] = clean_replacement_tags($alinkmenu['sum']); |
| - | $alinkmenu['sum'] = trim(decode_entities($alinkmenu['sum'])); | + | $alinkmenu['sum'] = remove_unsecure_rptags($alinkmenu['sum']); |
| - | $alinkmenu['sum'] = wordwrap($alinkmenu['sum'], $alinkmenu['maxchar'], "\n"); | + | $alinkmenu['sum'] = preg_replace('/\s/i', ' ', $alinkmenu['sum']); |
| - | list($alinkmenu['sum']) = explode("\n", $alinkmenu['sum']); | + | $alinkmenu['sum'] = preg_replace('/\s{2,}/i', ' ', $alinkmenu['sum']); |
| - | $alinkmenu['sum'] = trim($alinkmenu['sum']); | + | $alinkmenu['sum'] = trim(decode_entities($alinkmenu['sum'])); |
| - | $alinkmenu['sum'] = html_specialchars($alinkmenu['sum']); | + | $alinkmenu['sum'] = wordwrap($alinkmenu['sum'], $alinkmenu['maxchar'], "\n"); |
| - | + | list($alinkmenu['sum']) = explode("\n", $alinkmenu['sum']); | |
| - | if(!empty($alinkmenu['morelink'])) { | + | $alinkmenu['sum'] = trim($alinkmenu['sum']); |
| - | + | $alinkmenu['sum'] = html_specialchars($alinkmenu['sum']); | |
| - | $alinkmenu['sum'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | + | |
| - | $alinkmenu['sum'] .= $alinkmenu['morelink']; | + | if(!empty($alinkmenu['morelink'])) { |
| - | $alinkmenu['sum'] .= '</a>'; | + | |
| - | + | $alinkmenu['sum'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | |
| + | $alinkmenu['sum'] .= $alinkmenu['morelink']; | ||
| + | $alinkmenu['sum'] .= '</a>'; | ||
| + | |||
| + | } | ||
| + | // Set css wrapper | ||
| + | $alinkmenu['sum'] = LF.$alinkmenu['wrap_summary'][0].LF.$alinkmenu['sum'].LF.$alinkmenu['wrap_summary'][1]; | ||
| + | |||
| } | } | ||
| - | // Set css wrapper | + | |
| - | $alinkmenu['sum'] = LF.$alinkmenu['wrap_summary'][0].LF.$alinkmenu['sum'].LF.$alinkmenu['sum'][1]; | + | } else { |
| - | + | ||
| + | |||
| + | |||
| + | $alinkmenu['sum'] = false; | ||
| + | |||
| } | } | ||
| - | + | ||
| - | } else { | + | // SubTitle ---------------------- |
| - | + | $alinkmenu['subtitle'] = (!empty($value['article_subtitle']) AND !empty($alinkmenu['subtitle_on'])) ? | |
| - | + | $alinkmenu['wrap_subtitle'][0].render_bbcode_basics(html_specialchars($value['article_subtitle'])).$alinkmenu['wrap_subtitle'][1] : ''; | |
| - | + | ||
| - | $alinkmenu['sum'] = false; | + | // Format before every data set. |
| - | + | $alinkmenu['link'] .= LF.$alinkmenu["style_before"].LF; | |
| - | } | + | |
| - | + | ||
| - | // SubTitle ---------------------- | + | // set link or link with active link class -------------------- |
| - | $alinkmenu['subtitle'] = (!empty($value['article_subtitle']) AND !empty($alinkmenu['subtitle_on'])) ? | + | |
| - | $alinkmenu['wrap_subtitle'][0].html_specialchars($value['article_subtitle']).$alinkmenu['wrap_subtitle'][1] : ''; | + | $alinkmenu['link_wrap'] = '<a href="index.php?aid='.$value['article_id'].'">'; |
| - | + | ||
| - | // Format before every data set. | + | if (empty($alinkmenu['hideactive']) AND ($value['article_id'] == $aktion[1])) { |
| - | $alinkmenu['link'] .= LF.$alinkmenu["style_before"].LF; | + | $alinkmenu['link_wrap'] = '<a href="index.php?aid='.$value['article_id'].'" '.get_class_attrib($alinkmenu['class_active_link']).'>'; |
| - | + | } | |
| - | + | ||
| - | // set link or link with active link class -------------------- | + | |
| - | + | ||
| - | $alinkmenu['link_wrap'] = '<a href="index.php?aid='.$value['article_id'].'">'; | + | switch($alinkmenu['ul']) { |
| - | + | ||
| - | if (empty($alinkmenu['hideactive']) AND ($value['article_id'] == $aktion[1])) { | + | case 1: // render as unordered list |
| - | $alinkmenu['link_wrap'] = '<a href="index.php?aid='.$value['article_id'].'" '.get_class_attrib($alinkmenu['class_active_link']).'>'; | + | |
| - | } | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | switch($alinkmenu['ul']) { | + | |
| - | + | ||
| - | case 1: // render as unordered list | + | |
| $alinkmenu['link'] .= '<li>'.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0]; | $alinkmenu['link'] .= '<li>'.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0]; | ||
| // $alinkmenu['link'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | // $alinkmenu['link'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | ||
| $alinkmenu['link'] .= $alinkmenu['link_wrap']; | $alinkmenu['link'] .= $alinkmenu['link_wrap']; | ||
| - | $alinkmenu['link'] .= html_specialchars($value['article_title']); | + | $alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title'])); |
| $alinkmenu['link'] .= $alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]; | $alinkmenu['link'] .= $alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]; | ||
| $alinkmenu['link'] .= $alinkmenu['subtitle']; | $alinkmenu['link'] .= $alinkmenu['subtitle']; | ||
| - | + | ||
| if($alinkmenu['sum'] !== false) { | if($alinkmenu['sum'] !== false) { | ||
| $alinkmenu['link'] .= "\n".$alinkmenu['sum']; | $alinkmenu['link'] .= "\n".$alinkmenu['sum']; | ||
| } | } | ||
| - | + | ||
| $alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."</li>\n"; | $alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."</li>\n"; | ||
| break; | break; | ||
| - | + | ||
| - | case 2: // render as div | + | case 2: // render as div |
| $alinkmenu['link'] .= '<div>'.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0]; | $alinkmenu['link'] .= '<div>'.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0]; | ||
| // $alinkmenu['link'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | // $alinkmenu['link'] .= '<a href="index.php?aid='.$value['article_id'].'">'; | ||
| $alinkmenu['link'] .= $alinkmenu['link_wrap']; | $alinkmenu['link'] .= $alinkmenu['link_wrap']; | ||
| - | $alinkmenu['link'] .= html_specialchars($value['article_title']); | + | $alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title'])); |
| $alinkmenu['link'] .= $alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]; | $alinkmenu['link'] .= $alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]; | ||
| $alinkmenu['link'] .= $alinkmenu['subtitle']; | $alinkmenu['link'] .= $alinkmenu['subtitle']; | ||
| - | + | ||
| if($alinkmenu['sum'] !== false) { | if($alinkmenu['sum'] !== false) { | ||
| $alinkmenu['link'] .= "\n".$alinkmenu['sum']; | $alinkmenu['link'] .= "\n".$alinkmenu['sum']; | ||
| } | } | ||
| - | + | ||
| $alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."</div>\n"; | $alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."</div>\n"; | ||
| break; | break; | ||
| - | + | ||
| - | default: // render as table | + | default: // render as table |
| - | + | ||
| // SubTitle ------------ | // SubTitle ------------ | ||
| if ($alinkmenu['subtitle'] !== '' AND !empty($alinkmenu['subtitle_on'])) { | if ($alinkmenu['subtitle'] !== '' AND !empty($alinkmenu['subtitle_on'])) { | ||
| Line 344: | Line 373: | ||
| $alinkmenu['subtitle'] = "<tr>\n\t<td>" .$alinkmenu['subtitle']. "</td>\n</tr>\n"; | $alinkmenu['subtitle'] = "<tr>\n\t<td>" .$alinkmenu['subtitle']. "</td>\n</tr>\n"; | ||
| } | } | ||
| - | + | ||
| if($alinkmenu['sum'] !== false) { | if($alinkmenu['sum'] !== false) { | ||
| $tempRowSpan = ' rowspan="2"'; | $tempRowSpan = ' rowspan="2"'; | ||
| $alinkmenu['sum'] = "<tr>\n\t<td>" . $alinkmenu['sum'] . "</td>\n</tr>\n"; | $alinkmenu['sum'] = "<tr>\n\t<td>" . $alinkmenu['sum'] . "</td>\n</tr>\n"; | ||
| } | } | ||
| - | + | ||
| $alinkmenu['link'] .= "<tr>\n\t<td valign=\"top\"".$tempRowSpan." nowrap=\"nowrap\">".$template_default["article"]["link_article_sign"]."</td>\n\t"; | $alinkmenu['link'] .= "<tr>\n\t<td valign=\"top\"".$tempRowSpan." nowrap=\"nowrap\">".$template_default["article"]["link_article_sign"]."</td>\n\t"; | ||
| // $alinkmenu['link'] .= '<td>'.$alinkmenu['wrap_title'][0].'<a href="index.php?aid='.$value['article_id'].'" '; | // $alinkmenu['link'] .= '<td>'.$alinkmenu['wrap_title'][0].'<a href="index.php?aid='.$value['article_id'].'" '; | ||
| $alinkmenu['link'] .= '<td>'.$alinkmenu['wrap_title'][0].$alinkmenu['link_wrap']; | $alinkmenu['link'] .= '<td>'.$alinkmenu['wrap_title'][0].$alinkmenu['link_wrap']; | ||
| // $alinkmenu['link'] .= get_class_attrib($template_default["article"]["link_article_class"]).">"; | // $alinkmenu['link'] .= get_class_attrib($template_default["article"]["link_article_class"]).">"; | ||
| - | $alinkmenu['link'] .= html_specialchars($value['article_title']).$alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]."</td>\n</tr>\n"; | + | $alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title'])).$alinkmenu['morelink'].'</a>'.$alinkmenu['wrap_title'][1]."</td>\n</tr>\n"; |
| $alinkmenu['link'] .= $alinkmenu['subtitle']; | $alinkmenu['link'] .= $alinkmenu['subtitle']; | ||
| $alinkmenu['link'] .= $alinkmenu['sum']; | $alinkmenu['link'] .= $alinkmenu['sum']; | ||
| - | + | ||
| - | } | + | } |
| - | + | ||
| - | // Format behind every data set. | + | // Format behind every data set. |
| - | $alinkmenu['link'] .= $alinkmenu["style_behind"]; | + | $alinkmenu['link'] .= $alinkmenu["style_behind"]; |
| - | + | ||
| + | } // END if $count_art .... | ||
| + | $count_art++; | ||
| + | |||
| } // END if $count .... | } // END if $count .... | ||
| - | + | ||
| - | $count++; | + | $count++; |
| - | + | ||
| } // END foreach | } // END foreach | ||
| - | + | ||
| // mysql_free_result($result); | // mysql_free_result($result); | ||
| + | |||
| } | } | ||
| + | |||
| if($alinkmenu['link']) { | if($alinkmenu['link']) { | ||
| + | |||
| switch($alinkmenu['ul']) { | switch($alinkmenu['ul']) { | ||
| - | + | ||
| case 1: // render as unordered list | case 1: // render as unordered list | ||
| - | $alinkmenu['link'] = "<ul>\n" . $alinkmenu['link'] . "</ul>\n"; | + | $alinkmenu['link'] = "<ul>\n" . $alinkmenu['link'] . "</ul>\n"; |
| break; | break; | ||
| - | + | ||
| - | case 2: // render as div | + | case 2: // render as div |
| break; | break; | ||
| - | + | ||
| default: // render as table | default: // render as table | ||
| $alinkmenu['link'] = '<table border="0" cellspacing="0" cellpadding="0">'."\n" . $alinkmenu['link'] . "</table>\n"; | $alinkmenu['link'] = '<table border="0" cellspacing="0" cellpadding="0">'."\n" . $alinkmenu['link'] . "</table>\n"; | ||
| - | + | ||
| } | } | ||
| + | |||
| // now check if class name is given | // now check if class name is given | ||
| // if so wrap article menu in div | // if so wrap article menu in div | ||
| if(!empty($alinkmenu['class'])) { | if(!empty($alinkmenu['class'])) { | ||
| - | + | ||
| $alinkmenu['link'] = '<div class="' . html_specialchars($alinkmenu['class']) . "\">\n" . $alinkmenu['link'] . "</div>\n"; | $alinkmenu['link'] = '<div class="' . html_specialchars($alinkmenu['class']) . "\">\n" . $alinkmenu['link'] . "</div>\n"; | ||
| - | + | ||
| - | } | + | } |
| $CNT_TMP .= $alinkmenu['wrap_all'][0].LF.$virt_article_title . $virt_article_subtitle . $alinkmenu['link'].LF.$alinkmenu['wrap_all'][1].LF; | $CNT_TMP .= $alinkmenu['wrap_all'][0].LF.$virt_article_title . $virt_article_subtitle . $alinkmenu['link'].LF.$alinkmenu['wrap_all'][1].LF; | ||
| - | + | ||
| } | } | ||
| + | |||
| unset($alinkmenu); | unset($alinkmenu); | ||
| + | |||
| return $CNT_TMP; | return $CNT_TMP; | ||
| } | } | ||
| + | |||
| // $content['all'] = str_replace('{ARTICLE_MENU_ARCHIVE}', my_article_menu_archive() ,$content['all']); | // $content['all'] = str_replace('{ARTICLE_MENU_ARCHIVE}', my_article_menu_archive() ,$content['all']); | ||
| - | + | ||
| - | $content["all"] = preg_replace('/{ARTICLE_MENU_ARCHIVE:(.*?),(.*?)}/e', 'my_article_menu_archive("$1","$2")', $content["all"]); | + | $content["all"] = preg_replace('/{ARTICLE_MENU_ARCHIVE:(.*?),(.*?),(.*?)}/e', 'my_article_menu_archive("$1","$2","$3")', $content["all"]); |
| + | |||
| ?> | ?> | ||
| </code> | </code> | ||