Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2008-09-10 20:34:57

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_moderation - Generic Moderation

Hi!

Is there a simple way to turn off moderation? I’m testing this on a site I’m developing, and I’m pretty happy with the way mem_form and mem_moderation_article work together to map user input to the appropriate database row, but I want the articles to be published directly, bypassing moderation completely.

I’ve tried using TXPhorum for this, but I can’t get it to process custom fields, categories, or keywords.

I don’t mind modifying the plugin, with guidance.

Offline

#134 2008-09-10 20:39:10

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_moderation - Generic Moderation

johnstephens, this functionality exists for moderators. There is a define() towards the top of the plugin to enable/disable this functionality. If you’d like to modify the plugin so any user can bypass the queue, then look to where it is used in the save function and remove the moderator privilege check.

Offline

#135 2008-09-10 21:33:43

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_moderation - Generic Moderation

Thanks you Michael!

I thought I understood, but maybe I didn’t.

You said:

If you’d like to modify the plugin so any user can bypass the queue, then look to where it is used in the save function and remove the moderator privilege check.

1. I navigated to Admin > Plugins in Textpattern and selected the Edit link next to mem_moderation.

2. I searched for a save function, and I found this at lines 428-430 (692-694 in the uncompiled plugin):

function mem_moderate_save()
{
	require_privs('moderate.edit');

3. I commented out line 430 (694) and saved.

	// require_privs('moderate.edit');

4. Then I entered an article using the front-end form.

You have successfully submitted the form. Thank you.

5. Checked the article list at /textpattern/index.php?event=list, and it wasn’t there. I checked the moderation queue, and it was awaiting moderation.

What did I do wrong? I couldn’t identify any other save function, but my PHP skills are the same as my auto repair skills: if the car stops working and the fuel gauge says “E,” I know exactly what to do. Otherwise, I assume that a hitman is after me.

Thanks again!

Offline

#136 2008-09-11 04:50:02

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_moderation - Generic Moderation

Undo that last change you did. require_privs() is a txp function that dictates which users can access an event/step. I was incorrectly thinking of queue submission delay, which deals with showing items on the moderation list immediately if the content was created by a moderator.

To bypass the queue so that the item is submitted, you will need to modify the specific type plugin so that immediately after it calls submit_moderated_content it will need to call mem_moderate_approve.

For mem_moderation_article. Search for the line.

$res = submit_moderated_content('article', '', $mem_modarticle_info['note'], $mem_modarticle_info);

and add the following immediately after it.

if ($res) {
	mem_moderate_approve('article', $res);
}

There is another part of that function that deals with edits to a published article, ‘article-edit’, that would need a similar change made if your site is using the the article edit feature.

Offline

#137 2008-09-11 05:30:39

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_moderation - Generic Moderation

Thanks again for your prompt response!

Now I have this:

$res = submit_moderated_content('article', '', $mem_modarticle_info['note'], $mem_modarticle_info);
if ($res) {
	mem_moderate_approve('article', $res);
}

And when I submit an article, I get this message from Textpattern:

Fatal error: Call to undefined function pageTop() in /Users/username/Sites/example.dev/textpattern/lib/txplib_misc.php on line 306

I checked the article list and moderation queue: in spite of the fatal error, I see that the data landed in the moderation queue just like before.

I’m very grateful for your help!

Offline

#138 2008-09-16 18:16:45

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_moderation - Generic Moderation

I can’t figure out what’s causing the fatal error. I’ve combed through the plugin code to see if I applied your mem_moderate_approve('article', $res); to the wrong function; I see other instances of $res = submit_moderated_content that are very similar, but there’s the only one instance that matches the search query exactly; it appears in the Form submit handler function (function mem_mod_article_form_submitted()), which makes sense.

When I submit an article using the edited plugin, two things happen:

  1. I get the fatal error mentioned above, and
  2. The article content appears in the moderation queue instead of the live article list.

I’d be grateful for any suggestions or insight anyone could offer!

Offline

#139 2009-02-09 18:20:37

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: mem_moderation - Generic Moderation

Hey John, did you find out the fix for your problem?

johnstephens wrote:

I can’t figure out what’s causing the fatal error.


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#140 2009-03-02 02:09:33

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_moderation - Generic Moderation

rathersplendid wrote:

Hey John, did you find out the fix for your problem?

Yes— I’m using the latest version of mem_simple_form instead of mem_moderation. I’ve had a few bumps in the road, but I’m pretty happy with the results right now. Hopefully I shall get this project online soon!

Offline

#141 2009-04-15 19:30:38

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: mem_moderation - Generic Moderation

Trying to set up an article submission page for a textpattern site I’m working on.

The only hiccup during installation of these plugins was the “mem_moderation_article” install wizard gave me a ‘restricted access’ message when I tried to run it. As a result, I created the “mod_article_form” form manually.

Unfortunately, while the forms appear properly, nothing happens when I attempt to submit a new article. I just get sent back to the default page on the site. Nothing appears in the moderate queue or in the submitted_article_list form output.

Thanks!

Last edited by lehan (2009-04-15 19:37:07)

Offline

#142 2009-04-15 22:23:22

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: mem_moderation - Generic Moderation

lehan, check in your database to see if the txp_moderation tables have been created and, if so, also to see if the submissions have indeed been made to the database? If the submissions have been made it may be that they are “waiting” in the “submission delay” loop (never understood what this was for). Check your settings at the top of the mem_moderation plugin (edit the source in the plugin pane). I remember having to experiment with the settings a bit. In a working setup I have the following settings and submissions appear in the moderation queue list immediately:

define('PUBLISHERS_BYPASS_QUEUE_DELAY', false);
define('QUEUE_SUBMISSION_DELAY', "0");

TXP Builders – finely-crafted code, design and txp

Offline

#143 2009-04-16 07:49:45

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: mem_moderation - Generic Moderation

lehan wrote:
the “mem_moderation_article” install wizard gave me a ‘restricted access’ message when I tried to run it. As a result, I created the “mod_article_form” form manually.

Did you apply the add_privs hack?

Offline

#144 2009-04-17 18:18:20

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: mem_moderation - Generic Moderation

jakob wrote:

lehan, check in your database to see if the txp_moderation tables have been created and, if so, also to see if the submissions have indeed been made to the database? If the submissions have been made it may be that they are “waiting” in the “submission delay” loop (never understood what this was for). Check your settings at the top of the mem_moderation plugin (edit the source in the plugin pane). I remember having to experiment with the settings a bit. In a working setup I have the following settings and submissions appear in the moderation queue list immediately:

The txp_moderation was created but no records are being added. The submissions are going nowhere fast it seems.

ARGH!

Last edited by lehan (2009-04-17 18:18:38)

Offline

Board footer

Powered by FluxBB