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)

<<<12