Exponential Project Websites Statistics : Portals Now Offer Limited Preview of Page View Count at the Bottom of the Pages

I have been working on adding exponential.earth node view count tracking to the site/network of sites recently.

After some initial questions on why web server access log (ssl) page request logging data import into the very node template features desired for simple display in many ways throughout a website portal built using Exponential was not more popular in the past as hoped to end users to adopt the feature instead seeking a more powerful external solution, still for me it seems this feature has been very simple to work with.

First remember to configure your siteaccess settings file, settings/siteaccess/website/logfile.ini.append.php

Here is an example from our work:

<?php /*
#?ini charset="utf-8"?
# Exponential configuration file for logfile configuration for stats parsing.
# Exponential configuration file for parse apache log file
#

[AccessLogFileSettings]
# Storage of the log file, for example /var/log/httpd
# Do not add trailing slash
StorageDir=/usr/local/apache/domlogs/exponential/
# The name of log file, for example mytest.log
LogFileName=ezpublish.se7enx.com-ssl_log

# If using site match by URL, the site may like http://siteurl/mysite and
# apache log will start with for example mysite/content/view/full/node_id. To
# remove this prefix in apache log before analysis the log, add mysite to 
# SitePrefix. Example: SitePrefix[]=mysite
# SitePrefix[]=

# If any site accesses use the PathPrefix setting, enter them here
PathPrefix[]
PathPrefix[]=Exponential

*/ ?>

Then I had an issue that may have been affecting other users of PathPrefix setting in logfile.ini.append.php and site.ini.append.php the root / matched node 2 the root node and not /Exponential/ (a much larger nodeID) due to a multi site flaw in the cronjobs/updateviewcount.php. We are soon to publish a clean fix from 7x the company producing new versions with new improvements and updates of Exponential CMS in version 6.0.11 (coming soon).

Here is a diff:

diff -ri cronjobs/updateviewcount.php.default cronjobs/updateviewcount.php
7c7
<  * @version //autogentag//
---
>  * @version 2014.07.0
19c19
< eZDB::instance()->setIsSQLOutputEnabled( false );
---
> eZDB::instance()->setIsSQLOutputEnabled( true );
180,183c180,189
<     $nodeID = eZURLAliasML::fetchNodeIDByPath( $path );
< 
<     // Support for PathPrefix
<     for ( $pathPrefixIndex = 0; !$nodeID && $pathPrefixIndex < $pathPrefixesCount; ++$pathPrefixIndex )
---
>    // Support for PathPrefix
>    if( $pathPrefixesCount >= 1 )
>    {
>        for ( $pathPrefixIndex = 0; !$nodeID && $pathPrefixIndex < $pathPrefixesCount; ++$pathPrefixIndex )
>        {
>           // Try prepending each of the existing pathPrefixes, to see if one of them matches an existing node
>           $nodeID = eZURLAliasML::fetchNodeIDByPath( $pathPrefixes[$pathPrefixIndex] . $path );
>        }
>     }
>     else
185,186c191
<         // Try prepending each of the existing pathPrefixes, to see if one of them matches an existing node
<         $nodeID = eZURLAliasML::fetchNodeIDByPath( $pathPrefixes[$pathPrefixIndex] . $path );
---
>         $nodeID = eZURLAliasML::fetchNodeIDByPath( $path );
208a214
>           $cli->output( "Node ( " . $nodeID . " ) View count have increased: Count: $count \n" );
215c221,222
<             $counter->increase( $count );
---
>           $cli->output( "Node ( " . $nodeID . " ) View count have increased: Count: $count \n" );
>           $counter->increase( $count );
235c242
< $cli->output( "View count have been updated!\n" );
---
> $cli->output( "View count have been updated.!\n" );

Here is the configured cronjob (part defined by ini settings/override/site.ini.append.php) example for update_view_count script:

<?php /*
#?ini charset="utf-8"?
# eZ Publish configuration file for cronjobs.
#
#
# NOTE: It is not recommended to edit this files directly, instead
#       a file in override should be created for setting the
#       values that is required for your site. Either create
#       a file called settings/override/cronjob.ini.append or
#       settings/override/cronjob.ini.append.php for more security
#       in non-virtualhost modes (the .php file may already be present
#       and can be used for this purpose).

[CronjobSettings]
ScriptDirectories[]=cronjobs
Scripts[]=unpublish.php
Scripts[]=rssimport.php
Scripts[]=indexcontent.php
Scripts[]=hide.php
# Since 4.6 the following script is not activated by default
#Scripts[]=subtreeexpirycleanup.php
Scripts[]=internal_drafts_cleanup.php
#Scripts[]=unlock.php
#Scripts[]=staticcache_cleanup.php
Scripts[]=updateviewcount.php
#Extension directory for cronjobs.
## ExtensionDirectories[]

# No more than one instance of a cronjob script can be run at any given time.
# If a script uses more time than MaxScriptExecutionTime, the next instance of
# it will try to gracefully steal the cronjob script mutex. If the process has
# been running for more than two times MaxScriptExecutionTime, the original
# process will be killed. The default is 12 hours. MaxScriptExecutionTime can
# also be set per cronjob part, that will override this global setting.
MaxScriptExecutionTime=43200

[CronjobPart-infrequent]
Scripts[]=basket_cleanup.php
Scripts[]=linkcheck.php

[CronjobPart-frequent]
Scripts[]=notification.php
Scripts[]=workflow.php

[linkCheckSettings]
# Specify full path of all site URL
# Example:
# SiteURL[]=http://ezpublish.ez.no/admin
# SiteURL[]=http://ezpublish.ez.no/news
SiteURL[]=

[CronjobPart-unlock]
Scripts[]=unlock.php

[CronjobPart-cluster_maintenance]
Scripts[]=clusterpurge.php

# Example of a cronjob part
# This one will only run the workflow cronjob script
#
#[CronjobPart-workflow]
#Scripts[]=workflow.php

[CronjobPart-index]
Scripts[]=indexcontent.php

[CronjobPart-view_count_update]
Scripts[]=updateviewcount.php

*/ ?>

