doc:tips:entry_views_in_the_lastentries_plugin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
doc:tips:entry_views_in_the_lastentries_plugin [2023/02/23 00:52] โ€“ created fraenkimandoc:tips:entry_views_in_the_lastentries_plugin [2023/02/26 01:42] (current) โ€“ Headline style changed fraenkiman
Line 1: Line 1:
-====== Adding the number of views to the FlatPress LastEntries plugin ====== +===== Adding the number of views to the FlatPress LastEntries plugin =====
  
 Taken over from [[https://www.igorkromin.net | Igor Kromin]] Taken over from [[https://www.igorkromin.net | Igor Kromin]]
  
-===== Description =====+==== Description ====
 This tutorial shows you how to use the LastEntries plugin and the PostViews plugin to see at a glance how many views the entries have had. This tutorial shows you how to use the LastEntries plugin and the PostViews plugin to see at a glance how many views the entries have had.
 This hack requires the PostViews plugin to be enabled. This hack requires the PostViews plugin to be enabled.
  
-===== Procedure =====+==== Procedure ====
 Changed the file //[[https://github.com/flatpressblog/flatpress/blob/master/fp-plugins/lastentries/plugin.lastentries.php | fp-plugins/lastentries/plugin.lastentries.php]]// as follows: Changed the file //[[https://github.com/flatpressblog/flatpress/blob/master/fp-plugins/lastentries/plugin.lastentries.php | fp-plugins/lastentries/plugin.lastentries.php]]// as follows:
 +
 Note that the first and last lines shown here are already in the file, so only the lines between the comments are relevant: Note that the first and last lines shown here are already in the file, so only the lines between the comments are relevant:
 <code php> <code php>
Line 16: Line 17:
  $dir = entry_dir($id);  $dir = entry_dir($id);
  if (!$dir) return;  if (!$dir) return;
- $f = $dir . '/view_counter' .EXT;+ $f = $dir . '/view_counter' . EXT;
  $v = io_load_file($f);  $v = io_load_file($f);
  if ($v === false){  if ($v === false){
doc/tips/entry_views_in_the_lastentries_plugin.1677109973.txt.gz ยท Last modified: by fraenkiman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki