Access: Admin
Total Posts: 1395
Joined: 2006-05-19
This is where categories come in useful, when posting your news articles if you assign them to a certain category then you can selectively choose which articles to show on your site by specifying the category before the include code, something like this
Code:
<?php $cat[] = "Music"; include 'news/index.php'; ?>
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
One way to do this would be to slightly modify the built in search function. When you specify $search = true, before a news include, it shows the search form. You could edit this form and change it so that instead of checking if the form has been submitted, it checks if a search term has been specified, if so perform a normal search.
If you edit functions.php, on line 161~ change this
Code:
global $searchform, $searchresults, $catcutoff;
To this
Code:
global $searchform, $searchresults, $catcutoff, $searchquery;
Then a few lines down you should see 2 instances of $_POST['searchsubmit'], change both of these to $searchquery and save.
Now if you do a include something like this
Code:
<?php $search = true; $searchterm = 'something';
include 'news/index.php'; ?>
It should give you some search results based on the $searchterm variable.
This isn't ideal as it formats each result depending on how "Search Results" section within your template is formatted.
In a future version of the script I plan on changing how search works, instead of it returning results based on the "Search Results" template, it'll return them formatted how your news is normally formatted when simply displaying it, so basically when searching for news it'll display exactly like it normally does.
// if the search form hasn't been submitted hide the search results section
if(!$_POST['searchsubmit']){
should all four be changed ? [i tried that and it didnt work].
After the change, will the search function still continue working in its normally way [offering a search box ] ?