Hello,
I've got an interesting challenge: I am using a script called PHPnews. It is basically unsupported because their forum is down and the programmers are not returning my e-mails.
In any event, one of the features is this News program is that you can select the headlines to display by category by simply entering a price of code as follows:
<?php
$_GET['headcat'] = 1;
include("path/to/phpnews/headlines.php");
?>
The headlines.php file includes the following piece of code that enables users like me to include the headlines by category:
/* Check if headlines are being display by category or by views */
if(isset($_GET['headcat']) && is_Numeric($_GET['headcat']))
{
$sql = 'SELECT id,posterid,time,subject FROM ' . $db_prefix . 'news WHERE catid=\'' . $_GET['headcat'] . '\' AND trusted = 1 ORDER BY id DESC LIMIT ' . $Settings['numtoshowhead'] . '';
}
elseif(isset($_GET['headviews']) && ($_GET['headviews'] == '1'))
{
if(($_GET['headorder'] == 'down') || ($_GET['headorder'] == ''))
{
$sql = 'SELECT id,posterid,time,subject FROM ' . $db_prefix . 'news WHERE trusted = 1 ORDER BY views DESC LIMIT ' . $Settings['numtoshowhead'] . '';
}
elseif($_GET['headorder'] == 'up')
{
$sql = 'SELECT id,posterid,time,subject FROM ' . $db_prefix . 'news WHERE trusted = 1 ORDER BY views ASC LIMIT ' . $Settings['numtoshowhead'] . '';
}
}
else
{
$sql = 'SELECT id,posterid,time,subject FROM ' . $db_prefix . 'news WHERE trusted = 1 ORDER BY id DESC LIMIT ' . $Settings['numtoshowhead'] . '';
}
However, no such thing is possible when trying to show the entire news titles (not the headlines). To show the news, one most use the following piece of code:
<?php
include("path/to/phpnews/news.php");
?>
The challenge is to be able to add code into the news.php that will enable me to show the news but only by a selected category ID, something like:
<?php
$_GET['catid'] = 3;
include("path/to/phpnews/news.php");
?>
Alas, I am yet to find the answer despite breaking my head. If you're so inclined to help, you can review the entire news.php code here.
Any clue will be greatly appreciated.