twsowerby Posted December 16, 2007 Share Posted December 16, 2007 Hi guys, I am building a forum for a university project and would like to implement a dynamic breadcrumb trail much like the one on this forum. Something like: Home > Forum > *Category title* > *Post Title*. I have searched on google for solutions but can only find static breadcrumbs and my php knowledge is too limited to enable me to adapt those solutions to suit my requirements. My database structure is set up so that categories have their own table and then all the posts and replies are stored in another table linked to categories by a category id. Happy to post any more informtaion you need and any help would be greatly appreciated. Thanks! Tom Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted December 16, 2007 Share Posted December 16, 2007 if your looking for somethign similar to what son phpfreaks? at the top of the page? PHP Freaks Forums > PHP and MySQL > PHP Help > Topic: Forum Breadcrumb trail - help! well personally what i woudl do is to have every page statically define its location. eg this page woudl define its name as "PHP Freaks Forums > PHP and MySQL > PHP Help > ***". then what you woudl do is have a function that finds *** and replaces it with a $PAGE_NAME variable - or the name of a post or whatever. another way you coudl do it is to have each new level in a new directory from teh root etc. then you could simply play with your directories in PHP using **slice()???*** and then post it like that. this way would work best becase you could change directories etc and you woudlnt have to change any code gdlk Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted December 16, 2007 Share Posted December 16, 2007 Just have an array of crumbs and use a foreach loop or join() to generate the trail. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.