';
echo ' ERROR: Wrong integer parameter in {ARTICLE_MENU_ARCHIVE:...
';
echo '============================================
';
return false;
}
global $aktion;
// ===== Simulated CP paramter ================================================
// 0: all articles
// 1: article_archive_status=1 AND article_beginNOW()
// 3: article_archive_status=1 AND article_begin>NOW() AND article_end>NOW()
// 4: article_archive_status=0 AND article_beginNOW()
// 6: article_archive_status=0 AND article_begin>NOW() AND article_end>NOW()
$article_archive_status = 2; // Show entries with activated archive status?
// How many of the first articles are to be hidden (hardcoded) ----------------------
// $leading_article_hide = 1; // default: 0 (now article hide)
// CSS classes and IDs ----------------------
$alinkmenu['wrap_all'] = array('',''); // Wrap around all
$alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end
$alinkmenu['wrap_title'] = array('',''); // Title wrap around all begin, end
$alinkmenu['wrap_subtitle'] = array('',''); // SubTitle wrap begin, end
$alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end
$alinkmenu['class_active_link'] = 'active_link'; // Active link class
$alinkmenu["style_before"] = ''; // Format before every data set.
$alinkmenu["style_behind"] = ''; // Format behind every data set.
/*
// CSS classes and IDs ----------------------
$alinkmenu['wrap_all'] = array(' '); // Wrap around all
$alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end
$alinkmenu['wrap_title'] = array('','
'); // Title wrap around all begin, end
$alinkmenu['wrap_subtitle'] = array('','
'); // SubTitle wrap begin, end
$alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end
$alinkmenu['class_active_link'] = 'active_link'; // Active link class
$alinkmenu["style_before"] = ''; // Format before every data set.
// Format behind every data set.
$alinkmenu["style_behind"] = '';
*/
// Insert title/subtitle name and css for the virtual content part
$virt_article_title = ''; // MyTitle
$virt_article_subtitle = ''; // MySubTitle
$alinkmenu['subtitle_on'] = 0; // Article sub title text output [0|1]
// Content part parameters ------------------
$alinkmenu['headertext'] = 0; // summary text [0|1]
$alinkmenu['ul'] = 2; // 1: render as unordered list / 2: render as div / 3: render as table
$alinkmenu['class'] = ''; // wrapped class
$alinkmenu['maxchar'] = 0; // maxchars summary
$alinkmenu['morelink'] = ' »'; // more link text
$alinkmenu['hideactive'] = 0; // hide active article in article menu
/* Sorting order for "second entry"
------------------------------
$ao[2] = ' article_sort ASC';
$ao[2] = ' article_sort DESC';
$ao[2] = ' article_created ASC';
$ao[2] = ' article_created DESC';
$ao[2] = ' article_tstamp ASC';
$ao[2] = ' article_tstamp DESC';
$ao[2] = ' article_begin ASC';
$ao[2] = ' article_begin DESC';
$ao[2] = ' article_title ASC';
$ao[2] = ' article_title DESC';
$ao[2] = ' article_end ASC';
$ao[2] = ' article_end DESC';
$ao[2] = ' article_priorize DESC,'.$ao[2];
------------------------------ */
// Sorting order ----------------------------
$ao['2'] = ' article_priorize DESC,'; // Don´t change
$ao['2'] .= ' article_sort ASC'; // second entry
// ===== END defination =======================================================
// catid = -1: The current category is selected
$alinkmenu["catid"] = ($catid < 0) ? $GLOBALS['content']['cat_id'] : $catid; // Article category-ID
$alinkmenu['link'] = ''; // reserved, don´t change
switch($article_archive_status) {
case 0: // article_archive_status ist not set
$alinkmenu['article_archive_status'] = ' ';
break;
case 1:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_beginNOW() ';
break;
case 3:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() ';
break;
case 4:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_beginNOW() ';
break;
case 6:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() ';
break;
default:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin All articles output )
($count_article <= 0) ? $count_art == -1000 : $count_art = 0;
foreach($result as $value) {
if( $count >= $leading_article_hide ) { // Hide first articles?
if( $count_article > $count_art ) { // Max article shown
$tempRowSpan = '';
$value['article_summary'] = preg_replace('/
]*?>$/i', '', $value['article_summary']); // article_summary
if($alinkmenu['headertext'] && !empty($value['article_summary'])) {
$alinkmenu['sum'] = $value['article_summary'];
if(!empty($alinkmenu['maxchar'])) {
$alinkmenu['sum'] = clean_replacement_tags($alinkmenu['sum']);
$alinkmenu['sum'] = remove_unsecure_rptags($alinkmenu['sum']);
$alinkmenu['sum'] = preg_replace('/\s/i', ' ', $alinkmenu['sum']);
$alinkmenu['sum'] = preg_replace('/\s{2,}/i', ' ', $alinkmenu['sum']);
$alinkmenu['sum'] = trim(decode_entities($alinkmenu['sum']));
$alinkmenu['sum'] = wordwrap($alinkmenu['sum'], $alinkmenu['maxchar'], "\n");
list($alinkmenu['sum']) = explode("\n", $alinkmenu['sum']);
$alinkmenu['sum'] = trim($alinkmenu['sum']);
$alinkmenu['sum'] = html_specialchars($alinkmenu['sum']);
if(!empty($alinkmenu['morelink'])) {
$alinkmenu['sum'] .= '';
$alinkmenu['sum'] .= $alinkmenu['morelink'];
$alinkmenu['sum'] .= '';
}
// Set css wrapper
$alinkmenu['sum'] = LF.$alinkmenu['wrap_summary'][0].LF.$alinkmenu['sum'].LF.$alinkmenu['wrap_summary'][1];
}
} else {
$alinkmenu['sum'] = false;
}
// 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] : '';
// Format before every data set.
$alinkmenu['link'] .= LF.$alinkmenu["style_before"].LF;
// set link or link with active link class --------------------
$alinkmenu['link_wrap'] = '';
if (empty($alinkmenu['hideactive']) AND ($value['article_id'] == $aktion[1])) {
$alinkmenu['link_wrap'] = '';
}
switch($alinkmenu['ul']) {
case 1: // render as unordered list
$alinkmenu['link'] .= ''.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0];
// $alinkmenu['link'] .= '';
$alinkmenu['link'] .= $alinkmenu['link_wrap'];
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title']));
$alinkmenu['link'] .= $alinkmenu['morelink'].''.$alinkmenu['wrap_title'][1];
$alinkmenu['link'] .= $alinkmenu['subtitle'];
if($alinkmenu['sum'] !== false) {
$alinkmenu['link'] .= "\n".$alinkmenu['sum'];
}
$alinkmenu['link'] .= $alinkmenu['wrap_data'][1]." \n";
break;
case 2: // render as div
$alinkmenu['link'] .= ''.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0];
// $alinkmenu['link'] .= '';
$alinkmenu['link'] .= $alinkmenu['link_wrap'];
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title']));
$alinkmenu['link'] .= $alinkmenu['morelink'].''.$alinkmenu['wrap_title'][1];
$alinkmenu['link'] .= $alinkmenu['subtitle'];
if($alinkmenu['sum'] !== false) {
$alinkmenu['link'] .= "\n".$alinkmenu['sum'];
}
$alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."\n";
break;
default: // render as table
// SubTitle ------------
if ($alinkmenu['subtitle'] !== '' AND !empty($alinkmenu['subtitle_on'])) {
$tempRowSpan = ' rowspan="2"';
$alinkmenu['subtitle'] = "\n\t" .$alinkmenu['subtitle']. " \n \n";
}
if($alinkmenu['sum'] !== false) {
$tempRowSpan = ' rowspan="2"';
$alinkmenu['sum'] = "\n\t" . $alinkmenu['sum'] . " \n \n";
}
$alinkmenu['link'] .= "\n\t".$template_default["article"]["link_article_sign"]." \n\t";
// $alinkmenu['link'] .= ''.$alinkmenu['wrap_title'][0].'";
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title'])).$alinkmenu['morelink'].''.$alinkmenu['wrap_title'][1]." \n \n";
$alinkmenu['link'] .= $alinkmenu['subtitle'];
$alinkmenu['link'] .= $alinkmenu['sum'];
}
// Format behind every data set.
$alinkmenu['link'] .= $alinkmenu["style_behind"];
} // END if $count_art ....
$count_art++;
} // END if $count ....
$count++;
} // END foreach
// mysql_free_result($result);
}
if($alinkmenu['link']) {
switch($alinkmenu['ul']) {
case 1: // render as unordered list
$alinkmenu['link'] = "\n" . $alinkmenu['link'] . "
\n";
break;
case 2: // render as div
break;
default: // render as table
$alinkmenu['link'] = ''."\n" . $alinkmenu['link'] . "
\n";
}
// now check if class name is given
// if so wrap article menu in div
if(!empty($alinkmenu['class'])) {
$alinkmenu['link'] = ' \n";
}
$CNT_TMP .= $alinkmenu['wrap_all'][0].LF.$virt_article_title . $virt_article_subtitle . $alinkmenu['link'].LF.$alinkmenu['wrap_all'][1].LF;
}
unset($alinkmenu);
return $CNT_TMP;
}
// $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","$3")', $content["all"]);
?>
\\
===== V1.2 =====
**Version:** V1.2 \\
Update 09.03.2010: Artikelstatus nun über den Tag einstellbar.
Tag: **{ARTICLE_MENU_ARCHIVE:category-ID, count-hide, count-article, article-status}** oder **{ARTICLE_MENU_ARCHIVE:-1, count-hide, count-article, article-status}** für aktuelle Kategorie
**Mögliche Varianten:** Sind keine Parameter gesetzt wird folgendes angenommen: \\
- **{ARTICLE_MENU_ARCHIVE:,,,}** -> Fallback für die einzelnen Parameter: **{ARTICLE_MENU_ARCHIVE:0,0,100,2}** \\ //(Einstellbar unter "%% ===== CUSTOM INPUT === %%")//.
----
==== Artikel-Staus: ====
{ARTICLE_MENU_ARCHIVE:category-ID, count-hide, count-article, **article-status**}
NOW()
// 3: article_archive_status=1 AND article_begin>NOW() AND article_end>NOW()
// 4: article_archive_status=0 AND article_beginNOW()
// 6: article_archive_status=0 AND article_begin>NOW() AND article_end>NOW()
//$article_archive_status = 2; // Show entries with activated archive status?
// How many of the first articles are to be hidden (hardcoded) ----------------------
// $leading_article_hide = 1; // default: 0 (now article hide)
// CSS classes and IDs ----------------------
$alinkmenu['wrap_all'] = array('',''); // Wrap around all
$alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end
$alinkmenu['wrap_title'] = array('','
'); // Title wrap around all begin, end
$alinkmenu['wrap_subtitle'] = array('','
'); // SubTitle wrap begin, end
$alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end
$alinkmenu['class_active_link'] = 'active_link'; // Active link class
$alinkmenu["style_before"] = ''; // Format before every data set.
$alinkmenu["style_behind"] = ''; // Format behind every data set.
/*
// CSS classes and IDs example/Beispiel ----------------------
$alinkmenu['wrap_all'] = array(' '); // Wrap around all
$alinkmenu['wrap_data'] = array('',''); // Data wrap begin, end
$alinkmenu['wrap_title'] = array('','
'); // Title wrap around all begin, end
$alinkmenu['wrap_subtitle'] = array('','
'); // SubTitle wrap begin, end
$alinkmenu['wrap_summary'] = array('',''); // Wrap around summary begin, end
$alinkmenu['class_active_link'] = 'active_link'; // Active link class
$alinkmenu["style_before"] = ''; // Format before every data set.
// Format behind every data set.
$alinkmenu["style_behind"] = '';
*/
// Insert title/subtitle name and css for the virtual content part
$virt_article_title = ''; // MyTitle
$virt_article_subtitle = ''; // MySubTitle
$alinkmenu['subtitle_on'] = 0; // Article sub title text output [0|1]
// Content part parameters ------------------
$alinkmenu['headertext'] = 1; // summary text [0|1]
$alinkmenu['ul'] = 2; // 1: render as unordered list / 2: render as div / 3: render as table
$alinkmenu['class'] = ''; // wrapped class
$alinkmenu['maxchar'] = 100; // maxchars summary
$alinkmenu['morelink'] = ' …'; // more link text
$alinkmenu['morelink_title'] = ' »'; // more link text for title
$alinkmenu['hideactive'] = 0; // hide active article in article menu
/* Sorting order for "second entry"
------------------------------
$ao[2] = ' article_sort ASC';
$ao[2] = ' article_sort DESC';
$ao[2] = ' article_created ASC';
$ao[2] = ' article_created DESC';
$ao[2] = ' article_tstamp ASC';
$ao[2] = ' article_tstamp DESC';
$ao[2] = ' article_begin ASC';
$ao[2] = ' article_begin DESC';
$ao[2] = ' article_title ASC';
$ao[2] = ' article_title DESC';
$ao[2] = ' article_end ASC';
$ao[2] = ' article_end DESC';
$ao[2] = ' article_priorize DESC,'.$ao[2];
------------------------------ */
// Sorting order ----------------------------
$ao['2'] = ' article_priorize DESC,'; // Don´t change // Nicht aendern!!
$ao['2'] .= ' article_sort ASC'; // second entry // Zweiter Eintrag
// ===== END defination =======================================================
// ============================================================================
// Tag input parameter
if (!empty($parameter[0])) $catid = intval($parameter[0]); // Tag input: Category-ID
if (!empty($parameter[1])) $leading_article_hide = intval($parameter[1]); // Tag input: No. scriped articles
if (!empty($parameter[2])) $count_article = intval($parameter[2]); // Tag input: Max count articles
if (!empty($parameter[3])) {
$article_archive_status = intval($parameter[3]); // Tag input: [0-6]
if ($article_archive_status < 0 AND
$article_archive_status > 6) // Fallback if out of range range
$article_archive_status = 2;
}
global $aktion;
// catid = -1: The current category is selected
$alinkmenu["catid"] = ($catid < 0) ? $GLOBALS['content']['cat_id'] : $catid; // Article category-ID
$alinkmenu['link'] = ''; // reserved, don´t change
switch($article_archive_status) {
case 0: // article_archive_status ist not set
$alinkmenu['article_archive_status'] = ' ';
break;
case 1:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_beginNOW() ';
break;
case 3:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin>NOW() AND article_end>NOW() ';
break;
case 4:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_beginNOW() ';
break;
case 6:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=0 AND article_begin>NOW() AND article_end>NOW() ';
break;
default:
$alinkmenu['article_archive_status'] = 'AND article_archive_status=1 AND article_begin All articles output )
($count_article <= 0) ? $count_art == -1000 : $count_art = 0;
foreach($result as $value) {
if( $count >= $leading_article_hide ) { // Hide first articles?
if( $count_article > $count_art ) { // Max article shown
$tempRowSpan = '';
$value['article_summary'] = preg_replace('/
]*?>$/i', '', $value['article_summary']); // article_summary
if($alinkmenu['headertext'] && !empty($value['article_summary'])) {
$alinkmenu['sum'] = $value['article_summary'];
if(!empty($alinkmenu['maxchar'])) {
$alinkmenu['sum'] = clean_replacement_tags($alinkmenu['sum']);
$alinkmenu['sum'] = remove_unsecure_rptags($alinkmenu['sum']);
$alinkmenu['sum'] = preg_replace('/\s/i', ' ', $alinkmenu['sum']);
$alinkmenu['sum'] = preg_replace('/\s{2,}/i', ' ', $alinkmenu['sum']);
$alinkmenu['sum'] = trim(decode_entities($alinkmenu['sum']));
$alinkmenu['sum'] = wordwrap($alinkmenu['sum'], $alinkmenu['maxchar'], "\n");
list($alinkmenu['sum']) = explode("\n", $alinkmenu['sum']);
$alinkmenu['sum'] = trim($alinkmenu['sum']);
$alinkmenu['sum'] = html_specialchars($alinkmenu['sum']);
if(!empty($alinkmenu['morelink'])) {
$alinkmenu['sum'] .= '';
$alinkmenu['sum'] .= $alinkmenu['morelink'];
$alinkmenu['sum'] .= '';
}
// Set css wrapper
$alinkmenu['sum'] = LF.$alinkmenu['wrap_summary'][0].LF.$alinkmenu['sum'].LF.$alinkmenu['wrap_summary'][1];
}
} else {
$alinkmenu['sum'] = false;
}
// 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] : '';
// Format before every data set.
$alinkmenu['link'] .= LF.$alinkmenu["style_before"].LF;
// set link or link with active link class --------------------
// Title link ---------------
$alinkmenu['link_wrap'] = '';
if (empty($alinkmenu['hideactive']) AND ($value['article_id'] == $aktion[1])) {
$alinkmenu['link_wrap'] = '';
}
switch($alinkmenu['ul']) {
case 1: // render as unordered list
$alinkmenu['link'] .= ''.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0];
// $alinkmenu['link'] .= '';
$alinkmenu['link'] .= $alinkmenu['link_wrap'];
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title']));
$alinkmenu['link'] .= $alinkmenu['morelink_title'].''.$alinkmenu['wrap_title'][1];
$alinkmenu['link'] .= $alinkmenu['subtitle'];
if($alinkmenu['sum'] !== false) {
$alinkmenu['link'] .= "\n".$alinkmenu['sum'];
}
$alinkmenu['link'] .= $alinkmenu['wrap_data'][1]." \n";
break;
case 2: // render as div
$alinkmenu['link'] .= ''.$alinkmenu['wrap_data'][0].$alinkmenu['wrap_title'][0];
// $alinkmenu['link'] .= '';
$alinkmenu['link'] .= $alinkmenu['link_wrap'];
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title']));
$alinkmenu['link'] .= $alinkmenu['morelink_title'].''.$alinkmenu['wrap_title'][1];
$alinkmenu['link'] .= $alinkmenu['subtitle'];
if($alinkmenu['sum'] !== false) {
$alinkmenu['link'] .= "\n".$alinkmenu['sum'];
}
$alinkmenu['link'] .= $alinkmenu['wrap_data'][1]."\n";
break;
default: // render as table
// SubTitle ------------
if ($alinkmenu['subtitle'] !== '' AND !empty($alinkmenu['subtitle_on'])) {
$tempRowSpan = ' rowspan="2"';
$alinkmenu['subtitle'] = "\n\t" .$alinkmenu['subtitle']. " \n \n";
}
if($alinkmenu['sum'] !== false) {
$tempRowSpan = ' rowspan="2"';
$alinkmenu['sum'] = "\n\t" . $alinkmenu['sum'] . " \n \n";
}
$alinkmenu['link'] .= "\n\t".$template_default["article"]["link_article_sign"]." \n\t";
// $alinkmenu['link'] .= ''.$alinkmenu['wrap_title'][0].'";
$alinkmenu['link'] .= render_bbcode_basics(html_specialchars($value['article_title'])).$alinkmenu['morelink_title'].''.$alinkmenu['wrap_title'][1]." \n \n";
$alinkmenu['link'] .= $alinkmenu['subtitle'];
$alinkmenu['link'] .= $alinkmenu['sum'];
}
// Format behind every data set.
$alinkmenu['link'] .= $alinkmenu["style_behind"];
} // END if $count_art ....
$count_art++;
} // END if $count ....
$count++;
} // END foreach
// mysql_free_result($result);
}
if($alinkmenu['link']) {
switch($alinkmenu['ul']) {
case 1: // render as unordered list
$alinkmenu['link'] = "\n" . $alinkmenu['link'] . "
\n";
break;
case 2: // render as div
break;
default: // render as table
$alinkmenu['link'] = ''."\n" . $alinkmenu['link'] . "
\n";
}
// now check if class name is given
// if so wrap article menu in div
if(!empty($alinkmenu['class'])) {
$alinkmenu['link'] = ' \n";
}
$CNT_TMP .= $alinkmenu['wrap_all'][0].LF.$virt_article_title . $virt_article_subtitle . $alinkmenu['link'].LF.$alinkmenu['wrap_all'][1].LF;
}
unset($alinkmenu);
return $CNT_TMP;
}
$content["all"] = preg_replace('/{ARTICLE_MENU_ARCHIVE:(.*?)}/e', 'my_article_menu_archive("$1")', $content["all"]);
?>