PDA

View Full Version : Allow all mods to view deleted threads


Alan @ CIT
07 Nov 2005, 14:09
Requested: http://www.vbulletin.org/forum/showthread.php?t=100108

This little mod allows moderators of any forum to view all soft-deleted threads. (usually they can only view soft-deleted threads in forums they moderate).

This (should) work as long as the user is a moderator of ANY forum. Doesn't matter which forum, just as long as they're listed as a moderator of at least 1.

I've done as much (limited) testing as I can with just me and my test board, so let me know if it causes any problems :)

Important: Unfortunately, my leased vBulletin licence has now expired, and I won't be renewing it until September which means I will be unable to reply to this thread, or update this mod until then. I'm hopeful that the great vBulletin.org community will step in to answer any questions in my absence though :) See you all in early September! :D

Version 1.4: Fixed the pagenav bug
Version 1.3: Now supports search results + fixed a minor bug :)
Version 1.2: Added support for mods to view all soft-deleted posts as well as threads :)
Version 1.1: Fixed a bug that broke most of the links in forumdisplay.php :)

Snake
07 Nov 2005, 16:17
Thanks! First one to install. :D

Alan @ CIT
07 Nov 2005, 16:24
Good stuff, now click the "Install" button :D

Alan @ CIT
07 Nov 2005, 17:28
Aftermath: I noticed a bug that broke some of the links in forumdisplay.php - install the updated product XML to fix :)

SoftWareRevue
07 Nov 2005, 22:12
I updated to the new version. It still doesn't work for me. What should I look for?

Thanks again, Alan!

Alan @ CIT
08 Nov 2005, 07:34
What parts not working mate?

When a moderator views the list of threads (forumdisplay.php), it'll show the soft-deleted threads, with the "View" link (but not the manage link), and the "Deleted by x, Reason: y" bit.

Moderators of the forum in question, supermods and admins should see the soft-deleted threadbit as normal.

In theory anyway :) It seems to work here. I created a test-mod and made them a standard moderator of Forum #1, I then went to Forum #2 and viewed the list of threads, and the soft-deleted threads showed up.

SoftWareRevue
09 Nov 2005, 15:02
Hi Alan.

Sorry for my late response. But, I walk away from the internet on Tuesdays. :)

It just doesn't seem to work. I installed the product and made sure it was active. But, still mods cannot see the View link if the post is in a forum they don't moderate.

They can see the Delete Message. But, they can't see the View link.

Alan @ CIT
09 Nov 2005, 16:41
I tested it on 3.5.0, so I'll upgrade to 3.5.1 tonight and see if it still works for me.

What happens if the mod tries to view a soft-deleted thread directly? (showthread.php?t=deleted-thread-id-here) Does it show the thread, or display a no permission message?

Alan @ CIT
09 Nov 2005, 17:20
ok, upgraded to 3.5.1 and it still appears to be working for me.

When they try view the thread list, do they see the attached image, just without the "View" link?

SoftWareRevue
09 Nov 2005, 19:06
ok, upgraded to 3.5.1 and it still appears to be working for me.

When they try view the thread list, do they see the attached image, just without the "View" link?Yes. They see the thread; just no View link.

I should have mentioned that I first installed it on a 3.5 board. And then on a 3.5.1 board.

SoftWareRevue
09 Nov 2005, 19:08
. . . What happens if the mod tries to view a soft-deleted thread directly? (showthread.php?t=deleted-thread-id-here) Does it show the thread, or display a no permission message?They get this Invalid Post specified. If you followed a valid link, please notify the administrator

Alan @ CIT
09 Nov 2005, 19:27
Hmm, very strange. I'll do some more testing here tonight.

SoftWareRevue
09 Nov 2005, 19:28
I just realized, you're talking about Threads, while I'm talking about Posts.

/me goes back and deletes a thread.

Alan @ CIT
09 Nov 2005, 19:31
Sorry to be a real pain, but if you get a sec, would you mind running the following query and telling me the number it returns (should be 1 or 2):

