Ok, I need some help brainstorming on this one. I want to create a PHP script to write a navigation system for a website, and allow the authorized user to change links, add new links, and select where they want their new link(not a neccesity now, but might be later.) I'm pretty sure if I could acheive this if I created a script that made each link on the bar a html document, but that seems like overkill.
I'm not a great programmer, so any suggestion is better than the one I have.
Thanks,
Mark Barnett
fastduke
02-21-2005, 02:26 AM
so you want to code your own CMS?
not being a great programmer might make this pretty hard.
IMHO
William Palmer
02-21-2005, 03:04 PM
Why not make a table (in a database) with columns for, link id number, title, target (url), ..., and position (like 0 being the first link on the page, 1 being below it)?
Then just write a simple page to check their login credentials, and let them edit the links, change their target URL, set what order they appear in.
Displaying them on the page would just be a single query and an output loop.
Great suggestion. I already have the user authentication, so nows it's just a matter of using a cookie and writing up the scripting.
Thanks,
Barnett
Heres a quick ponderous question on the above suggestion. Lets say a link already exists in position 0, but the user wants to insert a link in front of it and push the rest back. Any idea on how that would work in PHP?
Thanks,
Barnett
Burhan
02-23-2005, 03:42 AM
Use a weights system, and assign weights to each link. Lighter links float on top of heavier ones. Just add a column to your links table that can hold integers and give a range of weights; for example -10 to 10.
-1 is less than 0 so its "lighter" and any item that has a weight of -1 will "float" on top of any item that has a weight > -1 and so on. Items in the same weight category (for example, three links that are all -1) can simply be stacked on top of each other.
Dan L
02-23-2005, 01:33 PM
A CMS will be very tough if you are not a good programmer. I consider myself intermediate and I still have trouble doing some of the more advanced aspects of making a system that interacts with a user and database.
Guys....thanks for responding, but programming skills are a non-issue. If I tell myself that I cant make a nav system and never try, then I don't really know. I claim to be horrible at programming, but it's only to the extent that I don't want to be arrogant about what I really have. I can appreciate a good warning, but just saying it's hard doesn't help much. If it's going to be hard, tell me why and then on my own I can decide if I can tackle it or not. So heres my demeaner: If YOU'VE had difficulty with an issue that I'm trying to tackle, then tell me what you had or have difficulty with....otherwise it's a waste of time.
Thanks,
The Barnett