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....
jrmorgan56 Nuke Soldier
Joined: Feb 06, 2004
Posts: 16
Posted:
Tue Feb 17, 2004 12:36 pm
I need further help because I keep getting PARSE Error messages when I add that command (ORDERY BY ....)
jrmorgan56 Nuke Soldier
Joined: Feb 06, 2004
Posts: 16
Posted:
Tue Feb 17, 2004 2:06 pm
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?
Darrell3831 Captain
Joined: Jan 05, 2004
Posts: 425
Posted:
Tue Feb 17, 2004 3:54 pm
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.
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