vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Message Editing Hierarchy (https://vborg.vbsupport.ru/showthread.php?t=60066)

Loyalty4Life 04-14-2004 06:43 AM

Xenon - Great hack. I'm using it as we speak.

[high]* Loyalty4Life clicked install some time ago :)[/high]

Majik? 04-15-2004 07:03 PM

Will this apply to user note editing as well or just to post editing?

Xenon 04-15-2004 07:58 PM

Just Post editing.

Majik? 04-15-2004 09:07 PM

Quote:

Originally Posted by Xenon
Just Post editing.

Okay, I'll just have a look at the usernote file and add the code in the right place. ;)

Xenon 04-15-2004 10:11 PM

:)

it should work there as well :)

Majik? 04-15-2004 11:45 PM

After a quick look.. I decided ther permision would only need to be checked within the editpost action (as the other relevant actions are POST). So, here's what I came up with quickly..

Message Edit Hierarchy Add-On :: User Notes
Version: 1.0
vBulletin Version: 3.0.0 'Gold' (Should Work w/Others, But That's WHat I Have)
Developer: Majik?



File Changes: 1
/usernote.php


Find in "/usernote.php":
PHP Code:

// ############################### Start Edit User Note ##########################

if ($_REQUEST['do'] == 'editnote')
{
if (
$noteinfo['posterid'] == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANEDITOWNUSERNOTES)
{
// User has permissions to edit any notes that have posted no matter what the other manage permissions are set to..
}
else
{
if (
$viewself AND !($permissions['genericpermissions'] & CANMANAGEOWNUSERNOTES))
{
print_no_permission();
}
else if (!
$viewself AND !($permissions['genericpermissions'] & CANMANAGEOTHERSUSERNOTES))
{
print_no_permission();


And Add The Following Below That:
PHP Code:

 else if (!in_array($bbuserinfo['userid'], preg_split('#\s*,\s*#s'$superadministrators, -1PREG_SPLIT_NO_EMPTY)))
{
$noteuser $DB_site->query_first("SELECT usergroupid FROM " TABLE_PREFIX "user WHERE userid='$noteinfo[posterid]'");
if (
in_array($noteinfo['posterid'], preg_split('#\s*,\s*#s'$superadministrators, -1PREG_SPLIT_NO_EMPTY)))
{
    
print_no_permission();
}
else if (
$noteuser['usergroupid']==6)
{
    
print_no_permission();
}
else if ((
$noteuser['usergroupid']==OR $noteuser['usergroupid']==7) AND $bbuserinfo['usergroupid']!=6)
{
    
print_no_permission();
}


The permisison checking can be changed as desired and is only checked provided that the other standard permissions have passed.. These new settings won't have an effect on those without permission currently.

I have it setup so that SuperAdmins can edit anyone's notes, SuperAdmins'/Admins' notes can only be edited by SuperAdmins, and Mods'/SuperMods' notes can only be edited by Admins/SuperAdmins. If desired, you can change the last elseif statement and add others as needed (or any of them for that matter). ;)

Xenon 04-16-2004 11:21 AM

not bad :)

i will modify it a bit, so it won't user usergroupid's but use the correct permissions and then edit the hack itself :)

you'll be mentioned :)

Majik? 04-16-2004 04:01 PM

Quote:

Originally Posted by Xenon
not bad :)

i will modify it a bit, so it won't user usergroupid's but use the correct permissions and then edit the hack itself :)

you'll be mentioned :)

Ya, that's just what I did the first time quickly. I was going to make some changes to it, but yep.. do whatever you like with it. ;)

the Sandman 04-21-2004 05:54 PM

Any problem installing this hack if the Advanced Editing Options For Mods & Admins hack is already installed (vB 3.0.1)?

the Sandman 04-21-2004 06:26 PM

Hmm - I went ahead and installed it without waiting for a reply since it's so simple and elegant. I'm a SuperAdmin and am able to edit everyone's posts. However, I made a SuperModerator testuser and with that account I cannot edit any post made by a Moderator or higher? Is this a conflict between the two hacks, and is there a solution?


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02150 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete