Hi, I'am looking for a mod, that show related articles below an article.
So i have a article named PICTURE DUMP 10, and I want that below that article, the related articles are show, Picture dimp 1, picture 2....etc..
There is already a feature in your Article Options that will 'Show all articles in same category'
Give that a try to see if it's what you need.
Ok ken, I saw that, but then I will get a list of the articles on the right of the article.. I want that a list of the articles below the article...so, above the comments....
You'll have to add some custom code for that. There's a block code snippet that I did (I think it was me), for listing article in a category. You can add that code to the bottom of your article. It will however have to be a php article.
I would be interested in this mod as well. If anybody with the knowledge could take a few minutes to help out that would really appreciated.
If you're related articles are in a category then the mod (code snippet) is already there.
Sorry kind of a newbie as far as finding what code to snip or what file to look in for that matter.
Here's the code for a category. Just change the category number variable to the category ID that you want to list the articles from.
global $db_prefix, $scripturl;
$category = 1;
$query = db_query(
"SELECT id, subject
FROM {$db_prefix}tp_articles
WHERE category = $category
AND off = 0
AND approved = 1
ORDER BY subject", __FILE__, __LINE__);
echo '<div style="overflow: auto; width: 100%;">';
$i = 0;
echo '<table cellspacing="0" cellpadding="0">
<tr>';
while ($row = mysql_fetch_assoc($query)){
echo '<td style="padding-left: 20px;"><a href="' . $scripturl . '?page=' . $row['id'] . '">' . $row['subject'] . '</a></td>';
$i++;
if ($i > 2){
echo '</tr><tr>';
$i = 0;
}
}
echo '</tr></table>';
echo '</div>';
Thanks IchBin, But I think i must be doing something wrong. It works but Its putting the 'recent articles' ontop of the 'set' catergory of article not at the bottom of each article itself...
You're putting it in the block then. In TP 0.9.8 you don't have a bottom block option. You'll have to put it in the article or put it in the theme code manually. Its up to you.
mmm, the article must be php...if I want to add that code to the article....that's a problem for me..
me too.
Quote from: domeen on October 05, 2007, 07:23:00 AM
mmm, the article must be php...if I want to add that code to the article....that's a problem for me..
Not if you make a PHP article. :)