You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 93 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Alphabetizing Entries in Encyclopedia ORDER BY... [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
jrmorgan56
Nuke Soldier
Nuke Soldier


Joined: Feb 06, 2004
Posts: 16


PostPosted: Tue Feb 17, 2004 12:10 pm Reply with quoteBack to top

I am using php 7.0....here is a sample out of encylcopedia module's index.php file:

Code:
 
function terms($eid, $ltr) {
    global $module_name, $prefix, $sitename, $db, $admin;
    $sql = "SELECT active FROM ".$prefix."_encyclopedia WHERE eid='$eid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $active = $row[active];
    $sql = "SELECT title FROM ".$prefix."_encyclopedia WHERE eid='$eid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $title = $row[title];
    include("header.php");
    title("$title");
    OpenTable();
    if (($active == 1) OR (is_admin($admin))) {
   if (($active != 1) AND (is_admin($admin))) {
       echo "<center>"._YOURADMINENCY."</center><br><br>";
   }
   echo "<center>Please select one term from the following list:</center><br><br>"
       ."<table border=\"0\" align=\"center\">";
   $sql = "SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE UPPER(title) LIKE '$ltr%' AND eid='$eid'";
   $result = $db->sql_query($sql);
   $numrows = $db->sql_numrows($result);


Can I use an ORDER BY statement in this function to properly alphabetize my encyclopedia entries, and if so, where??? I have been dying to find a way to do this, please help....I think I have to do something like this:

Code:

sql_query("SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE UPPER(title) LIKE '$ltr%' AND eid='$eid' ORDER BY title ASC", $dbi);


but need further help....
Find all posts by jrmorgan56View user's profileSend private message
jrmorgan56
Nuke Soldier
Nuke Soldier


Joined: Feb 06, 2004
Posts: 16


PostPosted: Tue Feb 17, 2004 12:36 pm Reply with quoteBack to top

I need further help because I keep getting PARSE Error messages when I add that command (ORDERY BY ....)
Find all posts by jrmorgan56View user's profileSend private message
jrmorgan56
Nuke Soldier
Nuke Soldier


Joined: Feb 06, 2004
Posts: 16


PostPosted: Tue Feb 17, 2004 2:06 pm Reply with quoteBack to top

I've searched many similar topics here, and they all say the same thing... but how come when I do what everyone says, I get the parse error?
Find all posts by jrmorgan56View user's profileSend private message
Darrell3831
Captain
Captain


Joined: Jan 05, 2004
Posts: 425


PostPosted: Tue Feb 17, 2004 3:54 pm Reply with quoteBack to top

Encyclopedia enteries are already alphabatized. If you view the terms in each encyclopedia they are fine.

Are you asking how to put the list of encyclopedias into alphabetical order??

Putting the lists of encyclopedias into order would be a different spot in the code from what you posted.

To put the list of encyclopedia's in order find this:

Code:
$sql = "SELECT eid, title, description, elanguage FROM ".$prefix."_encyclopedia WHERE active='1'";


In /modules/Encyclopedia/index.php in the list_themes() function.

Change it to:

Code:
$sql = "SELECT eid, title, description, elanguage FROM ".$prefix."_encyclopedia WHERE active='1' ORDER BY title ASC";


That will put your list of Encyclopedia's into order for you.

Let me know if this is what you wanted.

Darrell

_________________
http://www.psy-center.com
Find all posts by Darrell3831View user's profileSend private messageVisit poster's website
DarkAngelll
Nuke Soldier
Nuke Soldier


Joined: Dec 10, 2005
Posts: 21


PostPosted: Thu Aug 31, 2006 9:46 am Reply with quoteBack to top

I dont know if thats what he wanted, but it's sorted me. Thanks.
Find all posts by DarkAngelllView user's profileSend private message
JJH221
Nuke Soldier
Nuke Soldier


Joined: May 30, 2005
Posts: 23


PostPosted: Wed Sep 20, 2006 9:23 am Reply with quoteBack to top

/modules/Encyclopedia/index.php

Find:

Code:
$result3 = $db->sql_query("SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE UPPER(title) LIKE '$ltr%' AND eid='$eid'");


Replace with:

Code:
$result3 = $db->sql_query("SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE UPPER(title) LIKE '$ltr%' AND eid='$eid'ORDER BY title ASC");


I did this and works for me.
Find all posts by JJH221View user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.661 Seconds - 262 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::