Advertisement:

Author Topic: Lazy Admin Menu  (Read 55916 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Lazy Admin Menu
« on: July 21, 2014, 09:15:48 AM »
Link to Mod


LAZY ADMIN MENU v2.3
By Dougiefresh -> Link to Mod


Introduction
This mod alters the main menu's Moderate menu to bring all the functionality of the moderation area to the main forum's menu bar.

This mod was inspired by tip provided by snow in Lazy Admin Menu in order to make it easier for the admin to navigate straight to where they want to go.

The only difference is that this mod built dynamically, so that any changes to the moderation menu are shown immediately.

Security Issue Notice
If you are running VERSION 2.0, you are STRONGLY URGED to stop using the mod immediately and upgrade to the latest version, which addresses a MAJOR SECURITY ISSUE that has been resolved.  All version 1.x and version 2.1+ mods are not affected by this security issue!

Admin Settings
There are no admin settings to this mod.  To disable, you must uninstall this mod.

Related Discussions
o [TIP] Lazy Admin Menu

Compatibility Notes
This mod was tested on SMF 2.0.12, but should work on SMF 2.1 Beta 2, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Copyright (c) 2015, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: January 16, 2015, 08:16:39 PM by dougiefresh »
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

kat

  • Guest
Re: Lazy Admin Menu
« Reply #1 on: July 21, 2014, 10:06:13 AM »
Excellent! Thanks for modding this up and ta to snow, again, for the original tip!

Offline ladyquack

  • Newbie
  • *
  • Posts: 5
Re: Lazy Admin Menu
« Reply #2 on: July 21, 2014, 11:20:36 AM »
I rather like this mod. Very nice work! :)

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,887
  • Gender: Male
  • Sapienti satis.
Re: Lazy Admin Menu
« Reply #3 on: July 21, 2014, 01:29:02 PM »
Great idea. Lazy admins can now also skip manual editing. :P
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #4 on: July 21, 2014, 01:41:20 PM »
Not a fan of loading potentially many extra files every page load for admins.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,887
  • Gender: Male
  • Sapienti satis.
Re: Lazy Admin Menu
« Reply #5 on: July 21, 2014, 01:43:26 PM »
Not a fan of loading potentially many extra files every page load for admins.

De gustibus non disputandum est.
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #6 on: July 21, 2014, 01:45:47 PM »
No accounting for taste, eh? Well, I do have a thing about keeping per-page effort low where possible... it's just a shame that more people don't care about such things. Mind you, most people don't seem to care about quality any more.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Lazy Admin Menu
« Reply #7 on: July 21, 2014, 02:47:52 PM »
Uploaded v1.1 - July 21th, 2014
o Reduced the potential need to load so many files by caching the admin area menu.
o Subs-LazyAdmin.php uses the cached version of admin area menu when possible.

EDIT: It should be noted that if the user doesn't have admin rights, this code will not be run for that user.....

EDIT2: If something in the admin menu changes, the main menu's Admin menu won't be updated for the other admins until the other admins logs into the admin area....

Not a fan of loading potentially many extra files every page load for admins.
Good point, ‽......  Fixed that issue in v1.1.....
« Last Edit: August 01, 2014, 04:10:30 PM by dougiefresh »
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Lazy Admin Menu
« Reply #8 on: July 21, 2014, 03:12:15 PM »
LOL I do am lazy in that as I use it everyday, more than once. Installed :3 thanks ♥
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

kat

  • Guest
Re: Lazy Admin Menu
« Reply #9 on: July 21, 2014, 03:20:37 PM »
I hope this is standard, in 2.1...

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Lazy Admin Menu
« Reply #10 on: July 21, 2014, 03:24:01 PM »
Ask the devs to do this :) it won't be that hard I think, as this uses hooks so not really hard to add to 2.1 without breaking things... Of course with dougiefresh's authorization ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #11 on: July 21, 2014, 03:24:46 PM »
I hope not. 2.1 already has enough going on without making it more complicated and more fragile.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Lazy Admin Menu
« Reply #12 on: July 21, 2014, 03:26:40 PM »
I hope this is standard, in 2.1...
Well, in case you're interested, it DOES work with 2.1 Alpha 1 as of July 21, 2014 using 2.0 emulation....  Future compatibility not guaranteed....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Lazy Admin Menu
« Reply #13 on: July 21, 2014, 03:31:37 PM »
Don't be that pessimist Pete :( "complicated and fragile" for a menu redirecting to another being identical? :|
And dougie... Lol on that. Nothing to add actually.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

kat

  • Guest
Re: Lazy Admin Menu
« Reply #14 on: July 21, 2014, 03:34:15 PM »
One can hope...

The admin section, for the entire v2 brach, thus far, has been a pile of poop, for me.

It's totally illogical and, generally, as weird as a sack full of whippets wearing lipstick.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #15 on: July 21, 2014, 03:35:09 PM »
Don't be that pessimist Pete :( "complicated and fragile" for a menu redirecting to another being identical? :|
And dougie... Lol on that. Nothing to add actually.

You have no idea. Yes, complicated and fragile.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Lazy Admin Menu
« Reply #16 on: July 21, 2014, 03:38:51 PM »
...
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #17 on: July 21, 2014, 03:41:44 PM »
OK, let me explain. There is in design terms this concept called the Single Principle Design. There are other names like Single Responsibility Design. What that means is you create a function or chunk of code with a single principle and if that piece of code is ever used in different contexts with different purposes, you're doing it wrong.

AdminMain() does more than set up the menu. If the menu definition were a single function only, and AdminMain() called that, I'd be happier. It reduces fragility (by making fewer assumptions about how a piece of code will be called or used) and complexity (by ensuring that each piece of code has one responsibility) and it means that future changes are less likely to break things with obscure side effects.

This is something SMF has a *lot* of in its design right now.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Lazy Admin Menu
« Reply #18 on: July 21, 2014, 03:46:27 PM »
Thanks for the indirectly-asked explanation :) well but if the mod code is safe it wouldn't hurt to just roughly paste it in there huh? (I love that roughly copy/paste, when it works, rarely XD)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,038
    • Arantor on GitHub
Re: Lazy Admin Menu
« Reply #19 on: July 21, 2014, 03:51:26 PM »
For now, sure. But if AdminMenu changes its behaviour in the future, it's entirely possible it might not work properly.

This whole failing-single-use deal is the result of so much mod instability.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.