SELECT visible FROM thread WHERE threadid=<id of a soft-deleted thread here>

Thanks :)

SoftWareRevue
09 Nov 2005, 19:32
Okay. Seems to work great for deleted threads. :)

Think we can get it to work for deleted posts? :bunny:

SoftWareRevue
09 Nov 2005, 19:37
Sorry to be a real pain, but if you get a sec, would you mind running the following query and telling me the number it returns. . .2 (and more letters here to meet minimum char requirements)

Alan @ CIT
09 Nov 2005, 19:38
lol - I was very confused as to why it didn't work :D

I'll have a look at posts now mate, didn't even know posts could be soft-deleted :)

Alan @ CIT
09 Nov 2005, 20:45
ok, I've updated the product XML in the first post - v1.2 now supports soft-deleted post viewing :)

(hopefully) :D

SoftWareRevue
09 Nov 2005, 22:01
That got 'er, sir.

Seems to work like a champ.

I'm sure more people will find this handy as well.

Thank you!

SoftWareRevue
09 Nov 2005, 22:56
One more request. :angel: <<<< is there an angel emoticon here?

The only place I've noticed that the soft-deleted post doesn't show up is the search results when you search for all posts by a user.

They, also don't show up when you search for a phrase.

I suppose that means they don't show up in search results.

They show up for admins though. So, can you have them show up for mods? :)

Alan @ CIT
10 Nov 2005, 09:14
Product XML updated, it now shows soft-deleted posts in search results if the user is a mod :)

SoftWareRevue
10 Nov 2005, 16:27
Very nice hack!


/me does the dance of joy. :banana:

fridayweb
25 Nov 2005, 17:20
When I had this plugin running and then created a new forum, the $forumid for just that forum kept being reset it f=0 and was totally messed up. When I disabled this plugin, it was fine again. I'm not sure what part of this plugin caused that error, but it's something I thought I'd let you know about in case anyone else was affected.

Alan @ CIT
25 Nov 2005, 17:37
The plugin sets the $forumid to 0, then resets it back before it displays the page. I thought I'd found all the spots where it needed to be reset back, but apparently not. Exactly where is it set to 0? ie, what links are displayed on the page with f=0 attached to them?

fridayweb
25 Nov 2005, 18:16
Everything was great until I added a new forum. It only affected that particular one for some reason.

If I tried to hit "new thread" it returned "no forum specified" or some similar error, and I could see that it was trying to draw on f=0

Also I guess it's 'pagenav' where it has Page 1 of 20, and if I tried clicking on any of the numbers or the forward or back arrows it was drawing on f=0

SoftWareRevue
25 Nov 2005, 18:54
The plugin sets the $forumid to 0, then resets it back before it displays the page. I thought I'd found all the spots where it needed to be reset back, but apparently not. Exactly where is it set to 0? ie, what links are displayed on the page with f=0 attached to them?
I haven't tried creating a new forum to see. But, I do see this happening when I'm in a forum that has multiple pages of threads. Clicking on "Last" or "First" will give the Invalid Forum error.

Appears to be because there is no forum :)xxx.com/forumdisplay.php?f=&sort=threadstarted&order=desc

Alan @ CIT
25 Nov 2005, 19:19
Hmm... I added another plugin to v1.3 to fix this bug, but it appears it didn't fix it at all :(

will investigate more tonight :)

SoLo OnE
30 Nov 2005, 21:55
Also I guess it's 'pagenav' where it has Page 1 of 20, and if I tried clicking on any of the numbers or the forward or back arrows it was drawing on f=0

Yep totally breaks any page navigation...

Had to uninstall it after finding this out. :ermm:

Alan @ CIT
02 Dec 2005, 19:06
Panic not folks, been away but I'm back now - working on a fixed version as we speak. One that (hopefully) doesn't need to cludge the forumid :)

Alan @ CIT
02 Dec 2005, 19:51
Version 1.4 has been released. This mod no-longer cludges the forumid to 0, which means there shouldn't be any more problems with broken pagenav, etc :)

Any problems, please let me know :)