summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-14 09:52:56 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-14 09:52:56 +0100
commit8f4f17a1f154889b70509d051cf102bd93bed892 (patch)
treef41c02abf02f42790be2c9c56acbb228dc380eca /includes
parent457ba69e560f940ebf6109064ed6c5de87515ffa (diff)
downloadstats-8f4f17a1f154889b70509d051cf102bd93bed892.tar.gz
stats-8f4f17a1f154889b70509d051cf102bd93bed892.tar.bz2
stats-8f4f17a1f154889b70509d051cf102bd93bed892.zip
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/bit_setup_inc.php10
-rw-r--r--includes/classes/Statistics.php10
2 files changed, 10 insertions, 10 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index deb36b1..4026cbe 100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -1,6 +1,6 @@
<?php
namespace Bitweaver\Stats;
-use Bitweaver\Stats\Statistics;
+
use Bitweaver\KernelTools;
global $gBitSystem, $gBitUser ;
@@ -14,9 +14,9 @@ $pRegisterHash = [
define( 'STATS_PKG_NAME', $pRegisterHash['package_name'] );
define( 'STATS_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
define( 'STATS_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
-define( 'STATS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+define( 'STATS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
define( 'STATS_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
-define( 'STATS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+define( 'STATS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
$gBitSystem->registerPackage( $pRegisterHash );
@@ -42,7 +42,7 @@ if( $gBitSystem->isPackageActive( 'stats' )) {
}
if( !$gBitUser->isRegistered() && !empty( $_SERVER['HTTP_REFERER'] ) && strlen( $_SERVER['HTTP_REFERER'] ) > 9 ) {
- // Explode the HTTP_REFERER address to split up the string
+ // Explode the HTTP_REFERER address to split up the string
if( $ref = explode('/', $_SERVER['HTTP_REFERER']) ) {
if( count( $ref ) > 1 && $ref[2] != $_SERVER['HTTP_HOST'] ) {
// we have a standard refering URL
@@ -66,7 +66,7 @@ if( $gBitSystem->isPackageActive( 'stats' )) {
$pObject->CompleteTrans();
}
}
-
+
function stats_user_register( &$pObject ) {
if( !empty( $_COOKIE['referer_url'] ) && is_a( $pObject, 'BitUser' ) && !empty( $pObject->mUserId ) ) {
$pObject->StartTrans();
diff --git a/includes/classes/Statistics.php b/includes/classes/Statistics.php
index 1deb893..0fe0e34 100644
--- a/includes/classes/Statistics.php
+++ b/includes/classes/Statistics.php
@@ -11,11 +11,11 @@
* @subpackage Stats
**/
namespace Bitweaver\Stats;
+
use Bitweaver\BitBase;
use Bitweaver\Liberty\LibertyContent;
use Bitweaver\BitDb;
-
class Statistics extends BitBase {
/**
@@ -206,9 +206,9 @@ class Statistics extends BitBase {
$ret["pageviews"] = $this->mDb->getOne( "SELECT SUM(`pageviews`) FROM `".BIT_DB_PREFIX."stats_pageviews`" );
$ret["ppd"] = $ret["days"] ? $ret["pageviews"] / $ret["days"] : 0;
$ret["bestpvs"] = $this->mDb->getOne( "SELECT MAX(`pageviews`) FROM `".BIT_DB_PREFIX."stats_pageviews`" );
- $ret["bestday"] = $this->mDb->getOne( "SELECT `stats_day` FROM `".BIT_DB_PREFIX."stats_pageviews` WHERE `pageviews`=?",array( (int)$ret["bestpvs"] ));
+ $ret["bestday"] = $this->mDb->getOne( "SELECT `stats_day` FROM `".BIT_DB_PREFIX."stats_pageviews` WHERE `pageviews`=?",[ (int)$ret["bestpvs"] ]);
$ret["worstpvs"] = $this->mDb->getOne( "SELECT MIN(`pageviews`) FROM `".BIT_DB_PREFIX."stats_pageviews`" );
- $ret["worstday"] = $this->mDb->getOne( "SELECT `stats_day` FROM `".BIT_DB_PREFIX."stats_pageviews` WHERE `pageviews`=?",array( (int)$ret["worstpvs"] ));
+ $ret["worstday"] = $this->mDb->getOne( "SELECT `stats_day` FROM `".BIT_DB_PREFIX."stats_pageviews` WHERE `pageviews`=?",[ (int)$ret["worstpvs"] ]);
return $ret;
}
@@ -268,7 +268,7 @@ class Statistics extends BitBase {
if( $pDays != 0 ) $dfrom = $now - $pDays * 24 * 60 * 60;
$query = "SELECT `stats_day`, `pageviews` FROM `".BIT_DB_PREFIX."stats_pageviews` WHERE `stats_day`<=? AND `stats_day`>=? ORDER BY `stats_day` ASC";
- $result = $this->mDb->query( $query,array( ( int )$now, ( int )$dfrom ));
+ $result = $this->mDb->query( $query,[ ( int )$now, ( int )$dfrom ]);
$ret = [];
$n = ceil( $result->numRows() / 20 );
$i = 0;
@@ -304,7 +304,7 @@ class Statistics extends BitBase {
FROM `".BIT_DB_PREFIX."liberty_content` lc
LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_content_hits` liberty_content_hits
ON (lc.`content_id` = liberty_content_hits.`content_id`)
- WHERE content_type_guid=?", [ $guid ]
+ WHERE content_type_guid=?", [ $guid ],
);
if( !empty( $hits )) {
$ret['legend'][] = $gLibertySystem->getContentTypeName( $guid );