How to auto-approve new submissions ?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
nyc2003
Posts: 3
Joined: Wed Nov 05, 2003 4:03 am

How to auto-approve new submissions ?

Post by nyc2003 »

Hello:

I want to have a small group of people maintain the FAQ without having one of them be the admin. The entire FAQ will be restricted, and will require a password to get to.

Is there a way to "Add content" and not need the admin to approve it ?

thanks.
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you have to edit some functions in functions.php to do this.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
nyc2003
Posts: 3
Joined: Wed Nov 05, 2003 4:03 am

Post by nyc2003 »

thanks.

I'm a bit of a noob on this.

could you point out what and where needs to change ?

thanks.
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just open the file save.php and look for the following code:

Code: Select all

$db->query("INSERT INTO ".$sqltblpre."faqdata (lang,active,rubrik,thema,content,keywords,author,email,comment,datum) VALUES ('".$lang."', 'no', '".$_REQUEST["rubrik"]."', '".$thema."', '".$content."', '".$keywords."', '".$author."', '".$_REQUEST["usermail"]."', 'y', '".$datum."')");
Then edit this line to:

Code: Select all

$db->query("INSERT INTO ".$sqltblpre."faqdata (lang,active,rubrik,thema,content,keywords,author,email,comment,datum) VALUES ('".$lang."', 'yes', '".$_REQUEST["rubrik"]."', '".$thema."', '".$content."', '".$keywords."', '".$author."', '".$_REQUEST["usermail"]."', 'y', '".$datum."')");
That's all!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
nyc2003
Posts: 3
Joined: Wed Nov 05, 2003 4:03 am

Post by nyc2003 »

worked like a charm ! thanks :)

one little bug/feature I discovered while doing this, is that if you put single quotes in the headline, then the record does not get added.

so for example
how to 'build' a network
would not be added because of the ' marks.

thanks again for your help.
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I'll check this bug!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leo_246
Posts: 13
Joined: Sat Aug 06, 2005 9:25 pm

Post by leo_246 »

I know this is an old question but I was wondering if it is possible to make the "auto approval" as a 'Right' in the useradmin section ?
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

this is an option for version 1.6 because we do a rewrite for the authorization.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
nedbrush
Posts: 1
Joined: Fri Jul 07, 2006 6:59 pm

Post by nedbrush »

Hello,
I'm a little bit confused. Is this option (auto-approval) already in version 1.6? I am using version 1.6.1, and I can't find anything about auto-approving open questions in the admin section. Is there a workaround for version 1.6.1 if this option isn't available?

Thanks,
Ned
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the so called version 1.6 in this thread is now called 2.0.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
R@V3N
Posts: 2
Joined: Tue Jul 25, 2006 9:29 am

Post by R@V3N »

Mh... is there still a way, to disable the activation-function in 1.6.3? The way from above don't work with this version ;)

thx

BTW: Can I disable the function, to send emails on new topics, too?
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

it's almost equal, look for "no" in the code and change it with "yes". To deactivate the mails, just comment out the function mail().

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
R@V3N
Posts: 2
Joined: Tue Jul 25, 2006 9:29 am

Post by R@V3N »

Okay, my fault - thx. I should read better. I searched for "no" in the functions.php, but now, I've seen, that this should be done in the save.php :oops:

The Tip for the mail-deactivation works fine, too ;)
Post Reply