DragonPrime - LoGD Resource Community

Coding Support => Coding Support Desk => Topic started by: TGTarheel on July 31, 2017, 10:04:09 PM



Title: Move Superuser Grotto Links
Post by: TGTarheel on July 31, 2017, 10:04:09 PM
I would like to know if there is a way to mmove the Superuser Grotto link.

I would like to see the left-side navigatns the way my players see them, and the Superuser Grotto links get in the way of seeing it.

I was wondering if it would be possible to code a module that would move that link up to the upper right, near, say, the Petition Viewer...instead of in the left-side navigations.

The reason I ask is because, literally every module has Grotto links as well as the villages and so on.  I do not want to have to manually add blocknavs on every module everywhere...was wondering if there was a way to achieve this.

By the way, I run 1.1.0 on my server.


Title: Re: Move Superuser Grotto Links
Post by: Aeolus on July 31, 2017, 10:11:54 PM
I would like to see the left-side navigatns the way my players see them, and the Superuser Grotto links get in the way of seeing it.

Create a second account that doesn't have any superuser flags? Quickest way to see things like a player is to be a player.

I was wondering if it would be possible to code a module that would move that link up to the upper right, near, say, the Petition Viewer...instead of in the left-side navigations.

That would require core editing, rather than a module. Take a look at the templates and see how the links are added.

The reason I ask is because, literally every module has Grotto links as well as the villages and so on.  I do not want to have to manually add blocknavs on every module everywhere...was wondering if there was a way to achieve this.

That's a module doing that. sulinks.php, I believe, adds Grotto links to every page.


Title: Re: Move Superuser Grotto Links
Post by: TGTarheel on July 31, 2017, 11:07:53 PM
I would like to see the left-side navigatns the way my players see them, and the Superuser Grotto links get in the way of seeing it.

Create a second account that doesn't have any superuser flags? Quickest way to see things like a player is to be a player.
Agreed.  And I have a player character.  The problem is I still see the Grotto Links because, for now, i have the Translation Too active for this player because I am overhauling the site.
I was wondering if it would be possible to code a module that would move that link up to the upper right, near, say, the Petition Viewer...instead of in the left-side navigations.

That would require core editing, rather than a module. Take a look at the templates and see how the links are added.
That was what I was afraid of.  Would it require also editing every single module that would add the grotto links?

The reason I ask is because, literally every module has Grotto links as well as the villages and so on.  I do not want to have to manually add blocknavs on every module everywhere...was wondering if there was a way to achieve this.

That's a module doing that. sulinks.php, I believe, adds Grotto links to every page.
Yeah...adding Grotto Links to pages.  I want to remove them from where they are, and put them somewhere else.  A little different concept.  I was just wondering if it would be possible to make a module that would do this...or would I have to try to attempt it via core edit?

It just seemed to me that if there is a module to add superuser links to pages...then seems like one could be made to remove them.  And maybe in the same module, add the Grotto link up near the Petition Viewer link, like I mentioned.  Just was wondering if it was even possible to do this before I started wasting time if it isn't.


Title: Re: Move Superuser Grotto Links
Post by: Aeolus on August 01, 2017, 03:31:09 PM
Agreed.  And I have a player character.  The problem is I still see the Grotto Links because, for now, i have the Translation Too active for this player because I am overhauling the site.

Well, then - you don't have a player account then, do you?

That was what I was afraid of.  Would it require also editing every single module that would add the grotto links?
Yeah...adding Grotto Links to pages.  I want to remove them from where they are, and put them somewhere else.  A little different concept.  I was just wondering if it would be possible to make a module that would do this...or would I have to try to attempt it via core edit?

It just seemed to me that if there is a module to add superuser links to pages...then seems like one could be made to remove them.  And maybe in the same module, add the Grotto link up near the Petition Viewer link, like I mentioned.  Just was wondering if it was even possible to do this before I started wasting time if it isn't.

Let's think about this. If you have a module that adds Grotto links to every page... and you want to remove or edit those links... why not remove or edit that very same module? Having a module that adds the links then creating a new module to block those links is utterly pointless. I also just told you which module it is.

Also still a core edit.


Title: Re: Move Superuser Grotto Links
Post by: TGTarheel on August 01, 2017, 06:22:46 PM
Agreed.  And I have a player character.  The problem is I still see the Grotto Links because, for now, i have the Translation Too active for this player because I am overhauling the site.

Well, then - you don't have a player account then, do you?

