str_replace and filemanager

There are no error, table not modified. I do it for all other page like additionnal_domains.html, du_breakdown.html and all other, and my script work perfectly (my script modify skin of table, just adding class to <tr>), but not for all page in filemanager directory.
 
And who would ever be able to give you any help, if we don't even see your code. Without that I just can say:

Make sure, you've got right syntax, and no PHP error occurs.
 
I say code work fine for all other page and it's the same :p so there are no error in code :p I think all page in filemanager are chrooted so php not working (I think I see somethink like this somewhere).

but if you want see my code is here :

|$/usr/local/bin/php
<?php
$data = <<<END
|DATABASES|
END;
$data = str_replace("class=list2>", "class=list>", $data);
$data = str_replace("class=list2 ", "class=list ", $data);
$data = str_replace("<tr ><td class=list>", "<tr class=trlist><td class=list>", $data);
$data = str_replace("class=list>", ">", $data);
$data = str_replace("class=list ", "", $data);
$data = str_replace("class=listwrap>", ">", $data);
$data = str_replace("class=listwrap2>", ">", $data);
$data = str_replace("<tr ><td colspan=", "<tr class=trlist><td colspan=", $data);
echo $data;
?>
DONE|

It's an exemple, I modify string for each page but structure are same
 
Last edited:
OK, as it is seems to me, in /usr/local/directadmin/data/skins/enhanced/user/filemanager/main.html this token |DIRECTORYLIST| is not parsed directly, so if you try to

PHP:
|$/usr/local/bin/php
<?php
$data = <<<END
|DIRECTORYLIST|
END;
echo $data;
?>
DONE|

The PHP code will print |DIRECTORYLIST|, you can check it with this

PHP:
|$/usr/local/bin/php
<?php
$data = <<<END
|DIRECTORYLIST|
END;
echo strlen($data);
?>
DONE|


And you will see 15 as an output, as it is the length of the token with both |.

So you might need to try your luck with JavaScripts.
 
You might want to post a feature request in a proper sub-forum, as I personally do not see any other solution, but maybe somebody else does.
 
Back
Top