The reason why I was questioning the file path, was because of the warning
Warning: fileperms() [function.fileperms]: stat failed for templates in /home/u306055928/public_html/admin/test.php on line 117
You are executing your script in the /admin/ folder, and the file/folder it is looking for is 'templates'. It will be looking at /admin/templates/ because of the execution location. If it wanted the root /templates/ folder, it should have been looking at ../templates/
Is there a templates folder in the admin area? And what are its permissions set to?