Hello

July 30, 2010, 05:17:00 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
What sNews Is: - sNews is a simple, basic, customizable CMS tool suitable for developers with beginner-to-advanced PHP skills. It is also useful to have a good working knowledge of how to work with, set up and manage MySQL databases. sNews is not - geared towards the end-user who knows little or nothing about building and developing PHP-MySQL based websites.
News: Try sNews 1.7 DEMO
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: RSS Links in Site Map  (Read 3411 times)
bakercad
Administrator
ULTIMATE member
******

Karma: 105
Posts: 1654



WWW
« on: May 16, 2007, 06:20:48 PM »

RSS link in Site Map does not work since RSS links were modified.  This will ADD "RSS Articles", "RSS Pages" and "RSS Comments" to the Site Map

Here's a fix:

In snews.php find this in function sitemap():
Quote
echo $link.'sitemap/">'.l('sitemap').'</a><br />';   
   echo $link.'rss/">'.l('rss_feed').'</a></p>';
   echo '<p><strong>'.l('articles').'</strong></p>';
Replace the red above with the blue below:
Quote
echo $link.'sitemap/">'.l('sitemap').'</a><br />';   
   echo $link.'rss-articles/">'.l('rss_articles').'</a><br />';
   echo $link.'rss-pages/">'.l('rss_pages').'</a><br />';
   echo $link.'rss-comments/">'.l('rss_comments').'</a></p>';

   echo '<p><strong>'.l('articles').'</strong></p>';
« Last Edit: August 24, 2007, 11:19:17 AM by Patric Ahlqvist » Logged

Mika
Administrator
ULTIMATE member
******

Karma: 9
Posts: 1408


WWW
« Reply #1 on: May 16, 2007, 10:51:46 PM »

bob (and anyone else Wink ), if you like, I could recode sitemap to display items formated as unordered list instead of
. That way we could utilize new rss_contents() funtion like this
Quote
echo '<li>'.$link.'contact/">'.l('contact').'</a></li>';
echo '<li>'.$link.'sitemap/">'.l('sitemap').'</a></li>';
rss_links();
echo '<li>'.$link.'rss/">'.l('rss_feed').'</a></li>';
echo '<p><strong>'.l('articles').'</strong></p>';
Official apology - I completely forgot that we actually have RSS links in sitemap :/
« Last Edit: August 24, 2007, 11:19:37 AM by Patric Ahlqvist » Logged

http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version
mosh
Sr. Member
****

Karma: 62
Posts: 410



WWW
« Reply #2 on: May 16, 2007, 11:09:31 PM »

lol  Cheesy
Logged

Mika
Administrator
ULTIMATE member
******

Karma: 9
Posts: 1408


WWW
« Reply #3 on: May 16, 2007, 11:29:58 PM »

Wink

This is modified sitemap function which displays all the stuff as <ul>
Code:
//SITEMAP
function sitemap() {
echo '<h2>'.l('sitemap').'</h2>';
echo '<p><strong>'.l('pages').'</strong></p>';
echo '<ul>';
$link = '<li><a href="'.db('website');
echo $link.'" title="'.l('home').'">'.l('home').'</a></li>';
echo $link.'archive/" title="'.l('archive').'">'.l('archive').'</a></li>';
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 AND published = '1' ORDER BY date";
$result = mysql_query($query);
$home = l('home_sef');
while ($r = mysql_fetch_array($result)) {
$page_title = $r['title'];
if ($r['id'] != s('display_page')) {echo $link.$home.'/'.$r['seftitle'].'/" title="'.$page_title.'">'.$page_title.'</a></li>';}
}
echo $link.'contact/">'.l('contact').'</a></li>';
echo $link.'sitemap/">'.l('sitemap').'</a></li>';
rss_links();
echo '</ul>';
echo '<p><strong>'.l('articles').'</strong></p>';
echo '<ul>';
$art_query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = '1'";
$query = $art_query." AND category = 0 ORDER BY date DESC";
$result = mysql_query($query);
echo '<li><strong><a href="'.db('website').'" title="'.l('home').'">'.l('home').'</a></strong></li>';
while ($r = mysql_fetch_array($result)) {
$art_title = $r['title'];
echo $link.l('home_sef').'/'.$r['seftitle'].'/" title="'.$art_title.'">'.$art_title.'</a></li>';
}
echo '</ul>';
$cat_query = "SELECT * FROM ".db('prefix')."categories WHERE published = 'YES' ORDER BY catorder";
$cat_result = mysql_query($cat_query);
while ($c = mysql_fetch_array($cat_result)) {
echo '<p><strong><a href="'.db('website').$c['seftitle'].'/" title="'.$c['description'].'">'.$c['name'].'</a></strong></p>';
$catid = $c['id'];
$query = $art_query." AND category = $catid ORDER BY id DESC";
$result = mysql_query($query);
echo '<ul>';
while ($r = mysql_fetch_array($result)) {
$date = date(s('date_format'), strtotime($r['date']));
echo $link.$c['seftitle'].'/'.$r['seftitle'].'/" title="'.$r['title'].'">'.$r['title'].'</a></li>';
}
echo '</ul>';
}}
« Last Edit: August 24, 2007, 11:13:13 AM by Patric Ahlqvist » Logged

http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version
Pages: [1]
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!