This is cool, thanks a ton ganeshXL !
;D
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Hmmm, I must have bogged the copy paste somewhere along the lines, but being close to php illiterate, I don’t see it
With the latest modified version I have :
<?php
if ($handle = opendir('help')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$help[] = $file;
}
}
closedir($handle);
}
natcasesort($help);
foreach($help as $k=>$v) {
$helpname = substr($v, 0, strrpos($v, '.'));
$prefix = substr($helpname, 0, 2);
if(is_numeric($prefix)) {
$helpname = substr($helpname, 2, strlen($helpname)-1 );
}
$helpname = str_replace('_', ' ', $helpname);
}
?>
???
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Dumb me
Thanks Ryan !
Works like a charm
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
This is very cool, but I have one issue. It is creating a tab for .DS_store as well as the files in the help directory. This not really an issue on the live server (in my case) but on a Mac server this could be a hassle. The tab shows up with no name since the $helpname gets the title from before the . but the tab shows up with the content to the DS_Store file.
Is there a way to make sure that it only opens php or html files.