{source 1}<?php
$params = 'category_name=&category_name_one=&all_articles=1&cat_alias=urgent-announcements&cat_id=47&link_prfx=urgent-announcements&parent_id=';
$this_title = "";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Feature Articles&category_name_one=Feature Article&cat_alias=Feature Articles&cat_id=60&link_prfx=/features/feature-articles&parent_id=2182';
$this_title = "Feature Articles";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Spotlights&category_name_one=Spotlight&cat_alias=&cat_id=2262&link_prfx=/spotlight&parent_id=';
$this_title = "Spotlight";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Interviews&category_name_one=Interview&cat_alias=interviews&cat_id=117&link_prfx=/features/interviews&parent_id=0';
$this_title = "Interviews";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{module Column Of The Week}

{source 1}<?php
$params = 'category_name=Concert Reviews&category_name_one=Concert Review&cat_alias=concert-reviews&cat_id=61&link_prfx=/reviews/concert-reviews&parent_id=0';
$this_title = "Recent Concert Reviews";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Passings&category_name_one=passings&cat_alias=passings&cat_id=60&link_prfx=/features/passings&parent_id=0';
$this_title = "Passings";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=CD Reviews&category_name_one=CD Review&cat_alias=cd-reviews&cat_id=53&link_prfx=/reviews/cd-reviews&parent_id=0';
$this_title = "Recent CD Reviews";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=GRAMMY NOMINEES&category_name_one=GRAMMY NOMINEES&cat_alias=&cat_id=2129&link_prfx=/features/special&parent_id=';
$this_title = "Recent FolkBits";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Book Reviews&category_name_one=Book Review&cat_alias=book-reviews &cat_id=62&link_prfx=/reviews/book-reviews&parent_id=0';
$this_title = "Recent Book Reviews";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

{source 1}<?php
$params = 'category_name=Film and Theater Reviews&category_name_one=Film and Theater Review&cat_alias=film-theater-reviews&cat_id=68&link_prfx=/reviews/film-theater-reviews&parent_id=0';
$this_title = "Recent Film/Theater Reviews";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}

everything but ...

Highly recommended

Saturday at Simi Cajun-Blues Festival and Coffee Gallery Backstage

Read more: La Recolte Cajun Band

{module full calendar fp block}

{module Today Calendar}

{module Today Calendar Recurring Events}

{module Today Music Recurring}

{module Today Dances Recurring}


 {module video front page block}

{source 1}<?php
$params = 'category_name=Upcoming Concerts&category_name_one=Upcoming Concert&cat_alias=upcoming-concerts&cat_id=2263&link_prfx=/upcoming-concerts&parent_id=';
$this_title = "Upcoming Concerts";
$parent_id = 0;
$all_articles = false;
$tags = array ("parent_id","cat_id", "cat_alias" , "category_name_one", "category_name", "this_title", "link_prfx", "all_articles" );
parse_str($params);
$now = time(); # get the current time
parse_str($params, $output);
#echo "<!--- <pre>";print_r($output);echo "</pre> -->";
foreach ($tags as $tag){
echo "<!-- \n $$tag = ${$tag} \n -->";
}
echo "<!-- all_articles = $all_articles -->";
# get the id of the articles (by "ordering") that are in the "published" state and have the field "xreference" != "".
# UNLESS all_articles = true
$xreference = " AND (a.xreference != '' OR a.featured = TRUE) ";
if ( $all_articles == 1) $xreference = "";
if ($parent_id == 0) {
$query = "SELECT a.catid , a.introtext,a.id, a.state, a.alias as alias, a.fulltext , a.title, a.publish_up, a.publish_down, a.modified, a.created, a.xreference , a.featured,
c.alias as cat_alias ,c.id as cat_id, c.level as level, c.alias as cat_alias ,c.id as cat_id, c.path as path
FROM #__content AS a, #__categories AS c
WHERE a.catid = $cat_id
AND a.catid = c.id
AND a.state = 1
$xreference " ;
}
else {
$query = "SELECT a.catid,a.introtext,a.id, a.fulltext, a.state, a.alias as alias,a.title, a.publish_up, a.publish_down,
a.modified, a.created, a.xreference ,
c.parent_id, c.id as cat_id, c.alias as cat_alias, c.lft, c.level as level,c.path as path
FROM #__content AS a, #__categories AS c
WHERE c.parent_id = $parent_id
AND a.state = 1
AND a.catid = c.id
$xreference " ;
}
$query .= " AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= $now )";
if ($parent_id == 0) {
$query .= " ORDER BY a.ordering ; " ;
}
else {
$query .= " ORDER BY c.lft ASC, a.ordering ;" ;
}
echo "\n<!-- query = $query -->\n";
$db->setQuery( $query );
$this_item = $db->loadObjectList();
$count = count($this_item);
echo "<!-- query - $count items found -->";
#if($count > 0 ) {echo "<!-- first set <br /><pre>";print_r($this_item) ; echo "--></pre>"; }
if ($count > 0 ) {
$temp = '<p class="fwbanner">'.strtoupper($category_name)."</p>";
if ($count == 1 ) $temp = '<p class="fwbanner">'.strtoupper($category_name_one)."</p>";
#echo $temp;
$i = 0;
foreach ( $this_item as $item ){
$link_text = '';
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
$count_fulltext = count($item->fulltext);
$item_id = $item->id;
if ($count_fulltext > 0) {
$link = $item->id. "-" . $item->alias;
echo "\n<!-- \$parent_id = $parent_id and level = {$item->level} -->\n";
if (($parent_id != '') && ($parent_id != 0)) {
if ($item->level == 2 ) {
#echo "<!-- changing the 'alias' to {$item->catid}\n -->";
#$cat_alias = $item->catid ; //if level 3 category then we must insert the catid in the link.
}
}
# if there is something after the introtext, then create the read more link.
if (strlen($item->fulltext) > 10) {
#$link_text = '<p class="readmore"><a href="'.$link_prfx.$cat_alias."/".$link. '">Read more: '. $item->title. '</a></p>';
$link_text = '<p class="readmore"><a href="'.$link_prfx."/".$link. '">Read more: '. $item->title. '</a></p>';
}
}
$fixed = $item->introtext;
/*
$regexp = '/class=(.msonormal.)/i';
$fixed = preg_replace_callback($regexp, function($matches) {return strtolower($matches[0]);}, $fixed);
*/
// better solution to lower casing the class names
$regexp = '/class=(.\w*?.)/i';
$fixed = preg_replace_callback($regexp , function ($matches) { return strtolower($matches[0]); } ,$fixed);
$category_alias = str_replace('/', '_', $this_item[0]->path);
$temp .= '<div class="fp_block '.$category_alias.'" id="'.$category_alias.'-'.$i++.'">'." \n<!-- \$item_id = $item_id \$count_fulltext = $count_fulltext -->\n $fixed $link_text".'</div>';
#echo $item->introtext;
#echo " $link_text " ;
$temp .= '<hr style="margin: 5px 0 10px;" />';
}
#####################################################################
# this is to workaround weird text sizing problem ...
#####################################################################
$temp = preg_replace('/(p class="msonormal" )(style=")(font-size: 11.*?px;")/is', "$1 \"fixed-by-recent-articles-snippet\" $2x$3", $temp );
echo JHtml::_('content.prepare', $temp);
}
?>{/source}