<?php
include 'news/index.php';
?>
<?php
include 'news/index.php';
// custom code for displaying news articles that are assigned to the same category as the one displayed above.
// Grab all categories that the above article is assigned to then assign them to the $cat array then do another include
if($_GET['id']){
require_once('news/db.php');
require_once('news/config.php');
$cat = array();
$assignedcats = array();
$assignedcats = DataAccess::fetch("SELECT news30_cats.name AS catname FROM news30_groupcats
LEFT JOIN news30_cats ON news30_groupcats.catid = news30_cats.id
WHERE storyid = ?", $_GET['id']);
foreach($assignedcats AS $cats){
$cat[] = $cats['catname'];
}
$static = true;
$template = 'headlines';
include 'news/index.php';
}
?>
<?php
include 'news/index.php';
if($url['0']){
require_once('../news/db.php');
require_once('../news/config.php');
$cat = array();
$assignedcats = array();
$assignedcats = DataAccess::fetch("SELECT news30_cats.name AS catname FROM news30_groupcats
LEFT JOIN news30_cats ON news30_groupcats.catid = news30_cats.id
WHERE storyid = ?", $url['0']);
foreach($assignedcats AS $cats){
$cat[] = $cats['catname'];
}
$static = true;
$template = 'headlines';
include '../news/index.php';
}
?>
<?php
include 'news/index.php';
if($url['0']){
require_once('../news/db.php');
require_once('../news/config.php');
$cat = array();
$assignedcats = array();
$assignedcats = DataAccess::fetch("SELECT news30_cats.name AS catname FROM news30_groupcats
LEFT JOIN news30_cats ON news30_groupcats.catid = news30_cats.id
WHERE storyid = ? AND type = 'news'", $url['0']);
foreach($assignedcats AS $cats){
$cat[] = $cats['catname'];
}
$static = true;
$template = 'headlines';
include '../news/index.php';
}
?>