Firefox PHP

Message Manager admin module for mass moderation of messages

Posted by chup 
All files from this thread

File Name File Size   Posted by Date  
message_manager_alpha.gif 57.7 KB open | download chup 03/13/2007 Read message
Message Manager admin module for mass moderation of messages
March 09, 2007 10:08PM
Hi,

I'm working on a Message Manager admin module since I couldn't find any around.
It's still a work in progress, and I may or may not release it depending on the feedback and wishes of phorum team.
You can get an impression of how it's intended to work by looking at the screenshot.

Got a few questions before I continue though.

Has phorum team decided on an ajax-library yet or will you in the near future?
How come there's no general method for querying and getting results back?

Admin features will probably be:
- delete selected messages/threads
- approve selected messages
- hide selected messages/threads
- close selected threads

Thoughts and suggestions are welcome of course.

Module is now available for download @ [mods.mine.nu]

Updates will be announced here and made available for download on my page.

Edit:
Cleaned up post a bit.



Edited 2 time(s). Last edit at 03/13/2007 10:38PM by chup.


Re: Message Manager admin module for mass moderation of messages
March 10, 2007 03:51AM
I am working on an ajax module, which provides generic Phorum functionality through ajax. The module includes a client library, which can be used to communicate with the ajax functions on the server. This all is done using javascript. Both input and output are JSON based. You can see some of it at work at [www.gitaar.net] (login using phorum/phorum for also seeing newflags. Don't post anything please, since it's a live forum ;-).

The designated target for the Ajax module is Phorum 5.2. Most of the functionality will be okay for Phorum 5.1 too, but for example announcements in 5.1 are not handled at all. Those will be handled totally different in 5.2, so I didn't put any handling code for those in the ajax module. This ajax module would be the way to go for implementing ajax calls.

The module is not dependant on any javascript library to work. All functionality is containted in the package itself. I don't want to enforce some framework library for this, because that might give clashes. I did start out with implementing two versions for mootools and prototypejs, but ended up in writing some custom code for doing the job myself to get rid of the dependacies.

The module will grow, based on what peoples needs are in calling ajax functions. I follow a strict format in writing and documenting the functions and want to provide an interface that is as consistent as possible and which follows the internal coding rules of Phorum (one important thing is that ajax calls should follow the same security rules as regular Phorum calls, something which is easily forgotten by people who are focusing on implementing a front-end goody).

If you want to look at it: I packaged a pre-release and put it on my module repository. After installing, you should be able to get some results from yoursite.com/yourphorum/addon.php?module=ajax_api,examples (not all functions are in there but it gives you an idea on how the thing is supposed to work).

Second FYI: I will also be working on a mass-tool, namely a mass deletion tool to replace "prune messages" in the admin interface. What I will implement for that is a filtering system, where an arbitrary amount of filter can be created to narrow down a message search (so you can do things like: "remove all messages, from last week on till yesterday, which contain the word "helahola" or the word "holala" and are posted by user "weirdo").


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Message Manager admin module for mass moderation of messages
March 11, 2007 04:54PM
I need some beta-testers before I release this module/hack into the world.

Anyone interested? PHP-knowledge would be nice, but not a requirement.
Module should be out of alpha in the next few days.

Moderation actions will include:
Approve selected messages
Hide selected messages
Delete selected messages
Close selected threads
Reopen selected threads



Edited 1 time(s). Last edit at 03/13/2007 10:39PM by chup.
Re: Message Manager admin module for mass moderation of messages
March 11, 2007 08:08PM
Quote
chup
How come there's no general method for querying and getting results back?

Because providing plain SQL queries might result in problems, since there can be multiple database layers, for which not all data backends might understand your SQL code. Moreover, each database layer can name columns anyway it likes, store data anyway it likes (it doesn't have to be a database layer at all for example) and put more or less of the database layer logic in the database or in the layer file. So there is no guarantee that a SQL query that is thrown at the database layer, will be understood by it.

So that is the reason why the database layers all have specific functions for retrieving and storing parts of Phorum data.

The clean way of implementing custom queries would be to provide extra database backend functions for database backends that you want to support. The Spam Hurldes mod does this and also some of the search mods that were made by Oliver Riesen. So you might want to look at them for ideas.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Message Manager 5.1.x-0.0.1 released!
March 13, 2007 10:29PM
Message Manager 5.1.x-0.0.1 has been released.

Please let me know what you think about it after you've tried it.

Official download @ [mods.mine.nu]

Best regards,
- Phuc
Re: Message Manager admin module for mass moderation of messages
March 14, 2007 08:19AM
Message Manager 5.1.x-0.0.2 has been released.

Forgot to remove a dhcp.example.com string.

Does anyone know which mod set phorum_messages.status to -3 and what it means?

- Phuc
Re: Message Manager admin module for mass moderation of messages
March 14, 2007 09:53AM
What modules do you have installed? That might narrow choosing the one which did this. Maybe some anti-spam module which issues some custom moderated state or so?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Message Manager admin module for mass moderation of messages
March 14, 2007 12:16PM
The phorum in question was recently upgraded from phorum-5.0.10 to 5.0.19.

I went back to the old source files and found this entry in constants.php
Quote

define("PHORUM_STATUS_ATTACHING", -3);

Inside post.php I found this:
Quote

if ($PHORUM["max_attachments"] > 0 && isset($_POST["attach"])) {
$message["status"] = PHORUM_STATUS_ATTACHING;
}

So I guess that's why some messages had the status of -3.
At least now i know what it means.
Re: Message Manager admin module for mass moderation of messages
March 14, 2007 12:30PM
Ah yeah. Those are really old status codes. The new posting editor that was added to 5.1.x makes this status fully deprecated. There should be no new -3 status codes appearing on your system.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Message Manager admin module for mass moderation of messages
July 25, 2007 07:28AM
Nice code, but needs cleanup, also there is some bugs... I added there..

In around line 127:
add these BRs, on mozilla looks ugly without them:

After this line:
Quote

<div style="clear: both; margin-bottom: 5px;"></div>
Add this:
Quote

<br /><br />

Before this:
Quote

EOT;

around Line 166, we need an input to remember where we have been in pagination, (start variable)

Add this line:

Quote

<input type="hidden" name="start" value="{$_REQUEST['start']}">

Before this line:

Quote

<input type="submit" name="submit" value="Perform action" onClick="return confirm('Are you really sure you want to perform this action?')">

Thank you for your module!!
Sorry, only registered users may post in this forum.

Click here to login