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

Problem with table prefixes
#1

Hi,

I've recently downloaded Commentics to try out on my website, as what I've seen of it so far looks quite good.

Whilst setting it up though I discovered that there appears to be a bug if using the table prefix option. From the error logs I've worked out that the error seems to be something to do with the settings class (in comments/includes/classes/settings.php) not picking up the table prefix variable for some reason - if I set my table prefix manually in the settings class then it all works fine, so I'm using that as a way round it for the moment - just thought it would be best to report it for future updates.

If you need any further details then let me know.

Thanks, Peter.
Reply
#2

Hi,

I can't seem to replicate this problem. I have just installed the script using a table prefix and I added some comments but there were no errors. And if I echo the $mysql_table_prefix variable from inside the file, just before it is used, then it outputs it correctly. What was the exact error message?

Have you completed the interview?
Reply
#3

Hi,

Sounds like it may be something todo with my setup that's stopping it working then - I tried echoing the $mysql_table_prefix variable as well just before it was used and it was blank.

I'm running apache/php/mysql on Windows XP Pro if that helps at all - I should be able to get more exact details and look at the error logs when I get home later this afternoon.

Thanks, Peter.
Reply
#4

Hi,

I've copied the error log messages below:

Code:
[Mon Aug 01 20:38:43 2011] [error] [client 192.168.180.60] PHP Warning:  mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in W:\\Sites\\mysite\\comments\\includes\\classes\\settings.php on line 36
[Mon Aug 01 20:38:43 2011] [error] [client 192.168.180.60] PHP Notice:  Undefined index:  language_frontend in W:\\Sites\\mysite\\comments\\includes\\classes\\settings.php on line 40
[Mon Aug 01 20:38:43 2011] [error] [client 192.168.180.60] PHP Warning:  require(../comments/includes/language//page.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in W:\\Sites\\mysite\\comments\\includes\\commentics.php on line 53
[Mon Aug 01 20:38:43 2011] [error] [client 192.168.180.60] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required '../comments/includes/language//page.php' (include_path='.;W:\\Server\\PHP\\pear') in W:\\Sites\\mysite\\comments\\includes\\commentics.php on line 53

I'm using Apache 2.0, Php 5.2, and MySQL 5.0 installed on Windows XP Pro SP3.

I have been having a couple of other problems as well - it says "Adding comments has been disabled.", even on the example page, and I can't manage to enable them despite trying various combinations of settings on the admin pages. Could this be caused by the same issue that's causing the table prefix problem?

Thanks, Peter.
Reply
#5

Hi,

Is the first setting enabled in Layout -> Form -> Enabled?

Have you completed the interview?
Reply
#6

Hi,

Yes, I've tried that both enabled and disabled.

Thanks, Peter.
Reply
#7

Hi,

Any other ideas on what might be going wrong?

Thanks, Peter.
Reply
#8

Hi,

Sorry but that is the only admin setting which would cause that message to appear.

I don't think the issue is related to the table prefix problem as you seem to have fixed that.

In comments/includes/commentics.php, try commenting out line 123 and 125, like this:
PHP Code:
<?php 
//if (cmtx_is_form_enabled(true)) { //if form is enabled
require $path_to_comments_folder . "includes/template/form.php"; //display form
//}

Have you completed the interview?
Reply
#9

Decided to see if I could track down where the problem is as I like a challenge, however after spending the last hour or so adding debug messages all over the place I'm not sure if I'm any the wiser...!

Best I can tell is that the enabled_form argument somehow isn't getting passed to the __get($name) function in the settings class - I put a debug message for $name in the settings class, and a debug message for $settings->enabled_form, and it doesn't seem to get through. No idea why/how though - might look again tomorrow when I'm more awake.

Thanks, Peter.
Reply
#10

Ok, so I had the same problem and after some searching I managed to find and isolate the problem. It's not really related to the table prefix or even wrong setup. Big Grin
It happens in case you have register_globals OFF on your server (tested both in PHP 5.2.17 and 5.3). If you're not sure, just run phpinfo(); in any PHP script and look for register_globals. If they're OFF, turn them ON.

By the way I believe having them OFF is recommended - and if you happen to have them ON, DON'T use this feature (accessing $_POST['pg'] as $pg etc.).

I don't think this is a fault of Commentics, $GLOBALS is used only in htmLawed.php, external functions that are used by Commentics. Tongue
Code:
/*
htmLawed 1.1.9.5, 6 July 2011
Copyright Santosh Patnaik
LGPL v3 license
A PHP Labware internal utility; www.bioinformatics.org/phplabware/internal_utilities/htmLawed

See htmLawed_README.txt/htm
*/
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
23-Nov-2017, 08:09 PM
Last Post by Steven
08-Jun-2015, 06:22 PM
Last Post by kooler
27-Aug-2013, 02:02 PM
Last Post by Steven
20-Jul-2013, 01:22 PM
Last Post by Steven
19-Mar-2013, 02:37 PM
Last Post by Steven
02-Jul-2012, 08:19 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)