Add Blog View Count to PHPfox V4

This tip is for adding Blog views and total comments to show in the blog index page and blog view page for PHPfox V4. It should also work in PHPfox V3 but you would need to check for the code in that version. Note that this is a source edit and will be overwritten on upgrades so be sure to keep a copy of your changes as a backup.

Add the phrase for blog.views

AdminCP >> Phrases and click New Phrase (if you don’t see New Phrase button, there is a bug in PHPfox. You’ll need to go to the direct link if using short urls or )
Product: Core
Module: Blog
Varname: views
Text: Views
Click Submit

blog phrase

These are the source edits. We suggest you make a copy of the original file to your computer or keep one of each on the server such as viewbu.html.php so that you have the originals.

To put it on the blog.view page

Open PF.Base/module/blog/template/default/controller/view.html.php
Around line 18 find the following:

change it to:

If you don’t want comments in there, just remove this

blog views

To put it on the blog.index page

Open PF.Base/module/blog/template/default/block/entry.html.php
Around line 47 find the following:

change it to:

blog index

Clear cache after doing the changes.

Content Protection by