<?php
require_once('./content/db.php');
require_once('./content/config.php');
if($url['0']){
// not viewing a single article, show normal title/description
echo '<title>Example.com - Home</title>';
}else{
// viewing a single article, show the title/description for it
$data = DataAccess::fetch(sprintf("SELECT title FROM %s WHERE id = ?", NEWS_ARTICLES), $url['0']);
$title = $data['0']['title'];
echo sprintf('<title>Example.com - %s</title>', strip_tags($title), PHP_EOL);
}
?>
<?php
require_once('news/db.php');
require_once('news/config.php');
if(!$url['0']){
// not viewing a single article, show normal title/description
echo '<title>Example.com - Home</title>';
}else{
if(is_numeric($url['0'])){
// viewing a single article, show the title/description for it
$data = DataAccess::fetch(sprintf("SELECT title FROM %s WHERE id = ?", NEWS_ARTICLES), $url['0']);
$title = $data['0']['title'];
echo sprintf('<title>Example.com - %s</title>', strip_tags($title), PHP_EOL);
}else{
echo '<title>Example.com - Home</title>';
}
}
?>