vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE v2.x.x] Improved USER ACCESS MASKS interface! (https://vborg.vbsupport.ru/showthread.php?t=28409)

merk 09-18-2001 10:00 PM

Purpose: I run many many forums(120+ including subcatagories) so i needed a more efficient way of controlling access masks(there is an infinite combination of usergroups if i was to use that method.)

So set about creating a better system.

For an example, view the attachment. (default setting=green, yes=red, no=blue).

Installation:

First, you need to open up adminfunctions.php in the /admin/ directory and add (just before the ?>)

PHP Code:

// ###################### Start makeoptioncode #######################
function makeoptioncode ($value="",$description$selected=""$color="green") {
// similar to makeinputcode, only for a text area

  
echo "\n<OPTION value=\"$value\" $selected style=\"color:$color\">$description</option>";


Then go into user.php in the /admin/ directory
Go to ~~ 358 and find
PHP Code:

// ###################### Start Edit Access #######################

/*if ($action=="editaccess") { 

Delete everything from that point to
PHP Code:

  doformfooter("Save Changes");


(Thats just the edit access bit, nothing else!)

Then, put where that was
PHP Code:

// ###################### Start accessmasks function #######################
function accessmasks($parentid=-1) {
  global 
$DB_site$userid$forumid;
  
$forums=$DB_site->query("SELECT forumid,title,displayorder FROM forum WHERE parentid=$parentid ORDER BY displayorder");
  while (
$forum=$DB_site->fetch_array($forums)) {
  
$accesslist=$DB_site->query_first("SELECT * FROM access WHERE userid='$userid' AND forumid='$forum[forumid]'");
    if ( 
is_array($accesslist) )
    {if (
$accesslist['accessmask']==0)
      {
$sel 0$tempcolour="blue";}
      elseif (
$accesslist['accessmask']==1)
      {
$sel 1$tempcolour="red";}
      else {
$sel = -1$tempcolour="green";}}
    else
    {
$sel = -1$tempcolour="green";}
    echo 
"<li><div style=\"color:$tempcolour\"><b>$forum[title]</b>";
    echo 
" > > > <SELECT name=\"accessupdate[".$forum['forumid']."]\" style=\"font-size: 7pt; background-color: #dfdfdf; font-family: Arial, Tahoma;\" maxlength=\"20\">";
    
makeoptioncode(1,"Yes",iif($sel==1,"selected",""),"red");
    
makeoptioncode(0,"No",iif($sel==0,"selected",""),"blue");
    
makeoptioncode(-1,"Default",iif($sel==-1,"selected",""),"green");
    echo 
"</select></div>\n\n";
    echo 
"<input type=\"hidden\" name=\"oldcache[".$forum['forumid']."]\" value=\"$sel\">";
    echo 
"<ul>";
    
accessmasks($forum[forumid]);
    echo 
"</ul>\n";
    echo 
"</li>\n";
  }}

// ###################### Start modify #######################
if ($action=="editaccess") {
  
$user=$DB_site->query_first("SELECT username FROM user WHERE userid='$userid'");
  
doformheader("user","updateaccess",0,0);
  
makehiddencode("userid","$userid");
  echo 
"<div align=center><h3>User Forum Access for <i>$user[username]</i></h3></div>";
  echo 
"<tr class='firstalt'><td colspan=2><p>Here you may edit forum access on a user-by-user basis.
  <BR>Selecting \"yes\" will allow this user access to the forum. Selecting \"no\" will deny this user access to the forum. Any changes made to this user's account will override the default permission settings in their usergroup.
  <br><br>Selecting \"default\" will revert this user to the default permissions settings for their usergroup.
  <BR><br>(Please note that the permission inheritance system still works here)
  <br><br>(Ensure that you have access masks enabled before attempting to use these!)</p></td></tr>\n"
;
  echo 
"<br>";
  echo 
"<ul>\n";
  
accessmasks(-1);
  echo 
"</ul>\n";
  
doformfooter("Save Changes");


Thats it!

PS. Devlopers / Moderators - i wasnt sure if i copied and
pasted too much code in the above, well actually i rewrote most
of it, but based on your principles in the modify forums section. If
its too much, please feel free to delete it, but because i didnt
know...!


Demo Screenshot attached

merk 09-19-2001 05:09 AM

Please excuse the blurryness of the font in the screenshot, thats just windows XP antialiased fonts in action ;)

[VbbFr]Elie 09-19-2001 05:54 PM

It's Working Very Well :)

  • I make a ScreenShot and and a French Version ...

DarkReaper 09-19-2001 06:34 PM

What exactly does this do? I'm not too clear on it.

Also, will it work with your other "allow mods to modify access masks" hack?

When will your hack for allowing mods to edit their forums styles come out? I really need that one and would be willing to (try)help you.

[VbbFr]Elie 09-19-2001 08:07 PM


merk 09-19-2001 10:50 PM

Quote:

Originally posted by DarkReaper
What exactly does this do? I'm not too clear on it.

Also, will it work with your other "allow mods to modify access masks" hack?

When will your hack for allowing mods to edit their forums styles come out? I really need that one and would be willing to (try)help you.

This hack, rearranges the accessmasks for the adminCP. it doesnt effect the modcp hack.

It rearranges the Accessmasks per user screen to be more readable.

And the styles hack is almost complete, im just adding a few more features.

DarkReaper 09-20-2001 02:15 AM

Great! When are you going to release it? What features are in it/are you adding?

merk 09-20-2001 03:18 AM

Im adding features that contain options on what you will allow to be modified. Also making the code a bit neater.

However, because of the recent release of the Halflife 1108 patch, my server was taken down, in reflex action of my host, simply because i was hosting the files, and peaking at 3mb/sec(which is alot for a webserver, maybe i should have warned them? :))

Anyway, it should be back up in about an hour, ill try get it done then.

DarkReaper 09-20-2001 10:57 AM

Ok, I'm impatient :)

Been several hours, where is it!? ;);)

merk 09-20-2001 11:25 AM

Its actually alot more complex than i thought it would be.

That, and i still havent got my ftp back online :|

Im sorry for taking so long, but at the moment, australian internet is really buggered, it just wont do anything with international pages, im lucky i got this far here.

The weekend is fast approaching, and i should have it done, hopefully by tommorow night my time.

I hope its not a empty promise either! :(

Dont worry, itll be here soon, just its a pain to write how to put it together, considering that im not allowed to just paste it :|


All times are GMT. The time now is 01:37 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.01046 seconds
  • Memory Usage 1,773KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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