PDA

View Full Version : Moderation Queue for Calendar Events!


Admin
11-12-2001, 10:00 PM
This was requested by clearchanel yesterday:
http://www.vbulletin.com/forum/showthread.php?s=&threadid=33118

The idea is, letting normal members post public events for all to see, but still avoiding the abusive members abuse this feature.
Basically, if the option is turned on, all new public events will be added to a moderation queue, similar to the way new attachments and posts are moderated.
Each moderator will then be able to approve public events in a special place in his Mod CP.
A link is added there, see the screen shot in the zip file for more info.

That's all I think there is to this.
To install this hack, download the attached zip, extract it, and upload install_modqueuecal.php to your admin folder. Then go to it in your browser, and follow all the instructions that will be presented to you.
The install script will run two queries. One will add a field to your calendar_events table, and the other will add the new admin option.
Uninstall procedure is also avaiable.

A demo of the validating screen can be found in the zip file.
By the way, moderation is bypassed for mods and admins, so they can post without having to validate the events.

Not sure if this will work on versions prior to 2.2.0, but I don't expect any problems with it.

That's it I think.
Feedback is welcomed as always! :)

jamesdasher
11-13-2001, 05:01 PM
not on my computer right now, but I will if this works as it is supposed to be installing this, sounds good Firefly!

James

LuBi
11-13-2001, 09:07 PM
Doesn't sound bad at all, demo or ss..?

Admin
11-14-2001, 09:44 AM
Only demo I can provide is the validation screen in the Mod CP. (in the zip)
Unless you'd like to see a blank calendar...? :)

Bender
11-14-2001, 01:05 PM
sounds great, will install this on my new vb-site - as soon as I get this other project ready ;)
btw, firefly, I like your avatar over at vbulletin.com much better than the one here ... though I guess its better matching the vb.org scheme :P

jamesdasher
11-14-2001, 04:59 PM
Bender, off topic, but I was wondering what is behind your signature? :D

James

Admin
11-14-2001, 05:20 PM
Can I guess? :)
BASIC.

SirSteve
11-16-2001, 04:41 AM
Is this the same thing as this?

https://vborg.vbsupport.ru/showthread.php?threadid=26442

