affichage des articles d'une catégorie selon les votes [Intégré]
Propriétaire | Christian |
Avancement | |
Workflow | Besoin d'aide |
Statut | La solution a été intégrée |
Si on choisit d'ordonner les pages d'une catégorie selon les votes (digg) le tri n'est pas pris en compte (mais ca date de longtemps )
normal il n'y a pas de fonction pour ce tri dans shared/members.
Il faudrait donc la créer juste ne changeant le order by :
Members::list_articles_by_rating_for_anchor($anchor, $offset, $count, $variant);
puis dans categories/view.php on appelle la fonction de tri du layout
// sort and list articles
$offset = ($zoom_index - 1) * $items_per_page;
if(preg_match('/\barticles_by_([a-z_]+)\b/i', $item['options'], $matches))
$order = $matches[1];
elseif(is_callable(array($layout, 'items_order')))
$order = $layout->items_order();
else
$order = 'edition';
// list items by date (default) or by title (option 'articles_by_title')
$offset = ($zoom_index - 1) * ARTICLES_PER_PAGE;
if(isset($order) && preg_match('/\brating\b/i', $order))
$items =& Members::list_articles_by_rating_for_anchor('category:'.$item['id'], $offset, ARTICLES_PER_PAGE, $layout_articles);
elseif(isset($item['options']) && preg_match('/\barticles_by_title\b/i', $item['options']))
$items =& Members::list_articles_by_title_for_anchor('category:'.$item['id'], $offset, ARTICLES_PER_PAGE, $layout_articles);
else
$items =& Members::list_articles_by_date_for_anchor('category:'.$item['id'], $offset, ARTICLES_PER_PAGE, $layout_articles);
Christian | ----- Actupro quelques sites yacs : création site internet annuaire pro |
Alexis Raimbault | |
Alexis Raimbault | |
Alexis Raimbault | ----- Alexis Raimbault webmaster free-lance |
Alexis Raimbault | ----- Alexis Raimbault webmaster free-lance |