logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Web Design
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-04-2007, 02:03 AM   #1
owner
 
Join Date: Sep 2007
Posts: 64
Default Help with cms

Hello,

I am trying to build my own little cms.
I have a ton of questions lol

Here is the demo of my site:

http://www.ottcommunity.com/junk/secretsite/

What i need help with is....

Quote:
How can I make it so that the news with the highest id is first?

Example: 3,2,1

I want this because when you store your news in the database, you keep getting a higher id number so I need to sort the queries by highest number.
EDIT: Ok, I got that by using the DESC command in my query.

Second,

How would you store a navigation menu in the database. Right now I am using html for that menu, but how would you store the menu in the database with multiple topics.

What I want.

Title for each navigation
-Topic
--Sub Link
--Sub Link
-Topic
--Sub Link

Title for a new block
-Topic
--Sub Link
--Sub Link

and so forth, but how would you set that up to go into a database? I am fine making the database and pulling info, but how would you setup the tables/rows to make something like that?

Those are the only questions I have for now, any help would be greatly appreciated.

Thank You Very Much In Advance!
-Owner

Last edited by owner; 09-04-2007 at 02:18 AM.. Reason: Dont need help with the news now
owner is offline   Reply With Quote
Old 09-04-2007, 12:51 PM   #2
chriskq
chriskq's Avatar
 
Join Date: Oct 2005
Location: Sydney - DownUnder
Posts: 798
Default

pretty impressive making you own cms.

not sure on ur ques's too be honest. But have you ever considered using an opensource cms such as joomela. Also would a customised wordpress site do the job ?
__________________
can u do this with ur myspace? http://www.myspace.com/chrisjash
chriskq is offline   Reply With Quote
Old 09-04-2007, 09:15 PM   #3
owner
 
Join Date: Sep 2007
Posts: 64
Default

I dont want the copyrights on the bottom of the pages :P So thats why I want to make my own lol
owner is offline   Reply With Quote
Old 09-06-2007, 03:14 AM   #4
owner
 
Join Date: Sep 2007
Posts: 64
Default

Hello,

I was wondering. How can I make it so if someone goes to the link /news.php?id=X, where x being whatever id number the news is. How would you do this?
owner is offline   Reply With Quote
Old 09-06-2007, 08:27 AM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

PHP Code:
page.php?id=<?php echo $row['ID']; ?>
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-06-2007, 10:24 PM   #6
owner
 
Join Date: Sep 2007
Posts: 64
Default

How would I get the id if someone loaded the page like

page.php?id=X

instead of clicking on a link to goto that page.

Last edited by owner; 09-06-2007 at 10:54 PM.. Reason: Reworded to make this sound better
owner is offline   Reply With Quote
Old 09-07-2007, 08:23 AM   #7
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

not sure what you mean
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-07-2007, 12:33 PM   #8
owner
 
Join Date: Sep 2007
Posts: 64
Default

Lets say someone loaded the page externally. Like they typed into the addressbar

page.php?id=5

How would this script check for that?

Also for my news page I only want 5 news to be loaded. I know it has to do something with limit, but I dont want to put like 4198307209138741234,5. Is their a way to check for how many news are in the database so it would be

$amountofnews,5;

that way it would always load the correct news.

Thank you,
Owner
owner is offline   Reply With Quote
Old 09-07-2007, 01:22 PM   #9
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

i have never known someone type page.php?id=5 as an address

they may save it as a favorite

as for loading the correct news just sort your sql on a date and limit 5. This way you would always get your most current news loaded and only the most recent 5
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-07-2007, 09:50 PM   #10
owner
 
Join Date: Sep 2007
Posts: 64
Default

Ok I got the loading of my 5 latest news

Now what I'm trying to say is lets say someone went to page?=6

and then they had it bookmarked and they clicked on it. They would be going to page?id=6. How do I get my php document to find out that the page is id=6?
owner is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com