The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Allow all members to edit first post of a thread if it has certain prefix
I would like to make it so that any member of my forum can edit the first post of a thread if it had a specific prefix.
EG: When a member posts a thread, they can choose a prefix called "editable", which then allows any member of the forum to edit that post. So like, on my gaming forum, if I have a thread dedicated to one console, the first post can be used to keep track of all the latest news. I want to be able to use it as an index type of thing where users can add links to news articles etc with a few other ideas floating around in my head. I tried doing it for ages but couldn't get it to work. What I did was ducplicate the "editpost.php" file and called the duplicate "editable.php". I tried adding some conditonals for the prefix but I'm not exactly very good at php so I couldn't figure out how to edit the permissions while fitting the conditional in Thanks! |
3 благодарности(ей) от: | ||
dougdirac, InfoNirvana, zascok |
#2
|
||||
|
||||
This idea grabs my attention- I have some ideas I may play around with. No promises or estimate though so if someone else wants to do this feel free to jump in.
|
#3
|
||||
|
||||
Here's my first shot at it, [S]i haven't tested [/S]tested it minimally on test forum, so you can be the guinea pig
BOP5, feel free to take this and edit change it to make it work if it doesn't, i just saw this post and knew i could knock something out that may help |
#4
|
||||
|
||||
Quote:
He wants to allow ALL users to be able to edit the first post- almost like a "Wiki" My thought was to mark a thread as a "Wiki Thread" and if it was marked as a "Wiki Thread" go ahead and show the "Edit" button to everyone and then allow everyone to edit it. In my testing so far however editpost.php does not have the hooks necessary to bypass the permissions- so what I'm trying to figure out is if I can intercept the permissions themselves somewhere to give everyone permission to edit a wiki-thread. Unfortunately making a copy of editpost.php without the permission checks isn't working either... It's actually very very weird behavior- it seems to update the post cache but somewhere along the line another permission check must fail and it doesn't update the post... so it looks like it works but a little later when I come back all the "edits" I thought I did had been "magically" undone... so that is definitely not the avenue to pursue IMO. The key to this is going to be if I can do a test for when vBulletin builds its permissions and override them when on a wiki-thread ($thread['iswiki'] == 1 for example). |
#5
|
||||
|
||||
From my effort you could just remove the
HTML Code:
$this->registry->userinfo['userid'] == $post['userid'] |
#6
|
||||
|
||||
Just checked it and it seems to work
|
#7
|
||||
|
||||
Your mod will show the edit link, no problem... but if you actually try to edit a post as a different/non-mod user you will get a permission error because editpost.php checks for permission to edit the post before doing anything else.
|
#8
|
||||
|
||||
I did try on my test forum as editing as different user, the edit window opened fine (i didnt edit though, maybe i should check that too )
|
#9
|
||||
|
||||
Yeah, it's when you try to save the edit the permissions kick in.
|
#10
|
||||
|
||||
Yes i see, when i get home i'm going to mess with GETting the users usergroupid and save it as a variable, change their usergroup to say moderator at postdata_presave then back to their original at postdata_postsave i know thats 3 queries but it's hardly going to happen very often, i'll have to see what time i've got when i get home.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|