Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: [Mod] Blog as Page  (Read 132 times)

r0zzin

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
[Mod] Blog as Page
« on: December 30, 2012, 10:49:54 PM »

Was not sure what to name this so just used same as my question.

What this does is allow you to display new post on another page. This way you can set a default page.
This mod requires you to alter snews.php I recommend http://www.geany.org/
As always it is recommended to back up your data as errors happen.
Most of this is just search and replace. You can change blog to something else.
Lines are on fresh snews.php with no other mods.
Find (line 581)

sitemap
(); break;

add below it

case 'blog':
articles(); break;

Find (Line 357)

echo '<li><a'.$class.' href="'._SITE.'">'.l('home').'</a></li>';

add below

	
$class = ($categorySEF == 'blog') ? ' class="current"' '';
	
echo 
'<li><a'.$class.' href="'._SITE.'blog/">Blog</a></li>';

Find (line 98)

$l
['cat_listSEF'] = 'archive,contact,sitemap,login';

replace with

$l
['cat_listSEF'] = 'archive,contact,sitemap,login,blog';

find (line 606)
 
if ($_ID || (!$_catID && $frontpage != 0)) {

replace with

if ($_ID ||(!$_catID && $frontpage != && $categorySEF!='blog')) {


Bugs:
On the new page there is no title.

If you find any others please let me know
An example can be found on my yet to be finished site. I have been getting some random "500 internal server error"(even before the mod) a fair warning.
http://www.sempiternal-imagination.com/
Logged