Hello,
I try to add some logs in an external php file.
Example, extraction.php contains :
$logHeader = "{" . time() . ":" . gmdate("D, d M Y H:i") . " GMT}";
debugLog("$logHeader\n? clvs actuelle : $clvsLine");
This php file is in /scripts
zenphoto folder is in /mutimedia
S
This file is called in image.php using the include function after < body >
Maybe extraction.php should start with
But image.php already uses this code !
admin logs page should display my variable !
Thanks in advance.
I have no idea what "extraction.php" is
The proper usages is debuglog($yourmessage, $reset) and/or additional parameters. Time and such is already handled.
https://docs.zenphoto.org/1.6.6/namespaces/default.html#function_debugLog
Maybe extraction.php should start with
That code is to make sure the theme page is accessed in the right context. Include files should not need that. Besides it would not hurt to add it there as well in case someone really accesses that directly. But it will otherwise just fail with errors.
Thank you acrylian, problem solved with your help.
My theme image.php uses this line (example)
include($_SERVER['DOCUMENT_ROOT']) . '/scripts/personal-logs.php';
My personal-logs.php file contains
Zephoto debug log displays my personal logs, I can carry on on a project !
I use php and ajax to dynamicaly change some pictures without reloading special image pages.
Was the trick.
include($_SERVER['DOCUMENT_ROOT']) . '/scripts/personal-logs.php';
So this is outside your install respectively thte theme? Otherwise the our path constants like SERVERPATH should be fitting.
If the file is within your theme's folder you should not need the path and just include 'scripts/personal-logs.php' should work (that's how some themes include header or footer files).
I don't remember when I added it but in 1.6.6 you can also create your own custom log file with debuglog() if necessary. See the arguments on the doc link above.