Member
Member
ctdlg   06-05-2025, 16:45
#1

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.

Administrator
Administrator
acrylian   07-05-2025, 06:39
#2

I have no idea what "extraction.php" is

The proper usages is debuglog(&#36;yourmessage, &#36;reset) and/or additional parameters. Time and such is already handled.
https://docs.zenphoto.org/1.6.6/namespaces/default.html#function_debugLog

Administrator
Administrator
acrylian   07-05-2025, 06:40
#3

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.

Member
Member
ctdlg   07-05-2025, 17:52
#4

Thank you acrylian, problem solved with your help.

My theme image.php uses this line (example)
include(&#36;_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.

Administrator
Administrator
acrylian   07-05-2025, 18:06
#5

include(&#36;_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.

Member
Member
ctdlg   08-05-2025, 06:13
#6

Yes,
/scripts -> my scripts
/multimedia -> zenphoto
/multimedia/themes/ctdlg ->my zenphoto theme folder.

I will upgrade from 1.6.5 to 1.6.6 very soon, and, of course, test your new custom log file option !!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.