Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Extensions / PageList

<<<12

Very useful plugin with many with great potential

foxhound
#16 2014-01-17 21:53

Ok, thanks for confirming that Kort. Than I will have to adjust my idea a bit ;)

Added 1 year later:

Currently I am trying to add the ratings to the pagelist plugin. I am doing that cause I want to be able to sort pages in a nice list on its rating.
I think I am nearly there cause all tags are already available (which I can see by using ?tpl_debug=1) but the plugin is currently showing an error.
But first let me show what I did:
I have copied the pagelist.comments.loop and changed it to the following: 

<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=pagelist.loop
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

global $cfg;

if ($cfg['plugin']['pagelist']['ratings'] && cot_plugin_active('ratings'))
{
	$rowe_urlp = empty($row['page_alias']) ? array('c' => $row['page_cat'], 'id' => $row['page_id']) : array('c' => $row['page_cat'], 'al' => $row['page_alias']);
	$t->assign(array(
		'PAGE_ROW_RATINGS' => cot_ratings_display('page', $rowe_urlp, 'page', $row['page_id'], $c, $row),
		'PAGE_ROW_RATINGS_AVARAGE' => cot_ratings_display('page', $row['page_id'], $row)
	));
}

?>

I named it pagelist.ratings.loop.php.

Than I copied the 
pagelist.comments.query and changed it to the following: 

<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=pagelist.query
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

global $cfg;

if ($cfg['plugin']['pagelist']['ratings'] && cot_plugin_active('ratings'))
{
	global $db_ratings;

	require_once cot_incfile('ratings', 'plug');

	$cns_join_columns .= ", (SELECT COUNT(*) FROM `$db_ratings` WHERE rating_area = 'page' AND rating_code = p.page_id) AS rating_average";
}

?>

I named this pagelist.ratings.query.php.


I am sure I did something wrong but not sure what cause now I get this error:
D:\Dropbox\Xampp\htdocs\new_armaholic\plugins\ratings\inc\ratings.functions.php on line 196

I am not sure if the joincolums SQL is correct or maybe the error is somewhere else and hope someone here can help me to get this working.


This post was edited by foxhound (2015-06-08 12:54, 1 year ago)
Anonymous
#17 2017-01-26 02:11
$pagination - имя параметра паджинации (опционально, например pld – убедитесь в отсутствии конфликтов одинаковых имен!)

Если ставлю FALSE или оставляю параметр пустым то паджинация работает не корректно. Перечень с номерами страниц не перелистываются при переходе на следующую страницу. На старой "сборке" такого нет.

Kort
#18 2017-01-27 08:54

Как именно вызывается функция? Только что проверял:

{PHP|pagelist('pagelist', 10, '', '', 'articles')}

и

{PHP|pagelist('pagelist', 10, '', '', 'articles', '', '', true, 'ppp')}

И там и там паджинация работает, тестировал и с главной и с внутряков. В первом случае ссылки паджинации дефолтные http://site.by/?pld=5, во втором пользовательские: http://site.by/about?ppp=2

Seditio.by - создание сайтов, разработка плагинов и тем для Котонти

This post was edited by Kort (2017-01-27 13:24, 4 weeks ago)

<<<12