This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

old code!
#1

hi! I'm testing a new installation with export/import sql..and seems to work fine..but the same code (2.4) return errors or nothing

<?php include("comments/latest_comments.php");?>
PHP Code:
<?php
//define('IN_COMMENTICS', 'true');
require_once "includes/db/connect.php";
// Start of 'Recent Comments' ***************************************************************************​*******************
$comments = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' ORDER BY `dated` DESC LIMIT 5");

while (
$comment = mysql_fetch_array($comments)) {

$page_query = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` WHERE `id` = '" . $comment["page_id"] . "'");
$page = mysql_fetch_assoc($page_query);

$comment_snippet = $comment["comment"];
$comment_snippet = str_ireplace("<br />", " ", $comment_snippet);
$comment_snippet = str_ireplace("<p></p>", " ", $comment_snippet);
$comment_snippet = strip_tags($comment_snippet);
$comment_snippet = html_entity_decode($comment_snippet, ENT_QUOTES, 'UTF-8');
$comment_snippet = substr($comment_snippet, 0, 20);
$comment_snippet = htmlspecialchars($comment_snippet, ENT_NOQUOTES, 'UTF-8');

echo
$comment["name"] . " in <a href='" . $page["url"] . "'>" . $page["reference"] . "</a> - " . $comment_snippet ."..";
echo
"<br/>";

}
// End of 'Recent Comments' ***************************************************************************​*********************

?>

Access Denied
PHP Code:
<?php
require_once "includes/db/connect.php";
// Start of 'Most Commented' ********************************************************

$comments = mysql_query("SELECT `page_id`, COUNT(`page_id`) AS `total` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' GROUP BY `page_id` ORDER BY `total` DESC LIMIT 1");

while (
$comment = mysql_fetch_assoc($comments)) {

$page_query = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` WHERE `id` = '" . $comment["page_id"] . "'");
$page = mysql_fetch_assoc($page_query);
//$n=$page["url"];
//$b="<strong><font color=#339900> $n </font></strong>";

echo "<a href='" . $page["url"] . "'>" . $page["reference"] . "</a> (" . $comment["total"] . ")";
}
?>
nothing
PHP Code:
<?php
require_once "includes/db/connect.php";

// Start of 'Recent Comments' ********************************************************
$comments = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' ORDER BY `dated` DESC LIMIT 5");

while (
$comment = mysql_fetch_array($comments)) {

$page_query = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` WHERE `id` = '" . $comment["page_id"] . "'");

$page = mysql_fetch_assoc($page_query);

$n=$comment["name"];

$b="<strong><font color=rgb(255,0,255)>$n</font></strong>";

echo
$b . " in <a href='" . $page["url"] . "'>" . $page["reference"] . "</a> alle " . date("G:i (d-M)", strtotime($comment["dated"]));

echo
"<br/>";

}

?>
nothing
PHP Code:
<?php

require_once "includes/db/connect.php";

// Start of 'Top Posters' *******************************************************************************************

$names = mysql_query("SELECT `name`, COUNT(`name`) AS `total` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' GROUP BY `name` ORDER BY `total` DESC LIMIT 5");

while (
$name = mysql_fetch_assoc($names)) {

$n=$name["name"];

$b="<strong><font color=#990066> $n </font></strong>";

echo
$b . " (" . $name["total"] . ")";

echo
"<br/>";

}

// End of 'Top Posters' ********************************************************
?>
nothing

cau you help me ?
tks
Reply
#2

Hi,

For Commentics v2.5, try the Extractor add-on:
http://www.commentics.org/add-ons.php

Have you completed the interview?
Reply
#3
Smile 

(08-Jun-2014, 09:15 PM)Steven Wrote:  Hi,

For Commentics v2.5, try the Extractor add-on:
http://www.commentics.org/add-ons.php

solved thanks Shy
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by 2hands
30-Dec-2012, 01:34 AM
Last Post by aivarlipp
28-Sep-2010, 05:08 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)