2011-03-29, 23:06:39
great plugin.
I add something that I think is missing
check it and if you like add
usage:
in template sidebar.php add something like
I add something that I think is missing
Code:
/*******************************************************
* @function list_articles
* @param $page_id - id of page to show
* @param $n - number of articles
* @action displays news articles on theme/site page
*/
function list_articles($page_id,$n = 5){
$articles = get_articles();
if (!empty($articles)) {
// $url = get_page_url(TRUE);
// $url .= preg_match('/\?/', $url) ? '&' : '?';
$url="index.php?";
?>
<ul class="article_list">
<?php
foreach ($articles as $article) {
if ($n--<0) break;
$id = basename($article, '.xml');
$data=getXML(ARTICLEDATA . $id . '.xml');
$title = stripslashes(htmlspecialchars_decode($data->title, ENT_QUOTES));
printf("<li><a href=\"%sid=%s&article=%s\">%s</a></li>",$url,$page_id,$id,$title);
}
?>
</ul>
<?php
}
}
check it and if you like add
usage:
in template sidebar.php add something like
Code:
<div class="section" id="news_list">
<h2>Latest news</h2>
<?php list_articles('vesti'); ?>
</div>