Default News Article

Wolverine

Member
Aug 1, 2014
90
3
I'm trying to get a default news article to appear when you go to /news on the CMS. Right now, when you type /news in your browser, it goes to this page, and it's really blank and ugly. I'm trying to redirect so when you manually type "{url}/news" it'll redirect you to the default news article and display the news content.
You must be registered for see images attach


I know I could change the URL in /community so when you click news it'll go to the first, but that doesn't help the fact that when you type news manually, this shows up.
 

Hender

King Tinkerer
Mar 3, 2016
304
122
What CMS are you using?
RevCMS naturally selects one.

eb0a10738c3f8be3695a01967c3e2d7f.png
 

JMS

Posting Freak
Aug 25, 2014
562
270
Not sure if this would work for you, but we use this code at Pure. It automatically redirects to the article for you.
PHP:
<?php
if(isset($_GET['id']))
{
$id = mysql_real_escape_string($_GET['id']);
$query = mysql_query( "SELECT * FROM `cms_news` WHERE id = '{$id}'" );
$array = mysql_fetch_array($query);

if ($array == null)
{
$getMax = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM cms_news LIMIT 1"));
header("Location: ".$_CONFIG['hotel']['url']."/index.php?url=news&id=". $getMax['MAX(id)'] ."");
exit();
}
}
?>
 

Users who are viewing this thread

Top