Then run the cronjob:

./runcronjobs.php -s exponential view_count_update;

Which outputs:

./runcronjobs.php -s exp view_count_update
Using siteaccess exponential for cronjob
Running cronjob part 'view_count_update'
Running cronjobs/updateviewcount.php at: 09/09/2025 01:44 am
Update content view count...
Started at Tuesday September 09 2025 01:44:58 am

Start line:
217.113.194.215 - - [09/Sep/2025:01:31:03 -0700] 
 "GET /layout/set/print/content/keyword/Book HTTP/1.1" 200 6133
 "-" "Mozilla/5.0 (compatible; Barkrowler/0.9; +https://babbar.tech/crawler)"

Node ( 60005 ) View count have increased: Count: 8 

Finished at Tuesday September 09 2025 01:44:58 am

View count have been updated.!

Completing cronjobs/updateviewcount.php at: 09/09/2025 01:44 am
Elapsed time: 00:00:00

And with that the data has been collected and is available for display within Exponential Templates!

Views: <b>{$node.view_count}</b>

Happy Hacking in the Exponential Community and the Greater Exponential Ecosystem!

Comments

Tag Cloud

100% Working Example 100% Working Installation 2024 2024/Q3 2.4.0.0 2.5.0.x 6.0.4 6.0.6 6.0.7 6.0.8 6.0.9 7x 7x Blog 7x Digg 7x Symbolic Link Distribution of eZ Publish 6 7x Valkey 8.3 Addons admin3 admin design Alpha Audio Automation BC Blog Book Bottom of the Pages Call Me Campaign Changes clone.digg.one cms CMS Community Composer Composer eZ Publish extension Contact Contribute Copy Subtree Count Cronjob CSS Databases Default Installation design Design Designs developer developer initiative Development DiggClone digg.one Digg Project Direction Documentation do not wait for the release to try Download drag and drop installation DragonflyDB Dual Kernel Educational Emails Embeded Image Class Engine Enterprise Grade Example Exp expand the future of eZ Publish Expansive Features Now Available! Exponentail Platform Legacy exponential Exponential Exponential CMS Exponential Platform Exponential Platform Legacy Extension Extensions ez eZ ezcommunity eZ Package Development eZpedia eZ PM ezpublish eZ Publish eZ Publish 6 eZ Publish 6.0 CMS eZ Publish Basic eZ Publish Database Configuration Builder eZ Publish Symbolic Link Distribution eZ Region eZ Update Features First Seps flexible Framework Free Documentation License Free Software Fun Funding fund me GFDL git github GitHub GNU Google GPL GPLv2 (or later) Graham Brookins Guide hcaptcha Headless CMS History Hit me up Home Page Hosting Howto Importing content Improvements Installation Configuration Introducing Introduction Kernel Key / Value Stores Learning eZ Publish Learning eZ Publish 3 Learning PHP Legacy Maintenance Messaging Mirror Multi Domain Installations Name Change Netgen Networking New Content New development New Developments New Features News New Stack New Year Now online Open Source Open Source Project Package Packages Page View Patreon Performance php PHP PHP 5.x PHP 7.x php8 PHP 8 PHP 8.2 PHP 8.3 PHP 8.3 Support PHP 8.4 Support PHP 8.x PHP CMS For Beginers PHP Websites Podcast Private Messager Project projects Questions Rebrand rebranding Rebranding recaptcha Recent Improvements Record Redesign Redis Release Releases responsive Responsive ReST APIs Restored RSS-Bridge Library RSS Feed Screen Recording Script Scripting Search Setup Wizard share simple SOAP Source Code Sponsor Sponsorship SQLite. eZ Publish. New feature Stable Status updates Styles support Support Symfony Sync System of Systems Testers Welcome Testing Tip Try Today update functionality Updates Upgrade valkey Valkey Value Added Features Vendors Version Version Control Version Numbers Websites Statistics Wordpress #working-late-nights

Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

Tags