Assistance needed with sorting Categories by name

Questions about programming languages and debugging
Post Reply
favtm
forum buddy
forum buddy
Posts: 14
Joined: 17 Aug 2006, 16:00
17
Contact:

Assistance needed with sorting Categories by name

Post by favtm »

I am too new to PHP to know what I am doing. I coded all my sites with HTML the past 10 years. I'm converting my site to a PHP layout and am learning as I go. I have one final itty bitty thing to fix before I can launch the site. I have searched google and 5 other forums regarding this with no working solution. But it's possible I'm not asking the right Q--here goes...

http://www.trojanlibrary.com/3.0/module ... me=Content

The link above is a visualization of my dilema. My Library--or Content page--is simply out of order. It does not appear to be in CID or PID so I'm flustered as to what order it's listed in, and how to change it to alphabetical.

My gosh I'm too embaressed to launch the site with this out of whack. It looks ridiculous doesn't it?

My Q is, what page must I edit, and what must I edit? Thank you so much for any advice in advance.
FAV™ - Author of Trojan Library Network @ TrojanLibrary.net

User avatar
Still_Learning
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 1040
Joined: 11 Jun 2008, 16:00
15
Location: Trigger City

Post by Still_Learning »

Props on the site.. good job, Ive needed a resource like this. As for the code I can not help I am still learning all of this stuff at school
Gone

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

a phpnuke module/block that is, right? you will have to post the source code, else it's kinda impossible to help...you can do it at http://code.suck-o.com , simply post the link(s) here then.... :wink:

favtm
forum buddy
forum buddy
Posts: 14
Joined: 17 Aug 2006, 16:00
17
Contact:

Post by favtm »

Alrigthty, grazi for the help. But I'm not sure which php page to post. Would it be mainfile.php or module.php, and which one? There's more than one depending on which folder I open.

Sigh, I'm back to basics.
FAV™ - Author of Trojan Library Network @ TrojanLibrary.net

User avatar
DNR
Digital Mercenary
Digital Mercenary
Posts: 6114
Joined: 24 Feb 2006, 17:00
18
Location: Michigan USA
Contact:

Post by DNR »

hey Fav,
BB means to post YOUR PHP code at this link - the forum will not accept PHP code in this thread.

So post your PHP code here

http://code.suck-o.com

and then link to it here in the forum.

The guys that deal in PHP will review and resubmit your code!

Good to see ya, I am off to bed!

DNR
-
He gives wisdom to the wise and knowledge to the discerning. He reveals deep and hidden things; he knows what lies in Darkness, and Light dwells with him.

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

it should be the file(s) in /modules/Content/, most likely the index.php one... :wink:

favtm
forum buddy
forum buddy
Posts: 14
Joined: 17 Aug 2006, 16:00
17
Contact:

Post by favtm »

Thanks Bad Brain for the clarification. Below you will find the link to the code of the index page found in the modules/Content folder.

http://code.suck-o.com/136

This was the page I actually edited a little. I changed all the 'ORDER BY date' to 'ORDER BY title' but still didn't work--but I left them as title anyway.
FAV™ - Author of Trojan Library Network @ TrojanLibrary.net

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

ok, I think the query that you will have to edit is in line 195:

Code: Select all

$result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories");
best open the database with phpmyadmin, and check the structure of the table named "page_categories", the cell that includes the A, B,C, etc. is the one that should be used for ORDER BY....let's say the cell is named "category_id" for example, it would be:

Code: Select all

$result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories ORDER BY category_id");
:wink:

favtm
forum buddy
forum buddy
Posts: 14
Joined: 17 Aug 2006, 16:00
17
Contact:

Post by favtm »

lol BB I can't tell you how relieved I am. I appreciate your assistance tremendously. I ended up sorting it by title and now it's sorted as it should be. TLN should be up again in no time.
FAV™ - Author of Trojan Library Network @ TrojanLibrary.net

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

you're welcome... :wink:

Post Reply