Approval MOD

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
13
65%
Very Good
5
25%
Good
2
10%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 20

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Error running Approval MOD SQL in MSSQL

Post by Gregminimum » Mon Dec 18, 2006 9:03 pm

Hi,

I tried running this query in MSSQL Management Studio:

ALTER TABLE phpbb2_forums ADD forum_approve TINYINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_forums ADD forum_posts_unapproved SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_forums ADD forum_topics_unapproved SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_forums ADD forum_last_post_approved SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_topics ADD topic_approve TINYINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_topics ADD topic_replies_unapproved SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_topics ADD topic_last_post_approved SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE phpbb2_posts ADD post_approve TINYINT NOT NULL DEFAULT '0';
UPDATE phpbb2_topics SET topic_last_post_approved = topic_last_post_id;
UPDATE phpbb2_forums SET forum_last_post_approved = forum_last_post_id;

And I get this error message:

Msg 207, Level 16, State 1, Line 0
Invalid column name 'topic_last_post_approved'.

It didn't do anything to the tables. I have PHPbb 2.0.21. The rest of the MOD has not been installed yet. I plan to do that in EasyMod, once the tables are correct.

I thought I had made it all MSSQL friendly. Any ideas?

crazycoders
Registered User
Posts: 20
Joined: Wed Feb 15, 2006 7:27 pm
Location: Canada, Quebec, Beloeil
Contact:

Post by crazycoders » Tue Dec 19, 2006 3:19 am

You say you did not get any errors while executing :
ALTER TABLE phpbb2_topics ADD topic_last_post_approved SMALLINT NOT NULL DEFAULT '0';

But you do when you execute this :
UPDATE phpbb2_topics SET topic_last_post_approved = topic_last_post_id;

Doesn't really make sense... cause the first one creates the column, if it did fail it's normal your second statement fails... Do you have the collumn there in the phpbb2_topics table? You also may need to place a GO; after the alters so that the MSSQL engine processes the alter into the schema...
A life? What is that? Where can i get one? ;P

CrazyOne of the CrazyCoders

thadreamaster
Registered User
Posts: 1
Joined: Tue Dec 19, 2006 8:32 pm
Location: Michigan
Contact:

