[MODDB] Approval MOD v2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
jerx
Registered User
Posts: 167
Joined: Fri Sep 02, 2005 4:27 am

Post by jerx »

I need this mod for my site. The old version seems to be sufficient, but I would not mind to have the new features. ;)

Do you suggest waiting for this mod or using the old one? Will it be available for download before validation by phpbb mod team? If so, is it safe to use the mod on a life site?
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

jerx wrote: Do you suggest waiting for this mod or using the old one?


I suggest waiting. It will be well worth it. Plus, I think the wait will be very short now.
Will it be available for download before validation by phpbb mod team?


Yes, as a release candidate.
If so, is it safe to use the mod on a life site?


No. Not until it is validated. Having said that, it would greatly help if you could test it and report any issues. This way we can ensure that the released version is more reliable.
jerx
Registered User
Posts: 167
Joined: Fri Sep 02, 2005 4:27 am

Post by jerx »

Thanks for your quick reply!

I think I have a problem. I really like to wait for the new version, but I cannot wait until the mod has been validated. I am afraid that this would take too long (2-3 month?).

I am leaning towards using the release candidate on the life site. Usually a release candidate is pretty stable and there are only minor bug fixes. And if there will be big problems with this mod, I could restore the old files and undo the database changes.

Looking forward to test the mod.
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

This is the post you've been waiting for :wink:

Approval Groups MOD renamed into Approval MOD v2.0 (RC1) IS OUT!

I have implemented all of the wishes asked for in this thread as well as in the original Approval MOD thread. The highlights include:

- New user/group 'Approval Level' permission
- Approval by Ranks (i.e. by number of posts, so much asked for)
- View all unapproved posts (for mods/admins)
- Approve topic only (not the replies)
- Topic starter can approve posts
- Lots of smaller bells and whistles...

Please read the first and the second post of this topic for more detailed info as I have almost completely rewritten it.

Hope you enjoy this MOD...
User avatar
polkadotcat
Registered User
Posts: 53
Joined: Thu Jun 23, 2005 11:11 pm
Contact:

Post by polkadotcat »

Cool, I have been looking forward to trying this out. I really liked the work you did on the other version too.
I'm just a girl in the world...
polkadotcat's wee world...
angelp1ay
Registered User
Posts: 175
Joined: Tue Dec 23, 2003 1:32 pm
Location: Bristol, UK
Contact:

Post by angelp1ay »

uncle.f wrote: Approval Groups MOD renamed into Approval MOD v2.0 (RC1) IS OUT!

Will you be providing an upgrade path through future updates from RC1?
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

angelp1ay wrote:
uncle.f wrote:Approval Groups MOD renamed into Approval MOD v2.0 (RC1) IS OUT!

Will you be providing an upgrade path through future updates from RC1?


If you mean from RCx -> Released Version, then yes (as I do not expect any major changes in the code).

If you mean v1.0.0 -> v2.0.0, then no.
angelp1ay
Registered User
Posts: 175
Joined: Tue Dec 23, 2003 1:32 pm
Location: Bristol, UK
Contact:

Post by angelp1ay »

uncle.f wrote: If you mean from RCx -> Released Version, then yes (as I do not expect any major changes in the code).

I meant this :)

Brilliant, I'll add it to my install queue, prob install it tomorrow :)
sceltic
Registered User
Posts: 64
Joined: Fri Nov 04, 2005 1:24 pm
Location: Ontario

Post by sceltic »

Looks fantastic, well done and thanks for all the efforts and sharing.
I know this is test phase but!
one general question is - to your knowledge or best guess, are there any mod types that will probably conflict with this.
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

sceltic wrote: one general question is - to your knowledge or best guess, are there any mod types that will probably conflict with this.


As I said in the beginning of this thread, this MOD most likely will not be compatible with any other MOD that drastically changes forum/topic viewing and posting behaviour, such as forum hierarchy, announces suite, etc. Theoretically, it is possible to make it compatible but that would mean running additional SQL queries and implementing additional code to work around those MODs. That is something I am not prepared to do at this stage.

I would like to ask everybody: please, give your feedback!

If you installed this MOD and it works for you, please post a short message to tell which MODs/Styles you are running on your board. People tend to post here only when they have problems and or questions (which is fine, of course) but at this stage it would be very nice to know about successful installations too.
jerx
Registered User
Posts: 167
Joined: Fri Sep 02, 2005 4:27 am

Post by jerx »

Ok, I have installed the mod. Although the mod instructions are very good, it took me at least 2 hours to modify all files. Either I am very slow or it is because I was adding it to a heavy modded phpbb. Sometimes I had to look at the original files to find the right spot.

I have only one issue with this mod. The "view unapproved posts" link on index.php shows me an incorrect formatted list. I have no clue how to fix the problem. The odd thing is that if I use the search function (show as posts or topics, both work fine), the list is not distorted. Do you have an idea which file/code might be the culprit?

Besides this, everything is fine. Thank you for this great mod!!!

I am using it on a premodded phpbb called orion. There are many many mods integrated (extreme styles, global announcements, ctracker, attachment, download, photo album, etc) and I added a few more. The style is based on fisubsilversh (which is based on subsilver).
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

jerx wrote: I am using it on a premodded phpbb called orion. There are many many mods integrated (extreme styles, global announcements, ctracker, attachment, download, photo album, etc) and I added a few more. The style is based on fisubsilversh (which is based on subsilver).


That is quite amazing!! So many mods and it still works! Thank you for your feedback!
Although the mod instructions are very good, it took me at least 2 hours to modify all files.


