Posts: 2

Topic: [HACK] Filter By Letter

Name: Filter By Letter
Author:NyNeCuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: If you want to show article that start with a certain letter in the title, author, short story or full story.
Instructions:open shows.inc.php
find:

$news_arr = explode("|", $news_line);

add below:

// Filter Letter - Start addblock
// To specify filtering, put the following in your include code:
// $filter_letter[X] = Y;
// Where X is a number from 1-4, which mean the following:
// 1 = filter by author
// 2 = filter by title
// 3 = filter by short story
// 4 = filter by long story
// And Y is the character you'd like to filter by.
// ex: $filter_letter[3] = C; will show articles who's short story start with C
if (isset($filter_letter[$arr])) {
$fl = trim($news_arr[$arr]);
$fl = strtolower($fl{0});
$filtered_letter = strtolower($filter_letter[$arr]);
if ($filtered_letter != $fl) { continue; }
}
// Filter Letter - End addblock