<!--p //opentable("Latest Comments"); $i = 0; $result = dbquery( "SELECT * FROM fusion_comments LEFT JOIN fusion_users ON fusion_comments.comment_name=fusion_users.user_id ORDER BY comment_datestamp DESC LIMIT 50" ); if (dbrows($result)) { echo "
<table width='100%' align='center' cellpadding='0' cellspacing='1' class='tbl-border'>
\n"; while ($data = dbarray($result)) { echo "
<tr>
\n
<td class='".($i% 2==0?"tbl1":"tbl2").-->
<p><span class="comment-name">"; if ($data['user_name']) { echo "<a href="".BASEDIR."profile.php?lookup=".$data[">".$data['user_name']."</a>"; } else { echo $data['comment_name']; } $comment_message = nl2br(parseubb($data['comment_message'])); $comment_item_id = $data['comment_item_id']; $comment_type = $data['comment_type']; if ($data['comment_smileys'] == "1") $comment_message = parsesmileys($comment_message); echo "</span> <span class="small">".$locale['041'].showdate("longdate", $data['comment_datestamp'])."</span><br />".$comment_message."<br />"; if ($data['comment_type'] == "N") { echo "<a href="".BASEDIR."news.php?readmore=".$data[">View News Comment</a><br />"; } else if ($data['comment_type'] == "A") { echo "<a href="".BASEDIR."readarticle.php?article_id=".$data[">View Article Comment</a><br />"; } else if ($data['comment_type'] == "P") { echo "<a href="".BASEDIR."photogallery.php?photo=".$data[">View Photo Comment</a><br />"; } else if ($data['comment_type'] == "C") { echo "<a href="".BASEDIR."viewpage.php?page_id=".$data[">View Custom Page Comment</a><br />"; } else { echo "No link."; } echo "\n\n"; $i++; } echo "\n"; } else { echo "</p>
<br />There are no comments.<br /><br />
<p>\n"; } closetable(); echo "\n"; ?></p>
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: latestcomments.php
| Enhanced, W3C passed, non-localized by: Yxos
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once LOCALE.LOCALESET."comments.php";
require_once LOCALE.LOCALESET."admin/main.php";
opentable($locale['c100']);
$result = dbquery("SELECT * FROM ".DB_COMMENTS." c LEFT JOIN ".DB_USERS." u ON c.comment_name=u.user_id ORDER BY comment_datestamp DESC LIMIT 25");
if (dbrows($result)) {
$i = 0;
echo "<table width='100%' align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n";
while ($data = dbarray($result)) {
$comment_name = (($data['user_name']) ? "<a href='".BASEDIR."profile.php?lookup=".$data['comment_name']."' class='slink'>".$data['user_name']."</a>" : $data['comment_name']);
$comment_name = "<span class='comment-name'>".$comment_name."</span>";
$comment_item_id = $data['comment_item_id'];
$comment_type = $data['comment_type'];
$comment_message = parsesmileys(nl2br(parseubb($data['comment_message'])));
$comment_opt = " alt='' border='0' style='border: 0pt none; margin-left: 2px; margin-right: 2px;'";
if ($data['comment_type'] == "N") {
$comment_link = "<a href='".BASEDIR."news.php?readmore=".$data['comment_item_id']."'><img src='".ADMIN."images/news.gif'".$comment_opt." title='".$locale['216']."' /></a>";
} else if ($data['comment_type'] == "A") {
$comment_link = "<a href='".BASEDIR."readarticle.php?article_id=".$data['comment_item_id']."'><img src='".ADMIN."images/articles.gif'".$comment_opt." title='".$locale['203']."' /></a>";
} else if ($data['comment_type'] == "P") {
$comment_link = "<a href='".BASEDIR."photogallery.php?photo_id=".$data['comment_item_id']."'><img src='".ADMIN."images/photoalbums.gif'".$comment_opt." title='".$locale['218']."' /></a>";
} else if ($data['comment_type'] == "C") {
$comment_link = "<a href='".BASEDIR."viewpage.php?page_id=".$data['comment_item_id']."'><img src='".ADMIN."images/c-pages.gif'".$comment_opt." title='".$locale['206']."' /></a>";
} else if ($data['comment_type'] == "K") {
$comment_link = "<a href='".INFUSIONS."the_kroax/embed.php?panel&url=".$data['comment_item_id']."'><img src='".ADMIN."images/faq.gif'".$comment_opt." title='The Kroax' /></a>";
} else if ($data['comment_type'] == "B") {
$comment_link = "<a href='".INFUSIONS."weblog/blog.php?readmore=".$data['comment_item_id']."'><img src='".ADMIN."images/faq.gif'".$comment_opt." title='WebLog' /></a>";
} else {
$comment_link = "<img src='".ADMIN."images/faq.gif'".$comment_opt." />";
}
echo "<tr>\n";
echo "<td class='".($i% 2==0?"tbl1":"tbl2")."'>";
echo $comment_link;
echo "</td>\n";
echo "<td class='".($i% 2==0?"tbl1":"tbl2")."'>";
echo $comment_name." <span class='small'>".$locale['global_071'].showdate("longdate", $data['comment_datestamp'])."</span><br />";
echo $comment_message;
echo "</td>\n</tr>\n";
$i++;
}
echo "</table>\n";
} else {
echo "<center><br />".$locale['c101']."<br /><br /></center>\n";
}
closetable();
require_once THEMES."templates/footer.php";
?>
Category Forum
Suspected Bugs and Errors - 8Labels
None yet
Statistics
5 participants
Notifications
You are not receiving notifications from this thread.
Related Questions