Quote
<?
/*--------------------------------------------+
| PHPFusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| infusion by: Rayxen © 2004-2005 |
| web: http://www.phpfusion-mods.com |
| email: rayxen@phpfusion-mods.com |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
//-------------- Configuration --------------//
$shading = true; // Enable row shading (true/false)
$num_articles = 5; // How many articles to display
if (file_exists(INFUSIONS."articles_list_panel/locale/".$settings['locale'].".php") {
include INFUSIONS."articles_list_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."articles_list_panel/locale/English.php";
}
function display_articles($article,$category,$a_author) {
$display_article = "<tr>\n<td align='left' class='tbl2'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."'>".$article['article_subject']."</a></td>
<td class='tbl2'><a href='".BASEDIR."articles.php?cat_id=".$article['article_cat']."'>".$category."</a></td>
<td align='left' class='tbl2'><a href='".BASEDIR."profile.php?lookup=".$article['article_name']."'>".$a_author."</td>
<td align='center' class='tbl2'>".$article['article_reads']."</td>
<td align='right' class='tbl2'>".$article['article_datestamp']."</td>\n</tr>\n
<tr><td colspan='5' class='tbl1'><span class='small'>".$article['article_snippet']."</span></td></tr>";
return $display_article;
}
opentable($locale['ALP_001']);
$most_recent_articles = dbquery("SELECT * FROM ".$db_prefix."articles ORDER BY article_id DESC"
echo "<table width='100%' cellpadding='0' cellspacing='0' style='text-indent:2px'>\n<tr>\n";
if (dbrows($most_recent_articles)) {
// Display headings
echo "
<td class='tbl1' align='left'><b>".$locale['ALP_002']."</b></td>
<td class='tbl1'><b>".$locale['ALP_003']."</b></td>
<td class='tbl1' align='left'><b>".$locale['ALP_004']."</b></td>
<td class='tbl1' align='center'><b>".$locale['ALP_005']."</b></td>
<td class='tbl1' align='right'><b>".$locale['ALP_006']."</b></td>
</tr>";
// Only display articles that exist
while($article = dbarray($most_recent_articles)) {
if ( $x <= $num_articles ) {
// Calculate date submitted
$article['article_datestamp'] = showdate("forumdate",$article['article_datestamp']);
// Look up Category
$result = dbquery("SELECT article_cat_name FROM ".$db_prefix."article_cats WHERE article_cat_id='".$article['article_cat']."'"
$category = dbresult($result,0);
// Look up Author
$result = dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$article['article_name']."'"
$a_author = dbresult($result,0);
// Display articles
echo display_articles($article,$category,$a_author);
$x++;
}
}
} else {
echo "<tr><td colspan='5' align='center'><p>".$locale['ALP_007']."</p></td></tr>";
}
echo "</table>";
closetable();
tablebreak();
?>
Quote
<tr><td colspan='5' class='tbl1'><span class='small'>".stripslashes($article['article_snippet'])."</span></td></tr>";
Category Forum
Bugs and Errors - 6Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions