Build customized page list widgets
| foxhound |
|
|---|---|
|
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.
<?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.
<?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. <img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Відредаговано: foxhound (08.06.2015 12:54, 10 років тому) |