That was what I was afraid of.  Would it require also editing every single module that would add the grotto links?
Yeah...adding Grotto Links to pages.  I want to remove them from where they are, and put them somewhere else.  A little different concept.  I was just wondering if it would be possible to make a module that would do this...or would I have to try to attempt it via core edit?

It just seemed to me that if there is a module to add superuser links to pages...then seems like one could be made to remove them.  And maybe in the same module, add the Grotto link up near the Petition Viewer link, like I mentioned.  Just was wondering if it was even possible to do this before I started wasting time if it isn't.

Let's think about this. If you have a module that adds Grotto links to every page... and you want to remove or edit those links... why not remove or edit that very same module? Having a module that adds the links then creating a new module to block those links is utterly pointless. I also just told you which module it is.

Also still a core edit.

So you are saying to edit the sulinks.ph file to remove the links instead of add them.  That makes sense.  But that only covers the villages...not the hundreds of modules that alsoo have Grotto links...this is where I am getting confused...how to get rid of them...and then...how to move the grotto link where I want it moved?

A simple blocknav would work - replacing all the addnav in sulinks with a blocknav.  But does that take care of the links in all the many modules of the game and then there is still the need to have a link...but at the upper right.  THAT is probably where a core edit is required.

Or am I wrong here? My coding skills are intermediate.  I know just enough to be truly dangerous.


Title: Re: Move Superuser Grotto Links
Post by: Stephen.Kise on August 02, 2017, 09:23:40 AM
I was wondering if it would be possible to code a module that would move that link up to the upper right, near, say, the Petition Viewer...instead of in the left-side navigations.

That would require core editing, rather than a module. Take a look at the templates and see how the links are added.

That is not true. Hook into everyheader-loggedin, use the $header global string and append the grotto link after {petitioncount}. Also,


Title: Re: Move Superuser Grotto Links
Post by: Aeolus on August 02, 2017, 02:17:00 PM
That is not true. Hook into everyheader-loggedin, use the $header global string and append the grotto link after {petitioncount}. Also,

That... would make sense. I completely forgot about the everyheader-loggedin hook. I stand corrected. And also?


Title: Re: Move Superuser Grotto Links
Post by: TGTarheel on August 02, 2017, 08:56:28 PM
Good so far, but of course, only want those with Grotto access to have the link in the everyheader.


Title: Re: Move Superuser Grotto Links
Post by: Aeolus on August 03, 2017, 06:26:14 PM
Good so far, but of course, only want those with Grotto access to have the link in the everyheader.

Check how any admin module makes these links available to only those with grotto access. It'll be an in "if" statement, concerning the user's superuser flags.


Title: Re: Move Superuser Grotto Links
Post by: TGTarheel on August 04, 2017, 07:22:20 AM
Duhhh.  That's what I get for trying to do too many things at the same time.

OK, so I would alter sulinks to remove, via blocknav, all the superuser links...and then have it add the link, conditionally, using every-header-logged in - which is a hook.

That would then theoretically get me what I am after....it would seem.

I might have to go about checking a few other modules to make sure they do not also add the navs...for example, I am using a fork of Wraith's that adds the Grotto links.  Meaning I could grab the conditional right from there, too or any other admin module...I know it is something like if SU_USER = true or something...gotta look...


Title: Re: Move Superuser Grotto Links
Post by: TGTarheel on August 04, 2017, 07:35:39 AM
here is what is in Wraith's:

Code:
if( $session['user']['superuser'] & SU_MANAGE_MODULES )

this is from sulinks
Code:
if ($session['user']['superuser'] &~ SU_DOESNT_GIVE_GROTTO){

from multichecker
Code:
if ($session['user']['superuser'] & SU_MEGAUSER) { //only access for megausers

Finding several other variations...but it seems to me like the one from sulinks would be what I want...because it would then give the link to all who actually have grotto access on any level.

By the way, looking around on my site and discovered I have sulinks installed.  Should try deactivating it and see what I see.  THEN...try to go about what I have in mind.

I put the site together years ago and I do not remember everything I have there, LOL

BUT...one thing bothers me.  SU_DOESNT_GIVE_GROTTO  - should it not be SU_GIVES_GROTTO?

Code:
Or maybe forget it and just use if ($session['user']['superuser']) = true {

Thus, theoretically giving the link to any superuser?

Advice here?

Normally I'd play o my own, but I don't want to accidentally give grotto access to unauthorized people and not know about it.

© 2017 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines