Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: "Home" as a "page"  (Read 628 times)


  • Newbie
  • *
  • Karma: 0
  • Posts: 1
"Home" as a "page"
« on: August 23, 2010, 02:36:53 pm »

It's my first post in your forum, so at first of all I will introduce myself.
My name is Damian and I'm from Poland, Central Europe.
I'm sorry in advance for mistakes in writing, my English is still weak.

I would make simple website, without categories, comments, breadcrumbs etc. Just only pages.
I can hide "archive" "sitemap" and "contact" from nav bar throught commenting several lines in snews.php:
Code: [Select]
function pages() {
global $categorySEF,$_No3;
$qwr = !_ADMIN ? ' AND visible=\'YES\'' : '';
$class = empty($categorySEF) ? ' class="current"' : '';
echo '<li><a'.$class.' href="'._SITE.'">'.l('home').'</a></li>';
//$class = ($categorySEF == 'archive') ? ' class="current"' : '';
//echo '<li><a'.$class.' href="'._SITE.'archive/">'.l('archive').'</a></li>';
$query = "SELECT id, seftitle, title FROM "._PRE.'articles'." WHERE position = 3 $qwr ORDER BY artorder ASC, id";
$result = mysql_query($query);
$num = mysql_num_rows($result);
while ($r = mysql_fetch_array($result)) {
$title = $r['title'];
$class = ($categorySEF == $r['seftitle'])? ' class="current"' : '';
if ($r['id'] != s('display_page')) {
echo '<li><a'.$class.' href="'._SITE.$r['seftitle'].'/">'.$title.'</a></li>';
//$class = ($categorySEF == 'contact') ? ' class="current"': '';
//echo '<li><a'.$class.' href="'._SITE.'contact/">'.l('contact').'</a></li>';
//$class = ($categorySEF == 'sitemap') ? ' class="current"': '';
//echo '<li><a'.$class.' href="'._SITE.'sitemap/">'.l('sitemap').'</a></li>';
if ($num) $_No3 = true;

My problem is "Home". "Home" page genuinely contains latest article(s), but I would to be simple page in this place. It is possible?
My PHP skills unfortunately are too weak (none in fact) to solve this trouble by myself.


My second question is "2-3 more extras" addon is avaiable for sNews 1.7?

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: "Home" as a "page"
« Reply #1 on: August 23, 2010, 03:16:18 pm »

Hello Damian, and welcome to sNews!

The first question is easy to solve. In the Admin Panel, create a new Page that contains the items you want to show on your home page. Then go to Settings and in the Contents panel, select your new page from the drop-down list for "Use Page as Home Page". Save the change and you have your special Home page.

The second question - I'm not sure which mod you are referring to, but sNews 1.7 has a built-in Multiple Extras option. In the Admin panel, again in Settings -> Contents, check the box for "Enable Multiple Extra Options". Then go to the first Admin page and you will now see that you can create new Extra Groupings as well as Extra Content. When your index.php file uses the function call <?php extra(); ?> you will get the extra contents as per your settings in the Admin panel. With Multiple Extra Options enabled, you can put many <?php extra(); ?> calls in your index.php file, but with defined extra grouping names, like this:
Code: [Select]
<?php extra('news'); ?>
<?php extra('games'); ?>

Or you can put those function calls in your pages in the Admin panel by using the Function button (or writing: [func]extra:|:news[/func] and [func]extra:|:games[/func])

Hope that helps.

PS. As a general tip for using the forum: if you would like to see an old mod developed further, or need to solve a problem that relates to a specific mod, it is always best to ask first in that mod's topic. Chances are bigger that the original mod writer keeps an eye on it and can help you quicker and better than when asking in the General Questions area.