flatpressblog / flatpress

FlatPress is a lightweight, easy-to-set-up flat-file blogging engine.
https://flatpress.org
GNU General Public License v2.0
185 stars 57 forks source link

PostViews plugin counts and does not show comment views #182

Closed Fraenkiman closed 7 months ago

Fraenkiman commented 1 year ago

Hello all,

the PostViews plugin counts/- does not show visitor comment views.

PostViews-Plugin

Please add it to the milestone

Best regards Frank

Fraenkiman commented 1 year ago

Other findings discussed here.

Thought: check /fp-includes/core/core.fpdb.class.php regarding $q = $fpdb->getQuery(); $calc = $q->single;

Fraenkiman commented 9 months ago

When using PHP8.1 the following warning is stored in Serverlog:

Warning: Attempt to read property "single" on null in /var/www/html/flatpress-master-1106/fp-plugins/postviews/plugin.postviews.php on line 43

azett commented 7 months ago

Current status:

Needs further investigation!

Fraenkiman commented 7 months ago

Hi @azett,

as in most tricky cases, I can only shoot in the dark. My number of hairs on my head are not enough for a solid solution. We may need a new FP smarty plugin/smarty function that assigns the {$views} variable correctly.

these are my notes:

//core.fpdb.class.php
// do_action('entry_block', $id);

//Smarty 4
// $_FP_SMARTY->registerPlugin('block', 'entry_block', 'smarty_block_entries');

//Smarty 2
// $_FP_SMARTY->register_block('entry_block', 'smarty_block_entries');
function smarty_function_entry_block($params, &$smarty)
{
 return do_action('entry_block');
}

Best regards