I think that adding this line
PHP Code:
$folder = substr($filename, 0, $pos);
right above this line
PHP Code:
$filename = substr($filename, $pos+1);
Should give you the full path (only folders) to the file.
Then you can use $folder for some if statements inside this:
PHP Code:
case 'index.php':
$userinfo[activity] = 'index';
break;
i.e:
PHP Code:
case 'index.php':
if (strstr ($folder, "math")) {
$userinfo[activity] = 'math';
} elseif (strstr ($folder, "english")) {
$userinfo[activity] = 'english';
} else {
$userinfo[activity] = 'index';
}
break;
I think that will work.