Hey VBgamer, I use this for SSI output, but it gets all latest articles. I just want to select those articles from a specific category ID:
function ssi_articleslist($limit = null, $output_method = 'echo')
{
global $context, $mbname, $txt, $smcFunc, $modSettings, $user_info, $scripturl, $user_info;
if ($limit === null)
$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 5;
else
$limit = (int) $limit;
$context['start'] = (int) $_REQUEST['start'];
$dbresult = $smcFunc['db_query']('', "
SELECT a.ID_ARTICLE, a.title, a.date, a.rating, a.totalratings, m.real_name, a.ID_MEMBER, a.description, a.views, a.commenttotal
FROM {db_prefix}articles AS a
LEFT JOIN {db_prefix}members AS m ON (a.ID_MEMBER = m.ID_MEMBER)
WHERE a.approved = 1 ORDER BY ID_ARTICLE DESC LIMIT $context[start]," . $limit);
$context['articles_listing'] = array();
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
$context['articles_listing'][] = $row;
$smcFunc['db_free_result']($dbresult);
foreach($context['articles_listing'] as $row)
{
echo '', timeformat($row['date'], '%d-%m'), ' <a href="' , $scripturl , '?action=articles;sa=view;article=', $row['ID_ARTICLE'], '">', $row['title'], '</a><br /><span style="font-size: 9px; font-family: Tahoma; color: #777777;">Geschreven door ', $row['real_name'], ' en is ', $row['views'], ' keer gelezen en heeft ', $row['commenttotal'], ' reactie(s).</span><br />', $row['description'], '<br /><hr />';
}
}
Can you help me with this?