Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Latest Comment Panel


Print Track
I recently updated to V 7.00 RC2 and my latest comment page has being showing the following error

Notice: Undefined index: comment_smileys in /home/fhlinux176/c/caernarfon8ball.co.uk/user/htdocs/viewpage.php(34) : eval()'d code on line 21


http://www.caernarfon8ball.co.uk/view...age_id=149



on the bottom of the page it displays my Google Adsense Shoutbox plus my users panel i had not noticed if the Adsense and Shoutbox and Users panel Should Be There or if they were there before upgrade.

6 replies

Thread moved from "PHP-Fusion 6 Support" to "PHP-Fusion 7 Support".

@Druid: It is a custom page, so we need the code, you are using there ;)
My apologies here is the code

CodeDownload  
<!--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="&quot;.BASEDIR.&quot;profile.php?lookup=&quot;.$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="&quot;.BASEDIR.&quot;news.php?readmore=&quot;.$data[">View News Comment</a><br />"; } else if ($data['comment_type'] == "A") { echo "<a href="&quot;.BASEDIR.&quot;readarticle.php?article_id=&quot;.$data[">View Article Comment</a><br />"; } else if ($data['comment_type'] == "P") { echo "<a href="&quot;.BASEDIR.&quot;photogallery.php?photo=&quot;.$data[">View Photo Comment</a><br />"; } else if ($data['comment_type'] == "C") { echo "<a href="&quot;.BASEDIR.&quot;viewpage.php?page_id=&quot;.$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"; ?&gt;</p>

<?php
/*-------------------------------------------------------+
| PHP-Fusion 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";
?>
This is not working in 7.01.03.
Not as a page and not as a panel.
For a custom Page try this...
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| <a href="http://www.php-fusion.co.uk/" target="_blank" title="autolink">http://www.php-fu...</a>
+--------------------------------------------------------+
| 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 <a href="http://www.gnu.org/licenses/agpl.html." target="_blank" title="autolink">www.gnu.org/licen...</a> Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

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"wink;
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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink."'>";
echo $comment_link;
echo "</td>\n";

echo "<td class='".($i% 2==0?"tbl1":"tbl2"wink."'>";
echo $comment_name." <span class='small'>".$locale['global_071'].showdate("longdate", $data['comment_datestamp'])."</span>";
echo $comment_message;

echo "</td>\n</tr>\n";
$i++;
}
echo "</table>\n";
} else {
echo "<center>".$locale['c101']."</center>\n";
}
closetable();



?>[/syntaxhighlighter]

For A panel try this...

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| <a href="http://www.php-fusion.co.uk/" target="_blank" title="autolink">http://www.php-fu...</a>
+--------------------------------------------------------+
| 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 <a href="http://www.gnu.org/licenses/agpl.html." target="_blank" title="autolink">www.gnu.org/licen...</a> Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

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"wink;
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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink {
$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"wink."'>";
echo $comment_link;
echo "</td>\n";

echo "<td class='".($i% 2==0?"tbl1":"tbl2"wink."'>";
echo $comment_name." <span class='small'>".$locale['global_071'].showdate("longdate", $data['comment_datestamp'])."</span>";
echo $comment_message;

echo "</td>\n</tr>\n";
$i++;
}
echo "</table>\n";
} else {
echo "<center>".$locale['c101']."</center>\n";
}
closetable();[/syntaxhighlighter]

BTW: There is no Group Access on this.
author Druid
forumSuspected Bugs and Errors - 8
replies7 posts
viewed17,454 times
activeLast updated on 9 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Craig, Druid, Yxos, Basti, Jack Daniels