Change block in "./inc/shows.inc.php":
Automatically Generated, be sure to be very precise on tabs and spaces.
Replace this:
if(isset($category) and $category != ""){
foreach($all_news as $news_line){
$news_arr = explode("|", $news_line);
if($requested_cats and $requested_cats[$news_arr[6]] == TRUE){ $count_all ++; }
else{ continue; }
}
}else{ $count_all = count($all_news); }
With:
// Search In Newspage v1.0 - changeblock - Old
// if(isset($category) and $category != ""){
// foreach($all_news as $news_line){
// $news_arr = explode("|", $news_line);
// if($requested_cats and $requested_cats[$news_arr[6]] == TRUE){ $count_all ++; }
// else{ continue; }
// }
// }else{ $count_all = count($all_news); }
// Search In Newspage v1.0 - changeblock - New
foreach($all_news as $news_line){
$news_arr = explode("|", $news_line);
if (isset($searchtext) and
!@stristr($news_arr[2], $searchtext) and
!@stristr($news_arr[3], $searchtext) and
!@stristr($news_arr[4], $searchtext)) {
continue;
}
if ($requested_cats and
$requested_cats[$news_arr[6]] != true) {
continue;
}
$count_all++;
}
// Search In Newspage v1.0 - End changeblock
Add block in "./inc/shows.inc.php":
Automatically Generated, be sure to be very precise on tabs and spaces.
Add this:
// Search In Newspage v1.0 - addblock
if (isset($searchtext) and
!@stristr($news_arr[2], $searchtext) and
!@stristr($news_arr[3], $searchtext) and
!@stristr($news_arr[4], $searchtext)) {
continue;
}
// Search In Newspage v1.0 - End addblock
Between:
if($category and $requested_cats[$news_arr[6]] != TRUE){ continue; }
And:
if(isset($start_from) and $start_from != ""){
End installation notes:An example of the usage of this addon. <?php
$searchtext = 'text'
include('path/to/show_news.php');
?>This will only display the results which will contain "text" in either the title, short story or the full story. You can also use "http://yoursite.com/yournewspage.php?searchtext=text", if you use this include code: <?php
$searchtext = $_GET['searchtext'];
include('path/to/show_news.php');
?>
 |