View Full Version : Customising Sitemap
Anima
03-21-2007, 06:01 AM
I'm still learning the workings of PHP, and I'm trying to customise the sitemap to display author and date of publication.
Can anyone assist?
shketuljko
03-22-2007, 10:14 AM
If you want to change anything in sitemap you need to change this file:
VIVVO_ROOT/plugins/sitemap/sitemap.php
in query you need to add two arguments like as
a.author as author and a.created as datepub.
You need to replace query with this code:
$query = "SELECT a.author as author, a.created as datepub, c.category_name,c.parent_cat,c.id, a.id AS aid,a.title
FROM tblCategories c
LEFT JOIN tblArticles a ON c.id = a.category_id
WHERE status = 1 and created <= '$cur_date'
ORDER BY c.order_num,c.parent_cat, c.id, a.created";
Around 25 line you need to format article.
Exp:
$articles.= "<div class=\"plainTxt\">";
$articles.= "» ";
$articles.= '<a href = "'.$url.HTML_show_friendly_url($row[aid],'').'">'.$row['title'].'</a>';
$articles .= ' '.$row['datepub'] . ' - ' . $row['author'];
$articles.= '</div>';
I hope so that you have lucky with customization sitemap.
Anima
03-23-2007, 03:06 AM
Many thanks -- that all makes sense :)
I'll be implementing this later today and will reply again to let you know the outcome.
Anima
03-23-2007, 05:24 AM
Excellent help, thanks! Although I do have a couple of minor additions if possible --
How can I reformat the date to present as "21 Mar 2007" rather than "2007-03-21 00:00:00"
And also - how can I make the author names link through to their profiles?
how do I remove article list, only display categories?
I always got
"Allowed memory size of xxxxxxxxxxxxxx bytes exhausted"
for site map page, I think it is because of my thousands of published articles...
------------
any way, beg self always better than beg others, here is my updates for sitemap.php, which only show 10 latest articles for each cat:
$article_list_output .= HTML_article_list(
false,
'box_article_list.tpl',
array('BOX_TITLE' => $cat_breadcrumb, 'BOX_ID' => 'box_sitemap_' . $row['id']),
'article_title.tpl',
array(),
array('a.status' => 1, 'a.created' => $cur_date, 'a.cid' => $row['id']),
'created',
'descending',
10
);
newcomer11
09-08-2007, 03:54 AM
Work like a charm, thank you, this is necessary for site which have thousands of articles.
________
Angelina Jolie (http://www.angelinajoliepics.net/)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.