hi there,
in case of debugging an ldap-plugin-tweak (for generating an alias like "username (Surename Gname)" (thanks btw to multitool) i tried to use the fud-forums debugging function wich resulted in headers-allredy-sent errors.
a solution could be a general switch in the general options of FUD-forum to reroute the debugging output to file(s), so the auth-headers created by the ldap plugin can get throu.
i used this to reroute the debugging information... to get logged in again :-S
inserted in forum\index.php
function dbg($dbgstr){
$fh = fopen($GLOBALS['WWW_ROOT_DISK'] .'DEBUGGING/'.str_replace('/','_',$_SERVER['PHP_SELF']), 'a');
@fwrite($fh, "\r\n\r\nldap:dbg ".date("H:i:s").":");
fwrite($fh, $dbgstr);
fclose($fh);
}
and edited the q()-function that prints out the debugging info...
deleting the following...
echo '<hr><b>Query #'. $GLOBALS['__DB_INC_INTERNALS__']['query_count'] .'</b><small>';
echo ': time taken: <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['last_time'], 4) .'</i>';
echo ', affected rows: <i>'. db_affected() .'</i>';
echo ', total sql time: <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['total_sql_time'], 4) .'</i>';
echo '<pre>'. preg_replace('!\s+!', ' ', htmlspecialchars($query)) .'</pre></small>';
inserting the folling instead:
dbg('<hr><b>Query #'. $GLOBALS['__DB_INC_INTERNALS__']['query_count'] .'</b><small>');
dbg(': time taken: <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['last_time'], 4) .'</i>');
dbg(', affected rows: <i>'. db_affected() .'</i>');
dbg(', total sql time: <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['total_sql_time'], 4) .'</i>');
dbg('<pre>'. preg_replace('!\s+!', ' ', htmlspecialchars($query)) .'</pre></small>');
i'll post the tweak for the ldap-plugins ALIAS-enhancement in it's origin thread next time.
can you guide me a little bit
.where to set up the function correctly (as i had to modify the q()-function it in several cached files) and
.how to add a checkbox-field in the general setting for this?
thank you
david