Admin
11-16-2001, 11:31 AM
Hmm, yeah, looks like it. :(

SirSteve
11-16-2001, 12:17 PM
I'll give yours a try as you seem to be more into making your hacks better. The other guy kinda disappeared on me. :)

pool-werbung
11-16-2001, 07:57 PM
Do know a hack for Moderation Queue for polls?

SirSteve
11-16-2001, 11:33 PM
I cannot view the instructions once the hack is installed... ?

Admin
11-17-2001, 05:51 AM
What do you mean?

SirSteve
11-17-2001, 12:56 PM
I guess I missed something as I am not getting any events to approve so I need to go back to the instructions. How do I do this?

Admin
11-17-2001, 02:19 PM
...why can't you?

clearchannel
11-17-2001, 02:45 PM
One quick question. Will the members b-days still show up with out moderator approval?

LuBi
11-17-2001, 02:45 PM
Originally posted by FireFly
...why can't you?

Firefly I PM'd you and posted a few times, I really need your support on something I messed up. For all the info go to

Since Your Last Visit! (https://vborg.vbsupport.ru/showthread.php?threadid=31957&goto=newpost)

Admin
11-17-2001, 03:01 PM
[QUOTE]Originally posted by clearchannel
One quick question. Will the members b-days still show up with out moderator approval?

SirSteve
11-18-2001, 02:00 AM
Originally posted by FireFly
...why can't you?

Not sure... I went back to the install page, and only 2 options. Continue and exit. It quit since I already had the tables installed after I continued.

Admin
11-18-2001, 05:11 AM
Oh right, sorry.
Go to install_modqueuecal.php?s=&step=5 and you'll see the file changes.

SirSteve
11-18-2001, 05:16 AM
Thanks!

clearchannel
11-18-2001, 12:05 PM
He may mean something along these lines. Where is the control panel located to approve events on the calander.

I posted a message as a normal member and the only option available was the private event. I posted the event as a member and it showed up. I logged out as that member, logged in as a new regular member and could not see the event. I no longer see the public event icon?

I used notetab copy and paste to make the changes.

Is it possible I one, have a problem with the datatbase, or 2 addedd and unknown cr by accident?

I added this hack to version 2.2.1

clearchannel
11-18-2001, 12:47 PM
I get the following error if I try and moderate posts using the admin control panel in any forum:

Parse error: parse error in /home/virtual/*******/home/httpd/html/forums/mod/moderate.php on line 179

Again, this is in vb 2.2.1

Admin
11-18-2001, 02:46 PM
You need to enable Public Events to be able to post them.
Private Events don't go into the queue, because only the user that posted those events can see them.

clearchannel
11-18-2001, 04:13 PM
I'm now receiving this error:

Parse error: parse error in /home/virtual/***********/home/httpd/html/forums/calendar.php on line 461

along with this error when I check the post queue

Parse error: parse error in /home/virtual/************/home/httpd/html/forums/mod/moderate.php on line 180

SirSteve
11-19-2001, 05:44 AM
Thanks again for the help Firefly. I like yours much better. Just a few things... how about the option to be e-mailed when an event has been submitted and since I have Today's Events on main page Hack (https://vborg.vbsupport.ru/showthread.php?threadid=21232), the non-approved events are showing up there. Is there a simple way to get your hack to work with that hack?

:)

Admin
11-19-2001, 05:51 AM
For that hack, replace this line:
WHERE eventdate='$today' AND ((userid = '$bbuserinfo[userid]') OR (public = 1))");
with this line:
WHERE eventdate='$today' AND visible=1 AND ((userid = '$bbuserinfo[userid]') OR (public = 1))");
(that's in that file mister posted)

I'll post some code for the mail thing later.

clearchannel
11-19-2001, 08:44 AM
Originally posted by FireFly
(that's in that file mister posted)

Is that to fix my problem? I'm not fimiliar with the file mister posted.

Thanks

Admin
11-19-2001, 08:50 AM
[QUOTE]Originally posted by clearchannel
Is that to fix my problem? I'm not fimiliar with the file mister posted.

Thanks

clearchannel
11-19-2001, 09:15 AM
Yes, I sure I didn't omit anything. I did however find find the line to replace in step 6 comes before the line in step 5, while doing a find, I had to start from the beginning of the file?

Also, while editing the calander.php there were I think two lines that once I deleted the line the cursor did not align at the same point where the first character of the line I deleted was, I'm not sure if <cr> have an effect.

Would I be better off, saving the step five page in text and editing from a text file, rather then html?

Thanks

SirSteve
11-19-2001, 01:09 PM
Thanks! Hopefully the next version of vb will include this!

clearchannel
11-21-2001, 10:38 PM
Has anyone gotten this hack to work on their vb? I've copied and pasted the hack a few dozen times, and can not for the life of me get it to work.

Would someone be willing to look at the three files I hacked and maybe tell me where I went wrong?

I certently would appericate some help with this.

Thanks

clearchannel
11-21-2001, 10:54 PM
Let me see if I can save sometime.

When I first hack the three files, I received the following error message:

Parse error: parse error in /home/virtual/*******/home/httpd/html/forums1/calendar.php on line 461

Here is what that line (461), and the lines before (460) and after (462) the look like in my editor:

460: // Moderation Queue for Calendar Events (v1.0)
461: FROM calendar_events, user
462: WHERE eventid = $eventid AND calendar_events.userid = user.userid"))

Admin
11-24-2001, 06:09 AM
E-Mail me your hacked files Clearchannel.

clearchannel
11-25-2001, 12:48 PM
I have this hack installed, and it works great.

A much needed feature, or at least for my forums.

Thanks Firefly

gabs
01-17-2002, 08:55 PM
I got it working under v2.0.3 with just a two minor adjustments:

Instead of doing what the instructions tell u to in mod/index.php (you won't find the code to replace). Do this:

find:

<a href="moderate.php?s=<?php echo $session[sessionhash]; ?>&action=posts"> Moderate New Posts </a><br>


bellow it add:

<!-- // Moderation Queue for Calendar Events (v1.0) -->
<a href="moderate.php?s=<?php echo $session[sessionhash]; ?>&action=calendar"> Moderate New Calendar Events </a><br>
<!-- // Moderation Queue for Calendar Events (v1.0) -->



And finaly to prevent unmoderated events from showing up on the calendar, in admin/calendar.php :

find:
LIKE '$year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))");


replace it with:
LIKE '$year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1)) AND visible=1");


That is, works like a charm - thanx firefly

Shenlong
01-17-2002, 10:44 PM
GREAT HACK FIREFLY! u rock!

Ghostsuit
01-24-2002, 04:19 PM
Great hack works like a charm however did notice that when copy pasting text some of the statements were appearing in the //commented out area. so had to manually correct that.

Might be the cause of others problems.

jamesdasher
03-05-2002, 02:45 AM
I am having some trouble getting this to install on vb 2.2 is there an update...or is it just me...

2 things primarily...

1. the code:


if($info = $DB_site->query_first("SELECT eventdate,allowsmilies,username,event,subject,cale ndar_events.userid,public


doesn't appear in the order given in the install file...it is way at the top of the document (I could only find one instance of this)

2. the code:


$subject = htmlspecialchars($info[subject]);


appears in the file 2 times...

that is as far as I have currently gotten, hope you can help

James

Ghostsuit
03-19-2002, 11:26 AM
Just installed this on 2.2.4 however I used beyond compare to merge the code to the new files but it seems to work fine.

JulianD
03-21-2002, 08:22 PM
I got a problem with this hack... it works good, but today a user submitted an Event with HTML code in it, and the HTML didn't work.... Can you guys check it out? Submit an event with HTML, and see if after the approval, the HTML is working?

HellRazor
03-23-2002, 08:45 PM
Firefly, did you ever get a chance to add email notification? What would be cool is, when someone submits an event, the admin gets an email with a link, and just by clicking on the link, the event is approved.

FleaBag
05-19-2002, 11:36 PM
Installed this and it all appears to be working fine on 2.2.5. jamesdasher is right, the code appears in the file twice. I added the code before the first reference. I warn everyone to make sure when they copy and paste the code to be added to manually remove PHP code from the commented lines, for some reason it is written in them?! Anyway, thanks for this hack - just what I needed! :D

FleaBag
05-20-2002, 01:05 PM
Argh just got a database error...


Database error in vBulletin 2.2.5:

Invalid SQL: SELECT
eventdate,allowsmilies,username,event,subject,cale ndar_events.userid,public,visible
// Moderation Queue for Calendar Events (v1.0)
FROM calendar_events, user
WHERE eventid = 7 AND
calendar_events.userid = user.userid
mysql error: You have an error in your SQL syntax near '/ Moderation
Queue for Calendar Events (v1.0)
' at line 2

mysql error number: 1064


...Anyone have any ideas what's up? Thanks in advance. :squareeyed:

FleaBag
05-21-2002, 10:25 PM
*Bump*

Admin
05-22-2002, 05:29 AM
For some reason you have this:
// Moderation Queue for Calendar Events (v1.0)
In the middle of a query... remove it. :)

FleaBag
05-22-2002, 12:41 PM
D'oH! Thanks FireFly, and thanks gabs for the fix! :D

FleaBag
06-20-2002, 12:41 PM
Works on 2.2.6! :) Also, for mod/index.php, do this [not what's in the instructions].

Replace...

makenavoption("New Posts","moderate.php?action=posts","<br>");


...with...


makenavoption("New Calendar Events","moderate.php?action=calendar","<br>");
makenavoption("New Posts","moderate.php?action=posts","<br>");

FleaBag
06-20-2002, 05:00 PM
Having problems with this hack again after my upgrade...


Invalid SQL: SELECT
eventdate,allowsmilies,username,event,subject,cale ndar_events.userid,public,visible
// Moderation Queue for Calendar Events (v1.0)
FROM calendar_events, user
WHERE eventid = 30 AND
calendar_events.userid = user.userid
mysql error: You have an error in your SQL syntax near '/ Moderation
Queue for Calendar Events (v1.0)
FROM calendar_events, user
' at line 2

mysql error number: 1064


...Getting that when viewing an event on the Calendar. Anyone able to help? Thanks in advance. :)

FleaBag
06-20-2002, 05:07 PM
OK nevermind, I looked at that quote 10 times and it wasn't until I posted it here I realised I had a comment in the middle of a query. Seems to be working 100% now! :)

clearchannel
06-23-2002, 02:39 PM
Is your code correction in your last post correct. I'm having a hard time getting this to work in 2.26.

thanks

FleaBag
06-23-2002, 06:51 PM
It's correct as far as I know. Everything works perfectly for me.

JJR512
07-27-2002, 05:36 PM
FireFly, people are having that comment in the middle of the query because that's what your instructions say to do. Step 6 of the calendar.php instructions say to find this:
if($info = $DB_site->query_first("SELECT eventdate,allowsmilies,username,event,subject,cale ndar_events.userid,public
And replace it with this:
// Moderation Queue for Calendar Events (v1.0) if($info = $DB_site->query_first("SELECT eventdate,allowsmilies,username,event,subject,cale ndar_events.userid,public,visible
// Moderation Queue for Calendar Events (v1.0)
Also, I noticed that in I think all the instructions for calendar.php (that's as far as I've gotten so far, I'm in the middle of installing it), every bit of code to add has had comments in it, like "// Moderation Queue for Calendar Events (v1.0)", but most of them, if you just select and copy it out of the box into the file, will have the first bit of code on the same line as the opening comment. Like this, from Step 1:

// Moderation Queue for Calendar Events (v1.0) $eventinfo = $DB_site->query_first("SELECT allowsmilies,public,userid,eventdate,event,subject ,visible FROM calendar_events WHERE eventid = $eventid");
// Moderation Queue for Calendar Events (v1.0)
It's of course not a problem for me to put adjust the code so the real code appears on a new line between the comments, but this might be something you could fix in an updated release.

Finally, in Step #7 of the instructions for calendar.php (this is the reason I'm here in the middle of installing this hack in the first place), that bit of code to find appears twice. Do we add the new code before both of them, or just the first or second? Someone else did the first; I'm doing both, and I'll try to test it, but an official word would be nice. :)

JJR512
07-27-2002, 06:14 PM
One question: When someone submits an even, the title shows up on the calendar, but clicking it gives an "invalid event id" message until the event is moderated (approved). Is this intended behavior? Shouldn't nothing show up until it's approved?

JJR512
07-28-2002, 02:34 AM
OK, for the record, in Step 7 of the instructions for calendar.php, you do it for the FIRST instance of the found code, and not for the second! If you do it for the second, then if you click on the link that is the number of the date in that date's box, you will get an invalid id error message. I guess that sounds confusing...don't worry about it, just do it to the first instance only and you'll be fine. :)

JJR512
07-28-2002, 02:51 AM
You know what...I could be wrong. I've just discovered that if you don't do it for the second bit of code, then anyone can click on the date link to see the event for that day, even before it's been moderated. If you click the event itself, you still get the invalid id message, though. Now I'm confused.

JJR512
07-28-2002, 02:53 AM
Here's how to get an email message whenever someone posts a public event that gets queued. These instructions assume you have completely installed the hack as instructed.

In calendar.php, find:
// Moderation Queue for Calendar Events (v1.0)
if ($moderateevents and ($bbuserinfo[usergroupid]!=5 and $bbuserinfo[usergroupid]!=6 and $bbuserinfo[usergroupid]!=7)) {
$visible=0;
After that, add:
$emailsubject="New Calendar event awaiting moderation";
$emailmessage="A new public event has been posted to the $bbtitle Calendar and requires your approval before becoming publically available. Please login to the $bbtitle Moderator Control Panel ($bburl/mod) to review it.";
mail($webmasteremail,$emailsubject,$emailmessage,"From: \"$bbtitle Calendar Event Queue\" <$webmasteremail>");
That's it.

FleaBag
07-29-2002, 11:15 PM
Dude there's a fix earlier in the post for un-moderated events appearing on the Calendar. And thanks for this e-mail feature! It's very useful as at times I haven't authorised events until they've passed! :)

fabz
09-05-2002, 08:27 PM
Hi,
i have vb2.2.5
I launched the installation script wthout any error, great !
In the cp, the calendar is activated and moderated.

I connect as a moderator and go to calendar...
nothing changed, I only have the "private event" button...

May someone help me ?

Richard
12-18-2002, 07:20 PM
I just installed this hack on vBulletin 2.2.9. It works great except for this problem:

When a user posts an event, all is fine and dandy, until he's redirected back to his own event. It shows up as event invalid. Is it supposed to be this way or is there something I'm doing wrong?

Richard
12-18-2002, 07:39 PM
Originally posted by Richard
I just installed this hack on vBulletin 2.2.9. It works great except for this problem:

When a user posts an event, all is fine and dandy, until he's redirected back to his own event. It shows up as event invalid. Is it supposed to be this way or is there something I'm doing wrong?

Oh nevermind. I found out the problem.

I got around it by creating a custom template for the error message.

snyx
01-10-2003, 08:08 PM
mmmmm, this hack took some tweaking on 2.2.9 but I got it
thx for the email responder too JJR

one downside, I wish the event wouldnt show on the calendar untill allowed, oh well.

FleaBag
04-01-2003, 12:02 AM
There is a fix for that earlier in this thread.

Boofo
04-01-2003, 12:20 AM
Can someone post a text file with all of the fixes in it for this hack?

FleaBag
04-01-2003, 12:50 AM
Give me 10 minutes...

Boofo
04-01-2003, 12:56 AM
Thank you, sir. ;)

FleaBag
04-01-2003, 01:30 AM
Grrr... I just posted a finished version of instructions, only to find it isn't working. :(

I'll keep working on it...

MACHOBY
04-01-2003, 04:15 AM
I have tried to do this like 5 times and every time I finish, the entire calendar goes blank. I must be doing something wrong in the calendar.php changes. Could someone attach their calendar.php file here for me?

Thanks!

Boofo
04-01-2003, 05:29 AM
Yesterday at 09:30 PM GamerForums said this in Post #67 (https://vborg.vbsupport.ru/showthread.php?postid=376183#post376183)
Grrr... I just posted a finished version of instructions, only to find it isn't working. :(

I'll keep working on it...

Great! Thanks and please let us know when you have something. ;)

FleaBag
04-01-2003, 01:29 PM
Today at 06:15 AM MACHOBY said this in Post #68 (https://vborg.vbsupport.ru/showthread.php?postid=376214#post376214)
I have tried to do this like 5 times and every time I finish, the entire calendar goes blank. I must be doing something wrong in the calendar.php changes. Could someone attach their calendar.php file here for me?

Thanks!


I don't get a blank page, rather none of the features that are supposed to be added work. And attaching calendar.php here would be illegal.

portalguy
05-02-2003, 04:49 PM
makenavoption("New Calendar Events","moderate.php?action=calendar","<br>");
makenavoption("New Posts","moderate.php?action=posts","<br>");

But it is still not showing on hte admin page :banana:
vb 2.3.0

FleaBag
07-05-2003, 05:14 PM
So you've got the rest of it to work?