Mod Installation Issues - Could not open [./mods/approval_mo

Post by thadreamaster » Tue Dec 19, 2006 8:40 pm

I am getting following error when trying to install this mod into my current copy of phpbb. I have reset folder permissions and installed "easy mod" per the mod instructions. Can any of you tell me what might be wrong here?

Thanks in advance.
Jeff Davis
professional entrepreneur
Dreamsites...websites only better

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Re: Mod Installation Issues - Could not open [./mods/approva

Post by uncle.f » Tue Dec 19, 2006 9:14 pm

thadreamaster wrote: I am getting following error when trying to install this mod into my current copy of phpbb. I have reset folder permissions and installed "easy mod" per the mod instructions. Can any of you tell me what might be wrong here?


If EasyMOD cannot open the approval mod file it is most likely to be file permissions problem. Which OS are you using? Have you installed other MODs using EasyMOD before on this board? I think you might be better off asking for support in EasyMOD forums...

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Post by Gregminimum » Tue Dec 19, 2006 9:20 pm

crazycoders wrote: . . . You also may need to place a GO; after the alters so that the MSSQL engine processes the alter into the schema...


Yes. I had to run the ALTER code first and then later run the UPDATE code

Thanks

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Failed installation with EasyMod

Post by Gregminimum » Tue Dec 19, 2006 9:25 pm

After trying to install with EasyMod, I get several lines like this:

Warning: ftp_site(): 'SITE CHMOD 0644 functions_post.php.txt': command not understood in D:\Websites\www.minimum.com\bb\admin\em_includes\em_ftp.php on line 1078

and also this in Error Detail:

Critical Error

FIND FAILED: In file [includes/functions_post.php] could not find:

$meta
$message
return false;

MOD script line #1239 :: FAQ :: Report

There is lots more on the page, but I think the above is the important part. What should I fix?

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Re: Failed installation with EasyMod

Post by uncle.f » Tue Dec 19, 2006 9:36 pm

Gregminimum wrote: After trying to install with EasyMod, I get several lines like this:
Warning: ftp_site(): 'SITE CHMOD 0644 functions_post.php.txt': command not understood in


It seems that you are trying to run EasyMOD which is set up to use FTP mode on Windows. Are you running FTP server on Windows? I think you should change your EasyMOD settings to use "Windows" mode.

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Re: Failed installation with EasyMod

Post by Gregminimum » Tue Dec 19, 2006 9:59 pm

uncle.f wrote: I think you should change your EasyMOD settings to use "Windows" mode.


I can't find "Windows" mode in the EasyMOD settings.

I have File Access, Writing set to Buffer and FTP.
Also I have File Access, Moving set to Automated FTP.

Do you mean to change Writing to Server
and Moving to Copy?

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Re: Failed installation with EasyMod

Post by uncle.f » Tue Dec 19, 2006 10:10 pm

Gregminimum wrote: Do you mean to change Writing to Server
and Moving to Copy?


Quite likely, but I am not sure. Now I remember that the "Windows" option I am talking about is presented only when you install EasyMOD...

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Trying to install with EasyMOD

Post by Gregminimum » Wed Dec 20, 2006 12:50 am

In EasyMOD, Settings, File Access,
I changed Writing to Server and
Moving to Copy, as I suggested,
but now I have a different error:

Critical Error

Function Trace: open_files[5]->modio_open[3]

Could not open [./mods/approval_mod/processed/index.php.txt] for writing.
MOD script line #104 :: FAQ :: Report

Is this a permissions problem?

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Re: Trying to install with EasyMOD

Post by uncle.f » Wed Dec 20, 2006 1:10 am

Gregminimum wrote: In EasyMOD, Settings, File Access,
I changed Writing to Server and
Moving to Copy, as I suggested


Just to confirm - those are the correct settings for Windows. I have EasyMOD installed on my Windows PC and it works fine with the "Server" and "Copy" settings.
but now I have a different error
Is this a permissions problem?


On Windows - unlikely. Probably the files are missing. I suggest clean the directories under \admin\mods\ and try it again.

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Post by Gregminimum » Wed Dec 20, 2006 4:17 am

Probably the files are missing. I suggest clean the directories under \admin\mods\ and try it again.


I wasn't sure exactly what you meant by 'clean'.

So I removed the directories \admin\mods\backups and \admin\mods\processed because they were not there when I first uploaded the MOD.

Then my file structure was just these 3 items in \approval_mod:
\root\
\approval.mod
\readme.txt

Then I tried it again and got this:

Warning: mkdir(./mods/approval_mod/processed): Permission denied in D:\Websites\www.minimum.com\bb\admin\em_includes\em_modio.php on line 184

Warning: chmod(): No such file or directory in D:\Websites\www.minimum.com\bb\admin\em_includes\em_modio.php on line 185

Warning: mkdir(./mods/approval_mod/backups): Permission denied in D:\Websites\www.minimum.com\bb\admin\em_includes\em_modio.php on line 213

Warning: chmod(): No such file or directory in D:\Websites\www.minimum.com\bb\admin\em_includes\em_modio.php on line 214

Installation Failed
EasyMOD encountered the following error(s). A general error could be ABC. A critical error means D and you should do XYZ.


Error Detail

Critical Error

Function Trace: open_files[5]->modio_open[3]

Could not open [./mods/approval_mod/processed/index.php.txt] for writing.
MOD script line #104 :: FAQ :: Report

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Wed Dec 20, 2006 9:17 am

Gregminimum wrote: Warning: mkdir(./mods/approval_mod/processed): Permission denied in D:\Websites\www.minimum.com\bb\admin\em_includes\em_modio.php on line 184


Hmm it does look like a permission problem. Are you logged on with a normal user account or administrator-like account? Check permissions on your phpBB installation dirs. Having said that, if you are an Administrator on Windows this is very unlikely to be the problem.

Gregminimum
Registered User
Posts: 59
Joined: Sun Oct 22, 2006 11:04 pm
Location: Blaine, WA
Contact:

Error on "Click HERE to View Your Message"

Post by Gregminimum » Wed Dec 20, 2006 8:12 pm

My server admin applied write permissions and it successfully installed with EASYMOD.

It seems to work properly, except that when a user submits a reply, and then goes "Click HERE to View Your Message" instead of their message, they see this error message:

Could not obtain topic information

DEBUG MODE

SQL Error : Column 'phpbb2_forums.forum_approve' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, COUNT(p2.post_id) AS prev_posts, f.forum_approve, t.topic_approve FROM phpbb2_topics t, phpbb2_forums f, phpbb2_posts p, phpbb2_posts p2 WHERE p.post_id = 221 AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= 221 AND f.forum_id = t.forum_id GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC

Line : 158
File : viewtopic.php

When you go back and look at the forum, the message is posted properly, it is visible to the user and hidden from others, the email goes to the moderator, and the moderator can approve it successfully and it all looks right. The only problem I can find is as above, when they go "Click HERE to View Your Message" they get that error message above.

I'm probably getting in over my head, but could I just add f.forum_approve, in the GROUP BY clause around line 151 in viewtopic.php?

Edit some hours later: Yes, I added f.forum_approve and also t.topic_approve in the GROUP BY clause around line 151 in viewtopic.php and I haven't been able to get the error any more. Seems like a great mod, even without groups approval. I'll vote after I have some experience with it. Thanks.
Last edited by Gregminimum on Thu Dec 21, 2006 3:48 am, edited 1 time in total.

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Re: Error on "Click HERE to View Your Message"

Post by uncle.f » Thu Dec 21, 2006 3:42 am

Gregminimum wrote: It seems to work properly, except that when a user submits a reply, and then goes "Click HERE to View Your Message" instead of their message, they see this error message


Hmmm... So MS SQL server does not like that query. I see...

I had no chance to test this MOD with anything else but MySQL 5.0. It is definitely OK with MySQL but perhaps MS SQL is more strict in this regard. I need to research this.
I'm probably getting in over my head, but could I just add f.forum_approve, in the GROUP BY clause around line 151 in viewtopic.php?


That most likely should fix it. The tricky part is where exactly in the GROUP BY clause it should be inserted. At the moment I cannot say if the order of the items in the GROUP BY clause is important or not. I will get back to you on this. Meanwhile, perhaps you could do your own testing.

Post Reply

Return to “[2.0.x] MOD Database Releases”