PHP Classes
elePHPant
Icontem

Category Tree: Generate an HTML tree of a category items database

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   Screenshots Screenshots   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-07-05 (10 years ago) RSS 2.0 feedStarStarStar 54%Total: 6,095 This week: 2All time: 343 This week: 604Down
Version License Categories  
category_tree 1.0GNU General Publi...HTML, Databases
Description Author  

This class can generate an HTML table with a tree of links to an hierarchical list of items retrieved from MySQL dabatase tables.

It can used to generate hierarchical navigation menus to browse categories of products to display in a site.

Picture of abstract80
Name: abstract80 <contact>
Classes: 1 package by
Country: France, Metropolitan France, Metropolitan
Age: ???
All time rank: 4292 in France, Metropolitan France, Metropolitan
Week rank: 587 Down2 in France, Metropolitan France, Metropolitan Equal

Details provided by the author  
	This class transforms a n-tree into a 2d array, expanding the selected branch.
	It has to be used to generate hierarchic menus with categories which contains products. 
	For this class application, you have to know that only categories with at least one associated product are visible.
	
	The tree shows the different categories but not the categories'products. If you want to see them, you should write an application 
	which selects the products in the clicked category and print them.

	Categories and products belong to two tables in the database and they are created when you load the two scripts.



---------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------ Which documents are  in the compressed file? ----------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
	
	You can find  :
		- A Class which contains the two classes which are at the present time in the program
			- A doc tree.php which enables you to define a tree
			- A category.php4 which helps you to manage categories
		- Two scripts in order to create the two tables and the contents for the example in your database (Mysql) that you have already created before.
		- A php document (DB_connect.php4) where you have to fill in your host, your username, its password and your database name. These information are nessecary for the database connection.
		- An other php document which is called example.php4.It enables you to show and test the tree.
		- A screenshot.gif in order to see an outline of the tree when we will print it.


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------- How to use the compressed file? -------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

	After you have downloaded the compressed file, you should :

		1. Load the two scripts in the SQL file in your Mysql database. Thanks to that, you will create the two tables in order to use this tree application example.

		2. Replace the information in the DB_connect.php4 document in order to allow the connection to the application database. You fill there your mean of connection (ex: "localhost"), your user for the database connection (ex: "root") and the password for this user. You also must indicate your database name.

		3. Finally, you can load the example.php4 and see the tree!

Screenshots  
  • screenshot.gif
  Files folder image Files  
File Role Description
Plain text file category.sql Data sql for category's table
Plain text file Category_class.php4 Class category's class
Plain text file DB_connect.php4 Conf. database connection
Plain text file example.php4 Example example
Plain text file product.sql Data sql for product's table
Plain text file readme.txt Doc. Documentation
Plain text file Tree_class.php4 Class tree's class

 Version Control Unique User Downloads Download Rankings  
 0%Total:6,095All time:343
 This week:2This week:604Down
 User Ratings  
 
 All time
Utility:66%StarStarStarStar
Consistency:66%StarStarStarStar
Documentation:70%StarStarStarStar
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:54%StarStarStar
Rank:1397