Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
jjh221
Worker
Worker



Joined: Dec 05, 2006
Posts: 180

PostPosted: Thu Dec 07, 2006 4:46 pm Reply with quote

Version: Raven Nuke 7.6
Would it be possible to set the order number in which the Categores and pages are shown? instead of by date or possibly by id #. I think the id # is kinda like the date? erm something like that right? I say this because I see in the index code "ORDER BY date" is used.

Would another way be, going into the sql database and editing the id #'s for right now till something is created to do so? Would it be hard in doing so?

thanks,

j

edit: so maybe in the future we could chose the id number. Oh then again having two of the same id #'s wouldnt work. Or... um well the only thing i can think of is another script telling us to use such and such id as either 1 or 2nd on the list and so on. Say id#3 should appear 1st on the list... know what i mean?

:shrugs:

edit#2: oh yea i forgot i wanted to ask.
As i view the contents page, while logged into admin account. I see there is at the bottom of the page "Content Module Administration Panel" box but nothing in it? is there suppose to be something there?


Last edited by jjh221 on Thu Dec 07, 2006 6:43 pm; edited 2 times in total 
View user's profile Send private message
jjh221







PostPosted: Thu Dec 07, 2006 5:05 pm Reply with quote

doh i just thought of something. Ill change the index file to "ORDER BY title ASC" then lable the titles in number order..... ok going off to try.


Edit: ok didnt work, unless im doing something wrong. I dont know anything about php really. I just found and replaced all "ORDER BY date" to "ORDER BY title ASC"

Edit: ok it works for the content pages under or inside the Categories. Still need to figure out where the code is for the Categories


Last edited by jjh221 on Thu Dec 07, 2006 6:43 pm; edited 1 time in total 
jjh221







PostPosted: Thu Dec 07, 2006 6:37 pm Reply with quote

Ok got it.

File: /modules/Content/index.php

Find:
Code:


    echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>";
    $result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories");


Replace with:
Code:
    echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>";

    $result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories ORDER BY title ASC");


Also I replaced all "ORDER BY date" with "ORDER BY title ASC"

the ASC is for ascending or you could put DESC for descending.

So now my Categories looks like this:

1. whatevers First
2. whatever
3. apple

So when creating my Categories and Pages inside my Content module I labled the titles "1. whatevers First".... 1. being part of the title.


Is there a better way? let me know thanks
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Dec 08, 2006 7:01 am Reply with quote

Nope. Looks good. This allows you to control the order simply by renumbering your titles. Good job!

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
jjh221







PostPosted: Fri Dec 08, 2006 2:43 pm Reply with quote

thanks Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©