I wasn't too sure about the time estimate since I never installed my MOD by hand :) I am going to change the time estimate to 1.5 hours in the next version...
The "view unapproved posts" link on index.php shows me an incorrect formatted list. I have no clue how to fix the problem. ... Do you have an idea which file/code might be the culprit?


If your board is on the Internet you could give me a moderator access to it and I will try to locate the problematic code. Alternatively, (which is a better option) you could send me ALL of your board files (except the attachments in the "files" directory) as well as exported SQL tables in one archive. My e-mail address is in the first post of this thread.
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

Just thinking further about that problem with searching for unapproved posts. At the moment I really cannot imagine why you get corrupt HTML output, since the Approval MOD does not modify any HTML templates related to search functionality. In fact, all it does is modify 2 search queries adding new conditions to it and that is all. This is the last place I would expect HTML related problem... :? I need to look at your search.php file and search related templates (from the style(s) you use) first and foremost..
jerx
Registered User
Posts: 167
Joined: Fri Sep 02, 2005 4:27 am

Post by jerx »

I really appreciate your help. Thank you for your kind offer! I have sent you an email. Let me know if there is anything else I can do.
User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f »

jerx wrote: I really appreciate your help. Thank you for your kind offer! I have sent you an email. Let me know if there is anything else I can do.


Hello, I had a look at your forum and decided to answer here in the topic, because this information may be useful to somebody else. I did all my testing with FireFox 2 and Internet Explorer 7.

First of all, regarding search for unapproved posts - yes I see the problem, but it is nothing to do with the Approval MOD. You mentioned that normal search for posts is working fine, however, this is not true. Please try searching for the word "test" and choose "display results as posts". You will see that all the results after the first one are shifted to the right. Also, look at the very bottom of that search results page and you will see that it is as broken as when you do the "unapproved posts search". Clearly, the problem lies within "search_results_posts.tpl" template or (which is less likely) with another MOD that modifies the data inserted in that template so that the HTML is broken. In fact, if you try to validate that search results page with W3C validator, you will see at least 3 errors about the <table> tags closed "too early". As I said in my previous post, Approval MOD does not modify any search related templates, so the Approval MOD cannot be "blamed" for the broken HTML code. I am thinking about adding the approval button to each search result (which probably will reqiure search_result_posts.tpl modification) but that is not implemented yet. The outcome of this all - find a better Style or find a fix for the current "search_results_posts.tpl" file. Sorry I cannot help you further with that.

That is not all however. After I saw how many mods are installed on your board, I just could not convince myself that it should work flawlessly with the Approval MOD. As soon as I saw that you have "Global Announcements" and "Topic Display Order" MOD installed I decided to check the viewforum.php file. As I suspected, things are not perfect there. The problem is that both the "Global Announcements" and "Topic Display Order" MODs modify the same SQL queries as the Approval MOD (in viewforum.php) and the end result is a bit messy. There are three main SQL queries in viewforum.php to get global announcements, ordinary announcements and ordinary posts data. This is how they should look when "Global Announcements" and "Topic Display Order" MODs are installed:

1st Query which is added by the Global Announcements MOD is already correct in your files. It should look like this:

Code: Select all

//
// All GLOBAL announcement data, this keeps GLOBAL announcements
// on each viewforum page ...
//
// sql modified by approval mod
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, p2.post_approve
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	WHERE t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = $sql_approve_where
		AND u2.user_id = p2.poster_id
		AND t.topic_type = " . POST_GLOBAL_ANNOUNCE . "
	ORDER BY $sql_approve_order";
The second query should be replaced with the following:

Code: Select all

//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
// sql replaced by approval mod
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, p2.post_approve
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = $sql_approve_where
		AND u2.user_id = p2.poster_id
		AND t.topic_type = " . POST_ANNOUNCE . "
	ORDER BY $sql_approve_order";
The third query must be modified (ORDER BY clause). Also, notice one new line starting with $sort_method = ...

Code: Select all

// selected method
$sort_method = get_forum_display_sort_option($sort_value, 'field', 'sort');
$sort_method = ( $sort_method == 't.topic_last_post_id' && $approve_hide ) ? 't.topic_last_post_approved' : $sort_method;
$order_method = get_forum_display_sort_option($order_value, 'field', 'order');
//-- fin mod : topic display order -----------------------------------------------------------------
//-- mod : topic display order ---------------------------------------------------------------------
// here we added
//	, $sort_method $order_method
//-- modify
// sql modified by approval mod
// sql modified by approval mod
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, p2.post_approve
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = $sql_approve_where
		AND u2.user_id = p2.poster_id
		AND t.topic_type <> " . POST_ANNOUNCE . "
		AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . "
		$limit_topics_time
	ORDER BY t.topic_type DESC, $sort_method $order_method
	LIMIT $start, ".$board_config['topics_per_page'];
When I was checking and comparing search.php and viewforum.php files from your installation I noticed that the file revisions on your board are older than mine, which means they did not belong to the latest phpBB 2.0.22 from the start. So I cannot really guarantee that everything will works (in terms of Approval MOD) as designed but if it does and you are happy than I guess it is ok :)

As a side note, I noticed is that the data in your database is stored in UTF-8 format which results in corrupt (double) accented/umlaut characters, since the forum is outputting HTML in ISO-8859-1 encoding (i.e. Ankündigungen instead of Ankündigungen)

That is about all I could see from the quick look ;)
Locked

Return to “[2.0.x] MODs in Development”