--- mambo/trunk/components/com_content/content.php 2005/12/13 03:45:47 1 +++ mambo/branches/4.6/components/com_content/content.php 2006/07/18 12:18:02 609 @@ -1,17 +1,20 @@ getPath( 'front_html', 'com_content' ) ); +require_once($mainframe->getPath('class')); $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); $sectionid = intval( mosGetParam( $_REQUEST, 'sectionid', 0 ) ); @@ -166,8 +169,9 @@ . "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )" . "\n ORDER BY ". $order_pri . $order_sec ; - $database->setQuery( $query ); - $rows = $database->loadObjectList(); +// $database->setQuery( $query ); +// $rows = $database->loadObjectList(); + $rows = $database->doSQLget($query, 'mosExtendedContent'); // Dynamic Page Title $mainframe->SetPageTitle( $menu->name ); @@ -203,6 +207,8 @@ $params->def( 'empty_cat', 0 ); $params->def( 'cat_items', 1 ); $params->def( 'cat_description', 1 ); + $params->def( 'description', 1 ); + $params->def( 'description-image', 1 ); $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); $params->def( 'pageclass_sfx', '' ); @@ -302,6 +308,8 @@ $params->def( 'empty_cat', 0 ); $params->def( 'cat_items', 1 ); $params->def( 'cat_description', 0 ); + $params->def( 'description', 1 ); + $params->def( 'description-image', 1 ); $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); $params->def( 'pageclass_sfx', '' ); $params->def( 'headings', 1 ); @@ -319,6 +327,9 @@ $sectionid = $category->section; } + $pathway =& mosPathway::getInstance(); + $pathway->addItem($category->title, categoryURL($sectionid, $id)); + if ( $access->canEdit ) { $xwhere = ''; $xwhere2 = "\n AND b.state >= '0'"; @@ -360,20 +371,20 @@ // get the total number of published items in the category // filter functionality - $filter = trim( mosGetParam( $_POST, 'filter', '' ) ); - $filter = strtolower( $filter ); - $and = ''; - if ( $filter ) { + $_and = ''; + if ($filter = mosGetParam($_POST, 'filter', '')) { + $filter = strtolower( $filter ); + $filter = $database->getEscaped($filter); if ( $params->get( 'filter' ) ) { switch ( $params->get( 'filter_type' ) ) { case 'title': - $and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; + $_and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; break; case 'author': - $and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; + $_and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; break; case 'hits': - $and = "\n AND a.hits LIKE '%". $filter ."%'"; + $_and = "\n AND a.hits LIKE '%". $filter ."%'"; break; } } @@ -396,7 +407,7 @@ . "\n WHERE a.catid='". $category->id ."' ". $xwhere . ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) . "\n AND '". $category->access ."'<='". $gid ."'" - . $and + . $_and . "\n ORDER BY ". $orderby ."" ; $database->setQuery( $query ); @@ -416,7 +427,7 @@ . "\n WHERE a.catid='". $category->id ."' ". $xwhere . ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) . "\n AND '". $category->access ."'<='". $gid ."'" - . $and + . $_and . "\n ORDER BY ". $orderby ."" . "\n LIMIT ". $limitstart .", ". $limit ; @@ -425,26 +436,26 @@ $check = 0; if ( $params->get( 'date' ) ) { - $order[] = mosHTML::makeOption( 'date', _ORDER_DROPDOWN_DA ); - $order[] = mosHTML::makeOption( 'rdate', _ORDER_DROPDOWN_DD ); + $order[] = mosHTML::makeOption( 'date', T_('Date Asc') ); + $order[] = mosHTML::makeOption( 'rdate', T_('Date Desc')); $check .= 1; } if ( $params->get( 'title' ) ) { - $order[] = mosHTML::makeOption( 'alpha', _ORDER_DROPDOWN_TA ); - $order[] = mosHTML::makeOption( 'ralpha', _ORDER_DROPDOWN_TD ); + $order[] = mosHTML::makeOption( 'alpha', T_('Title Asc') ); + $order[] = mosHTML::makeOption( 'ralpha', T_('Title Desc') ); $check .= 1; } if ( $params->get( 'hits' ) ) { - $order[] = mosHTML::makeOption( 'hits', _ORDER_DROPDOWN_HA ); - $order[] = mosHTML::makeOption( 'rhits', _ORDER_DROPDOWN_HD ); + $order[] = mosHTML::makeOption( 'hits', T_('Hits Asc') ); + $order[] = mosHTML::makeOption( 'rhits', T_('Hits Desc') ); $check .= 1; } if ( $params->get( 'author' ) ) { - $order[] = mosHTML::makeOption( 'author', _ORDER_DROPDOWN_AUA ); - $order[] = mosHTML::makeOption( 'rauthor', _ORDER_DROPDOWN_AUD ); + $order[] = mosHTML::makeOption( 'author', T_('Author Asc') ); + $order[] = mosHTML::makeOption( 'rauthor', T_('Author Desc') ); $check .= 1; } - $order[] = mosHTML::makeOption( 'order', _ORDER_DROPDOWN_O ); + $order[] = mosHTML::makeOption( 'order', T_('Ordering') ); $lists['order'] = mosHTML::selectList( $order, 'order', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $selected ); if ( $check < 1 ) { $lists['order'] = ''; @@ -502,9 +513,10 @@ . "\n AND s.access<=$gid" . "\n ORDER BY ". $order_pri . $order_sec ; - $database->setQuery( $query ); - $rows = $database->loadObjectList(); - +// $database->setQuery( $query ); +// $rows = $database->loadObjectList(); + $rows = $database->doSQLget($query, 'mosExtendedContent'); + // Dynamic Page Title if ($menu) { $mainframe->setPageTitle( $menu->name ); @@ -554,8 +566,9 @@ . "\n AND s.access <= ". $gid . "\n ORDER BY ". $order_pri . $order_sec; ; - $database->setQuery( $query ); - $rows = $database->loadObjectList(); +// $database->setQuery( $query ); +// $rows = $database->loadObjectList(); + $rows = $database->doSQLget($query, 'mosExtendedContent'); // Dynamic Page Title $mainframe->SetPageTitle( $menu->name ); @@ -624,8 +637,9 @@ . "\n AND s.access <= ". $gid . "\n ORDER BY ". $order_pri . $order_sec ; - $database->setQuery( $query ); - $rows = $database->loadObjectList(); +// $database->setQuery( $query ); +// $rows = $database->loadObjectList(); + $rows = $database->doSQLget($query, 'mosExtendedContent'); // initiate form echo '