Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-29-2012, 08:53 AM
0lly 0lly is offline
 
Join Date: Apr 2007
Location: UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
3 благодарности(ей) от:
dougdirac, InfoNirvana, zascok
  #2  
Old 03-03-2012, 05:26 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-04-2012, 10:09 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Attached Files
File Type: xml product-edit_time_limit_exemption.xml (2.1 KB, 26 views)
Reply With Quote
  #4  
Old 03-04-2012, 10:55 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
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
Thanks but I don't think that is what he is looking for. This will allow the original author to edit the first post indefinitely...

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).
Reply With Quote
  #5  
Old 03-04-2012, 11:00 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From my effort you could just remove the
HTML Code:
$this->registry->userinfo['userid'] == $post['userid']
, the post is then always editable by anyone in the selected groups in vboptions only if the post has the prefix, isn't that how it would work?
Reply With Quote
  #6  
Old 03-04-2012, 11:07 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just checked it and it seems to work
Attached Files
File Type: xml product-edit_time_limit_exemption.xml (2.0 KB, 17 views)
Reply With Quote
  #7  
Old 03-04-2012, 11:11 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 03-04-2012, 11:59 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 )
Reply With Quote
  #9  
Old 03-04-2012, 12:01 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, it's when you try to save the edit the permissions kick in.
Reply With Quote
  #10  
Old 03-04-2012, 04:21 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04879 seconds
  • Memory Usage 2,291KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete