Author Topic: wbstats (original) PHP7 warning  (Read 1307 times)

Offline dbs

  • Betatester
  • **
  • Posts: 7727
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
wbstats (original) PHP7 warning
« on: June 08, 2017, 10:05:52 PM »
Hi, i have this message for wbstats 0.1.9 in WB2.8.3SP7 with PHP 7.0.9
Code: [Select]
[E_WARNING] /framework/class.database.php:[105]  from /modules/wbstats/class.count.php:[98] database->get_one "mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given"
line 98 is:
Code: [Select]
if (!$id = $database->get_one("SELECT `id` from ".$table_pages." WHERE `page`='".$this->page."' AND `day`='".$this->day."'")) {
What should changed?

Offline Ruud

  • Posts: 3647
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: wbstats (original) PHP7 warning
« Reply #1 on: June 08, 2017, 11:09:04 PM »
Can you reproduce this?
Maybe requesting a special page (like search) or page parameters? or does it happen on every page request?

Offline dbs

  • Betatester
  • **
  • Posts: 7727
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: wbstats (original) PHP7 warning
« Reply #2 on: June 09, 2017, 08:19:28 AM »
Can't reproduce it. But saw it on different domains.
Will watch this. No action needed.

Offline jacobi22

  • Posts: 5579
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: wbstats (original) PHP7 warning
« Reply #3 on: June 09, 2017, 10:51:00 AM »
its important for a select like this with get_one(), to get an answer, means: the select has to work in every case. this special select expects a integer value as answer, but get only true or false (boolean). true or false is only possible, if the select breaks, in the most cases, if the table-name is incorrect
maybe a detailed error message (for every select in this part) can help, but difficult, if its not possible, to reproduce it
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline dbs

  • Betatester
  • **
  • Posts: 7727
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: wbstats (original) PHP7 warning
« Reply #4 on: July 10, 2017, 09:16:02 AM »
The error is back. 3 times.
Seems i have it only on one installation 283sp7, PHP7.0.20
But Uwe is right, the check could be changed a little bit.

Offline Ruud

  • Posts: 3647
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: wbstats (original) PHP7 warning
« Reply #5 on: August 09, 2017, 02:40:43 PM »
Released WBstats version 0.1.11 today.
This version should not have this issue anymore.

Download: https://dev4me.com/modules-snippets/opensource/wbstats/

Other extras..
- IP addresses are not logged anymore. This complies with (German) privacy laws.
- Makes use of a new (undocumented) method of referer detection in WB2.10

Offline hgs

  • Betatester
  • **
  • Posts: 1009
    • EFG MG
Re: wbstats (original) PHP7 warning
« Reply #6 on: August 10, 2017, 08:18:40 AM »
Erfolgreich getestet unter WB 2.10 mit php 7.1.6
ohne diesen Eintrag in der config.php
Quote
Referer-Informationen in WB 2.8.3 und neuer
Für die WebsiteBaker Versionen 2.8.3 und neuer ist es notwendig, unten stehene Codezeile in die Datei config.php im WB-Hauptverzeichnis unmittelbar vor dieser Zeile hier einzufügen: require_once(WB_PATH.'/framework/initialize.php');   

$referer = $_SERVER['HTTP_REFERER'];
Vielleicht den Hinweis in der Hilfe noch ändern. Ich weiß nicht ob der Eintrag für WB 2.8.3 benötigt wird

Googletranslate:
Successfully tested under WB 2.10 with php 7.1.6
Without this entry in the config.php
Quote
Referer information in WB 2.8.3 and later
For the WebsiteBaker versions 2.8.3 and later it is necessary to insert the code line below into the config.php file in the WB main directory just before this line: require_once (WB_PATH. '/ Framework / initialize.php');

$ Referer = $ _SERVER ['HTTP_REFERER'];
Perhaps the hint in the help still change. I do not know if the entry for WB 2.8.3 is needed
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

Offline Ruud

  • Posts: 3647
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: wbstats (original) PHP7 warning
« Reply #7 on: August 10, 2017, 10:28:57 AM »
Vielleicht den Hinweis in der Hilfe noch ändern. Ich weiß nicht ob der Eintrag für WB 2.8.3 benötigt wird
...
Perhaps the hint in the help still change. I do not know if the entry for WB 2.8.3 is needed
Good idea, in the next version I will only show this message when 2.8.3 is used.

Offline Tomno399

  • Posts: 211
Re: wbstats (original) PHP7 warning
« Reply #8 on: October 14, 2017, 09:07:24 AM »
Are you sure for the future that referers and keywords will be provided by Google?

Referers and Keywords already are not shown!

Look here: https://www.sistrix.de/news/notprovided-steht-das-ende-der-referrer-keywords-bevor
« Last Edit: October 14, 2017, 09:21:54 AM by Tomno399 »