Jump to content
TNG Community

Comments mod + Template #19 (or #6 or #8) = DB Error

Recommended Posts


Hi All,

There was - as I remember - a post regarding this subject. I can't find it now so maybe I'm not correct.

Anyway: Installing the Comments mod when you use template #19 will give a database error when you click the Create DB Tables button. No tables are created.


The reason is that in topmenu.php there is this:

echo tng_icons(1, $title);

This call to tng_icons() includes execution of the function get_find_menu() that in all other templates is called from index.php.
The function is modified by the Comments mod to read the tng_commentsvisits table.


As I use the topmenu.php for the "report DB table creations" page, the table is not created when the function is called in this instance. Hence the error.
This is not good and in my view a break of the TNG standard (if there is one). As it's called from index.php in all other templates I don't think it's good programming practice to change it like this.

A solution for the future might be to change the table for a cookie that is valid on only one device and may or may not be deleted :-(

But it seems okay to completely install the mod using another template (I tested with #1) and then switch to template #19.

Sigh... I don't know...


Edited by XerxX
Completed subject

Share this post

Link to post
Share on other sites

NOTE the changed subject!


Darrin pointed out to me that templates #6 and #8 work the same way re. DD-menus and Left icons as template #19.

But instead of editing the OP I publicly say that I was wrong claiming that all other templates are using the same workflow. They obviously don't.

And as there are other templates doing the same thing I shouldn't have said it was bad programming practice. I'm sorry for that.


I will add this to the Wiki page:

To install the mod under templates #6, #8 or #19, you first have to switch to another template, then install the mod completely and then switch back to your prefered template.


Have a nice day (I've got -5 degC)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now