Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Ajax File Tree

  1. #1
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts

    Ajax File Tree

    Hi I would like to have a file tree that displays directory's on my web server, so I found this guy out there on the net.

    http://abeautifulsite.net/notebook.php?article=58

    It comes with jquery and jquery.easing scripts for directory open and close effects and also comes with pre-made server side connector scripts so you can use your server-side language of choice.

    The problem how ever is after I try and run the script on my web server with the connector being PHP for my server side language (appache2.2/PHP5/MySQL5) it never works.

    I get a PHP error:
    Undefined variable: root on line 21
    Has anyone ever gotten this script to work before and or knows what the problem with it is?

    Thanks.

  • #2
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    i use his php file tree in a number of places. i don't use the jquery version because i run prototype and don't feel like sorting out misc conflicts between frameworks.

    the guy has some nice stuff, i gotta say. works great.



    anyway, it sounds like you don't have your root folder set up correctly.

  • Users who have thanked ohgod for this post:

    ubh (09-07-2008)

  • #3
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts
    Hi ohgod,

    Here is my code on the client side.
    Code:
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
    <title>Untitled Document</title>
    		<script src='jquery.js' type='text/javascript'></script>
    		<script src='jquery.easing.js' type='text/javascript'></script>
    		<script src='jqueryFileTree.js' type='text/javascript'></script>
    		<link href='jqueryFileTree.css' rel='stylesheet' type='text/css' media='screen'>
    <script type='text/javascript'>
    			$(document).ready
    			( 
    			function() 
    			{
    				
    
    				$('#fileTreeDemo_3').fileTree
    				(
    						{ 
    						root: '/demo/', 
    						script: 'http://localhost/application/scripts/fileTree/connectors/jqueryFileTree.php', 
    						folderEvent: 'click', 
    						expandSpeed: 750, 
    						collapseSpeed: 750, 
    						expandEasing: 'easeOutBounce', 
    						collapseEasing: 'easeOutBounce', 
    						loadMessage: 'Un momento...' 
    						},
    				function(file)
    						{ 
    							alert(file);
    						}
    			     );
    				
    			}
    			
    			);
    
    </script>
    </head>
    
    <body>
    
    
    
    		<div class='example'>
    
    			<div id='fileTreeDemo_3' class='demo'>
    			</div>
    		</div>
    
    </body>
    </html>

    Here is a screenshot of my folder setup. Notice I infact do have a "demo/" folder that has test subfolders and images. But I still get this PHP error.



    If you would like to take a look at my files for me and test this out your self PLEASE it would help me out alot!!
    CLICK HERE TO DOWNLOAD MY FILES

  • #4
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    Quote Originally Posted by ohgod View Post
    it sounds like you don't have your root folder set up correctly
    you really need to be checking this if it's displaying a directory too high...

    try root: 'demo/' without the leading slash

  • #5
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts
    Thats just the thing I have tried every possible combination.

    /demo/
    demo/
    /demo
    demo


    /fileTree/demo/
    fileTree/demo/
    /fileTree/demo
    filetTree/demo

    but nothing works. It just keeps saying error on line 21 in my php file root not defined... But if its working fine on your end, then I have to suspect that its my php install somehow.

    I have never had any problems from my php before, I even run phpmyadmin for MySQL and I never get any hickups like this.

    Anyways I will do further investigations.

  • #6
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts
    I found the problem folks!

    it was my php.ini file and its error reporting enviroment.

    once I changed it to:

    Code:
    display_errors = (E_ALL ^ E_NOTICE)
    everything works perfect.

    Thanks and remember when you read a Apache/PHP install tutorial and they provide a link to information on further setting up your PHP environment READ IT!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •