I've looked around for a discussion of this, and have only found an unanswered request in the version 2.0 boards.
I'm wondering if it's possible to have the stories listed alphabetically ignore the initial articles: the, a, et cetera. It puts an inordinate number of stories in the T section, and it's not in my instinct to search for stories under "T" when they start with "the." That may be the librarian in me, I'm not sure.
It's my sense this might be kind of difficult, but I thought I'd ask.
Thanks!
Not sure how to do 'ignore' but I'd just rewrite the titles so 'The Golden Compass' is 'Golden Compass the'. Otherwise if you change the code to sort by alphabetical it'll mess with the admin category area. Was not so humorous trying to undo that damage.
The alternative for me was to change the variables in the 'characters.php' so it reflected the categories. Not that great, but it did what I expected it to do.
I doubt this is what you are looking for and frankly I'd like what you are looking for, too, but taken a step further. I'd like a row a,b,c,d,e,f and a row Aa, Ab, Ac, Ad, Ae, Af under that. These would be located within the top level categories so there's no crossover as this example suffers from. Bleach anime and Bleach manga would both appear for instance. (manga) and (anime) labels would offset this, but not entirely ideal.
Example: http://fanforge.net/browse.php?type=characters&charid=67
I saved this over 'titles.php' in the browse folder as it wasn't needed as designed for me. I don't see a way yet to make a new page there so it recognizes it.
<?php
// ----------------------------------------------------------------------
// Copyright (c) 2007 by Tammy Keefer
// Valid HTML 4.01 Transitional
// Based on eFiction 1.1
// Copyright (C) 2003 by Rebecca Smallwood.
// http://efiction.sourceforge.net/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
if(!defined("_CHARSET")) exit( );
$current = "Titles";
$catid = isset($_GET['id']) && isNumber($_GET['id']) ? $_GET['id'] : 0;
if($catid > 0) {
$catquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories WHERE catid = '$catid' LIMIT 1");
$cat = dbassoc($catquery);
$output = "<div id='pagetitle'>".stripslashes($cat['category'])."</div>n<div id='story'>".format_story($cat['description'])."</div>";
$numrows = search(_STORYQUERY.$storyquery._ORDERBY, _STORYCOUNT.$countquery, "browse.php?");
}
else {
$output .= "<div id="pagetitle">"._TITLES.($let ? " - $let" : "")."</div>".build_alphalinks("browse.php?$terms&", $let);
if($let == _OTHER) $query = " category REGEXP '^[^a-z]'";
else if($let) $query = " category LIKE '$let%'";
else $query = "";
$catquery = "SELECT * FROM ".TABLEPREFIX."fanfiction_categories".($query ? " WHERE $query" : "");
$countquery = "SELECT count(catid) FROM ".TABLEPREFIX."fanfiction_categories".($query ? " WHERE $query" : "");
$catid = 0;
$count = dbquery($countquery);
list($numrows)= dbrow($count);
$limit = $itemsperpage * $displaycolumns;
$total = ($numrows > $limit ? $limit : $numrows);
$list = floor($total / $displaycolumns);
if($total % $displaycolumns != 0) $list++;
$colwidth = (100/ $displaycolumns) -1;
$count = 0;
$column = 1;
$result2 = dbquery($catquery." ORDER BY category LIMIT $offset,$limit");
$output .= "<div id="columncontainer"><div id="browseblock">".($displaycolumns ? "<div class="column">" : "");
while($cat = dbassoc($result2)) {
$count++;
$output .= "<a href=""browse.php?type=categories&id=$cat[catid"]">".stripslashes($cat['category'])."</a><br />";
if( $count >= $list && $column != $displaycolumns) {
$output .= "</div><div class="column">";
if($total % $displaycolumns == $column) $list--;
$column++;
$count = 0;
}
}
$output .= "</div>".($displaycolumns ? "</div>" : "")."<div class='cleaner'> </div></div>";
if ($numrows > $limit) {
$output .= build_pagelinks("browse.php?type=titles".($let ? "&let=$let" : "")."&", $numrows, $offset, $displaycolumns);
}
else if(!$numrows) $output .= write_message(_NORESULTS);
$numrows = 0;
}
if($catid > 0) $catlist1 = $catid;
?>
I am rebuilding efiction! Join us on irc! #efiction at
I'm not sure what I'm looking at in that link, or what you mean by reflecting the categories. I think I'm missing something.
And I guess I could, as admin, manually retitle everything, but it looks so awkward. I'll have to see if I can find out how the open source library integration software does it, though I have no idea how that operates. Since all that stuff works off of MARC formatting, it's a totally different structure and most likely wholly inapplicable.
There's probably an easier way of doing this ... but I'd str_replace all the titles, adding the 'a'/'the' respectively at the end of the stripped, and list them alphabetically like that.
archive:
site:
Available for skin/mod commission! π
i replaced all the variables for the characters from the characters.php file with the variables for categories. it functions exactly the same.
I am rebuilding efiction! Join us on irc! #efiction at
I'm sorry, to clarify: this makes characters list alphabetically, you mean, without regard to "the"?
just alphabetically, try the other suggestion to replace everything, this can be done as a sql command
I am rebuilding efiction! Join us on irc! #efiction at
I'm confused now.
my_daroga, did you just want the alphabetical ordering to ignore the 'the'/'a'? I'm sure one could do that in a file sans anything messy with the MySQL?
archive:
site:
Available for skin/mod commission! π
Yes--all I want is for the list of stories by title to put "The Age of Innocence" under "A" rather than "T." As you would find in a library catalog. If I wasn't clear in my initial post, my apologies. Preferably, I'd like to do this without stripping the a/the from the title or its display.
