Schönen Tag allerseits,
habe auf Joomla 3 einen Katalog erstellt, der sich mit der Extension DJ-Flyer auch sehr einfach und schnell erstellen läßt.
Nur gibt es ein Problem, daß die Sortierung nur absteigend bzw. noch nach Namen bzw. Random eingestellt werden kann.
Es soll aber der neue einzugenbende Artikel nicht als letzter Artikel aufscheinen sondern als erster.
leider bin ich in PHP nicht versiert deshalb wäre es nett wenn mir hier jemand helfen könnte.
die mod_djflyer sieht so aus:
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once (dirname(__FILE__).DIRECTORY_SEPARATOR.'helper.php');
$document=JFactory::getDocument();
$css = JURI::base().'modules/mod_djflyer/css/djflyer.css';
$document->addStyleSheet($css);
$par = JComponentHelper::getParams('com_djflyer');
if($par->get('responsive_css','1')=='1'){
$css = JURI::base().'modules/mod_djflyer/css/djflyer_responsive.css';
$document->addStyleSheet($css);
}
//$params->def('greeting', 1);
$cats_list = $params->get('djcats');
if(count($cats_list)>0){
$cat_l = implode(',', $cats_list);
$ordering = $params->get('djorder','ordering');
$cats = modDjFlyer::getCategories($cat_l);
$items = modDjFlyer::getItems($cat_l,$ordering);
$user =JFactory::getUser();
require(JModuleHelper::getLayoutPath('mod_djflyer'));
}
?>
dann gibt es noch eine helper.php:
defined('_JEXEC') or die('Restricted access');
class modDjFlyer
{
static function getCategories($ids){
$db= JFactory::getDBO();
$query = "SELECT c.* FROM #__djflyer_categories c WHERE c.id IN (".$ids.") ORDER BY c.ordering";
$db->setQuery($query);
$cats=$db->loadObjectList();
return $cats;
}
static function getItems($ids,$ordering){
$db= JFactory::getDBO();
$ordering = $ordering == "random" ? "RAND()" : "i.".$ordering;
$query = "SELECT i.*, c.name as cat_name, a.alias as a_alias, a.catid as a_catid "
." FROM #__djflyer_categories c, #__djflyer_items i "
."LEFT JOIN #__content a ON i.art_id = a.id "
." WHERE i.published=1 AND i.cat_id = c.id AND i.cat_id IN (".$ids.") ORDER BY ".$ordering;
$db->setQuery($query);
$items=$db->loadObjectList();
return $items;
}
}
über Eure Hilfe würde ich mich freuen
Mike
habe auf Joomla 3 einen Katalog erstellt, der sich mit der Extension DJ-Flyer auch sehr einfach und schnell erstellen läßt.
Nur gibt es ein Problem, daß die Sortierung nur absteigend bzw. noch nach Namen bzw. Random eingestellt werden kann.
Es soll aber der neue einzugenbende Artikel nicht als letzter Artikel aufscheinen sondern als erster.
leider bin ich in PHP nicht versiert deshalb wäre es nett wenn mir hier jemand helfen könnte.
die mod_djflyer sieht so aus:
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once (dirname(__FILE__).DIRECTORY_SEPARATOR.'helper.php');
$document=JFactory::getDocument();
$css = JURI::base().'modules/mod_djflyer/css/djflyer.css';
$document->addStyleSheet($css);
$par = JComponentHelper::getParams('com_djflyer');
if($par->get('responsive_css','1')=='1'){
$css = JURI::base().'modules/mod_djflyer/css/djflyer_responsive.css';
$document->addStyleSheet($css);
}
//$params->def('greeting', 1);
$cats_list = $params->get('djcats');
if(count($cats_list)>0){
$cat_l = implode(',', $cats_list);
$ordering = $params->get('djorder','ordering');
$cats = modDjFlyer::getCategories($cat_l);
$items = modDjFlyer::getItems($cat_l,$ordering);
$user =JFactory::getUser();
require(JModuleHelper::getLayoutPath('mod_djflyer'));
}
?>
dann gibt es noch eine helper.php:
defined('_JEXEC') or die('Restricted access');
class modDjFlyer
{
static function getCategories($ids){
$db= JFactory::getDBO();
$query = "SELECT c.* FROM #__djflyer_categories c WHERE c.id IN (".$ids.") ORDER BY c.ordering";
$db->setQuery($query);
$cats=$db->loadObjectList();
return $cats;
}
static function getItems($ids,$ordering){
$db= JFactory::getDBO();
$ordering = $ordering == "random" ? "RAND()" : "i.".$ordering;
$query = "SELECT i.*, c.name as cat_name, a.alias as a_alias, a.catid as a_catid "
." FROM #__djflyer_categories c, #__djflyer_items i "
."LEFT JOIN #__content a ON i.art_id = a.id "
." WHERE i.published=1 AND i.cat_id = c.id AND i.cat_id IN (".$ids.") ORDER BY ".$ordering;
$db->setQuery($query);
$items=$db->loadObjectList();
return $items;
}
}
über Eure Hilfe würde ich mich freuen
Mike