Follow us on Facebook and Twitter!

Recent Comments
#1
Hi,
I am using Commentics included in my pages.

When I use the 'Recent Comments' add-on on just 1 page, it works fine.

When I include it in more than 1 page, I'm getting an error as :

Code:
Notice: Constant IN_COMMENTICS already defined in /home/domain/domains/mydomain.com/public_html/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code on line 1

This is a directory/file of my cms.

Is there a way to prevent this error?

Thanks
JohN
Reply
#2
Hi,

Try changing this:

PHP Code:
define('IN_COMMENTICS''true'); 

to:

PHP Code:
if (!defined('IN_COMMENTICS')) { define('IN_COMMENTICS''true'); } 
Have you completed the interview?
Reply
#3
(17-Jun-2013, 03:24 PM)Steven Wrote: Hi,

Try changing this:

PHP Code:
define('IN_COMMENTICS''true'); 

to:

PHP Code:
if (!defined('IN_COMMENTICS')) { define('IN_COMMENTICS''true'); } 

Hi,
Thanks for the speed reply!

This generates an other error:

Code:
Notice: Undefined variable: cmtx_mysql_table_prefix in /home/domain/domains/mydomain.com/public_html/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code on line 8
Reply
#4
I'm not getting the logic of these errors.

What is tried is:

I've placed the code for the Recent Comments as a test in a separate php file.
Removed the add-om from the home page and placed it only on an other page. The page is not a sub page but root as well. I've include the test page with [include 'core/com/nl/comments/test.php';]

The errors come up:

Code:
Notice: Constant IN_COMMENTICS already defined in /public_html/core/com/nl/comments/test.php on line 2


Notice: Undefined variable: cmtx_mysql_table_prefix in public_html/core/com/nl/comments/test.php on line 9

If I place [include 'core/com/nl/comments/test.php';] on the home page, it works fine.

I am aware that it seems to be a problem of my cms but as the add-on works fine on the home page, I have hope that it could be solved.
Reply
#5
Did you change line 3 accordingly:

PHP Code:
require_once "comments/includes/db/connect.php"
Have you completed the interview?
Reply
#6
Another thing I've thought of.. if you're calling the connect.php file above from inside a function it might be that you need to globalise the $cmtx_mysql_table_prefix variable first. Try adding this at the beginning of your page:

PHP Code:
global $cmtx_mysql_table_prefix
Have you completed the interview?
Reply
#7
I have tried the
Code:
global $cmtx_mysql_table_prefix;
option, with no result.

I have noticed that I get a bunch of 'Notices' but the data is displayed correctly in between. All new entries are shown as in:

Code:
Notice: Constant IN_COMMENTICS already defined in /public_html/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code on line 1

Notice: Undefined variable: cmtx_mysql_table_prefix in /public_html/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code on line 4

Name: ........
From: ....
At: .....

Remains very strange that all works nice on the home page but the module refuses to do it's job at every other page. (even as a copy of the home page)

So I thought that turning all php error messaging of, would do the trick.

Code:
error_reporting(0);

But that did not keep the notices away.

Though shutting off the error reports should not be the way to go, I'd appreciate it if you have a working option to keep the messages away.

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Recent Comments..again noblues 2 1,930 26-Sep-2013, 06:44 PM
Last Post: noblues
  Recent Comments resp. Pages kooler 2 2,021 02-Aug-2013, 06:29 PM
Last Post: kooler
  Improved Manage Comments Addon MuffinMan 5 3,378 21-Apr-2013, 09:30 PM
Last Post: MuffinMan
  using permalinks on recent comments module otuzel 2 2,313 12-Mar-2013, 11:11 PM
Last Post: otuzel
  Recent Comments Add On Help brande 3 2,990 27-Jan-2013, 10:31 PM
Last Post: Steven
  recent comment add on style brande 0 1,555 23-Jan-2013, 08:08 PM
Last Post: brande
  Add-ons Recent Comments not working ! besric 4 3,703 07-Nov-2012, 05:16 PM
Last Post: besric
  Auto populate your comments table corculator 0 1,873 25-Feb-2012, 01:25 PM
Last Post: corculator
  Cannot get recent comments add on to work stevylake 1 2,184 04-Sep-2011, 01:25 PM
Last Post: Steven

Forum Jump:


Users browsing this thread: 1 Guest(s)