News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Beta Post Moderation by Grudge

Started by jazz, November 02, 2004, 04:39:05 AM

Previous topic - Next topic

jazz

I'm trying to install this mod and I'm the following SQL error:

Database Error
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD moderatedPosts int(8) NOT NULL DEFAULT '0'' at line 3
File: /home/carmenrasmusen/public_html/forum/Packages/temp/PostModPdb.php
Line: 43 

Do I need to modify one of the tables?  If so, which one?

Thanks!

Grudge

If the rest of the MOD installed then just add that line to your boards table. If it didn't I need to look at the MOD tonight to fix the syntax!
I'm only a half geek really...

jazz

No it didn't install.  Here's the actual message without smilies.


jazz

Does anyone know if there's a fix for this?

Thanks!

Karri

I am getting the same error.  Any help would be appreciated.

Thanks!!!

Oldiesmann

I see what the problem is... Grudge - you forgot a comma in a couple spots...

From PostModPdb.php

// Do this.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}members
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}members
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0'
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);

// Same - literally - for boards.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}boards
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}boards
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0'
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);


Should be
// Do this.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}members
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}members
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0',
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);

// Same - literally - for boards.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}boards
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}boards
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0',
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);
Michael Eshom
Christian Metal Fans

1948Pal

Hi. 
Installed this mod for RC2, I can see the post moderation manager and the post moderated users options in the admin section, but for some reason I can't figure out how to actually make a user "moderated". Any idea?
"No matter how long the river, the river will reach the sea".
Eugene Fitch Ware

Oldiesmann

You have to do that for each board. Currently it's not a per-user option.
Michael Eshom
Christian Metal Fans

1948Pal

This may have been my fault for not clarifying, but I just installed Grudges post moderation mod. I just found In each user's view profile options and settings, there are 3 moderation options; no post, no topics and no topics and posts. And it seems to be fully functional.
Thanks
"No matter how long the river, the river will reach the sea".
Eugene Fitch Ware

Oldiesmann

Ah. I was wrong then. I thought you could only do it per board and not per user. Sorry.
Michael Eshom
Christian Metal Fans

jazz

Quote from: Oldiesmann on November 11, 2004, 04:16:37 PM
I see what the problem is... Grudge - you forgot a comma in a couple spots...

From PostModPdb.php

// Do this.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}members
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}members
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0'
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);

// Same - literally - for boards.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}boards
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}boards
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0'
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);


Should be
// Do this.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}members
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}members
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0',
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);

// Same - literally - for boards.
$request = db_query("
SHOW COLUMNS
FROM {$db_prefix}boards
LIKE 'isPostModerated'", __FILE__, __LINE__);
$need_add = mysql_num_rows($request) == 0;
if ($need_add)
db_query("
ALTER TABLE {$db_prefix}boards
ADD isPostModerated tinyint(4) NOT NULL DEFAULT '0',
ADD moderatedPosts int(8) NOT NULL DEFAULT '0';", __FILE__, __LINE__);


Is there a way I can make these modifications and then install it after it's done?

Oldiesmann

Save the package to your hard drive (instead of downloading it in Package Manager, you should see a URL below the description - click on that), extract everything, make that change and then package everything up in a ZIP file, then go to download new packages and you should see an "Upload Package" area. Upload it that way and it should work.
Michael Eshom
Christian Metal Fans

Grudge

Thanks Oldiesmann,

I'll try fix this in the package
I'm only a half geek really...

jazz

This is now working, and I love it!  Right now it will moderate new posts and posts that are edited.  It's not moderating reply's.  Is there something that can be done to fix this?

Advertisement: