0) { $charquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE charid = '$charid' LIMIT 1"); $char = dbassoc($charquery); $output = "
".stripslashes($char['charname'])."
\n
".format_story($char['bio'])."
"; $numrows = search(_STORYQUERY.$storyquery._ORDERBY, _STORYCOUNT.$countquery, "browse.php?"); } else { $output .= "
"._CHARACTERS.($let ? " - $let" : "")."
".build_alphalinks("browse.php?$terms&", $let); if($let == _OTHER) $query = " charname REGEXP '^[^a-z]'"; else if($let) $query = " charname LIKE '$let%'"; else $query = ""; $charquery = "SELECT * FROM ".TABLEPREFIX."fanfiction_characters".($query ? " WHERE $query" : ""); $countquery = "SELECT count(charid) FROM ".TABLEPREFIX."fanfiction_characters".($query ? " WHERE $query" : ""); $charid = 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($charquery." ORDER BY charname LIMIT $offset,$limit"); $output .= "
".($displaycolumns ? "
" : ""); while($char = dbassoc($result2)) { $count++; $output .= "".stripslashes($char['charname'])."
"; if( $count >= $list && $column != $displaycolumns) { $output .= "
"; if($total % $displaycolumns == $column) $list--; $column++; $count = 0; } } $output .= "
".($displaycolumns ? "
" : "")."
 
"; if ($numrows > $limit) { $output .= build_pagelinks("browse.php?type=characters".($let ? "&let=$let" : "")."&", $numrows, $offset, $displaycolumns); } else if(!$numrows) $output .= write_message(_NORESULTS); $numrows = 0; } if($charid > 0) $charlist1 = $charid; ?>