PDA

View Full Version : How do I alter plugins to bypass admin approval?


jkdunde
09-07-2005, 12:01 PM
Hi,
Looking for guidance on how to alter the News, Event Manger and Link plugins so users can auto post, bypassing admin approval.

Thanks

spib
09-07-2005, 03:47 PM
Well, the news one is little complicated so i'll explain that one. In p2_news.php, find the p2_InsertArticle function.

Replace
$DB->query("INSERT INTO " . TABLE_PREFIX . "p2_news (categoryid, settings, datecreated, author, title, description, article)
* * * * * * * *VALUES ($categoryid, 1, '" . time() . "', '$author', '$title', '$description', '$article')");
with
$DB->query("INSERT INTO " . TABLE_PREFIX . "p2_news (categoryid, settings, datecreated, author, title, description, article)
* * * * * * * *VALUES ($categoryid, 3, '" . time() . "', '$author', '$title', '$description', '$article')");

For the link directory, in link_directory.php replace

$DB->query("INSERT INTO " . TABLE_PREFIX . "p16_links VALUES ('', $sectionid, '0', '1', '1', '" . $_POST['p16_author'] . "', '" . $_POST['p16_title'] . "', '" . $_POST['p16_url'] . "', '" . $_POST['p16_description'] . "') ");
with
$DB->query("INSERT INTO " . TABLE_PREFIX . "p16_links VALUES ('', $sectionid, '1', '1', '1', '" . $_POST['p16_author'] . "', '" . $_POST['p16_title'] . "', '" . $_POST['p16_url'] . "', '" . $_POST['p16_description'] . "') ");

jkdunde
09-13-2005, 01:00 PM
Thank you very much! I'll give this a try. :)

Rain
09-17-2005, 09:23 AM
hello

is there any solution for guest and registered users, to publish their images immediately in image gallery, without an admin permission?


i have changed from $activated 0 to 1 in imagegallery.php, but it doesnt works.

a nice day

thomas
09-18-2005, 03:14 AM
Originally posted by Rain@Sep 17 2005, 08:23 PM
hello

is there any solution for guest and registered users, to publish their images immediately in image gallery, without an admin permission?
i have changed from $activated 0 to 1 in imagegallery.php, but it doesnt works.

a nice day
1147


Its really not a good idea to it that way, because that activated on/off function basically says show offline OR online images. That is why its not working for you.

Its not good because you might not want to display some images online, and you have gone in to turn them off, and therefore, they will still be showed as online.

My advise would be to follow the code hacks above and not this way.

Rain
09-18-2005, 05:17 AM
well, i have a nice committee, and i trust them will not upload rude pictures.

thomas
09-19-2005, 11:30 PM
Originally posted by Rain@Sep 18 2005, 04:17 PM
well,* i have a nice committee, and i trust them will not* upload rude pictures.
1150


hehe. true true.

I still would go with the above code, and not change the activated settings. There are many reasons why spib did it the long way instead of changing the $activated.

But go with what you feel comfortable. Love to see it when its completed. B)

jkdunde
09-24-2005, 07:15 PM
Spib,
Thank You, the changes worked perfectly. Does anyone know how I can make the same changes to the Event Manager plugin?

Thanks!

jkdunde
09-25-2005, 02:45 PM
Ok, nevermind. I think I've got it working. I just changed the 0's to 1's in the same location as the others and it seems to work. Thanks!