Jump to content

Enable and disable a function?


dbgtrulz

Recommended Posts

Ok, so, this php game called Legend of the Green Dragon (lotgd) has a module system where it adds hooks onto pages, and the hooks can be referenced by modules. This allows [b]adding[/b] to pages without editing them, so that it is alot easier to install modules. But, I need to make a module that [b]removes[/b] somthing.
So, this game has functions called addnav(String name, String link) and addnav(String name). The latter one adds a category on the left side of the page, and the first one adds links (navs) under that category. For example, this:
[code]addnav("Tavern Street");
addnav("Inn","inn.php");
addnav("Stables","stables.php");[/code]
Would add somthing like this:

---Tavern Street---
[a href=\"http://inn.php\" target=\"_blank\"]Inn[/a]
[a href=\"http://stables.php\" target=\"_blank\"]Stables[/a]

Anyway, I want to make a module that blocks all the navs in the village unless the player is on the right street (ex. village.php?street=marketstreet). So, I can of course use the blocknav(String name, String link) function to block the default ones, but, the hooked ones from the modules are always different depending on which modules are installed. With many modules being released every week, I cannot just block every single module, so, I got the idea to append the function addnav(String name) and make it so that if the name isn't the same as the street, disable the addnav function, if not, enable the addnav function. But, I don't know how to disable, enable, or append functions without editing their code directly or adding packages to the core PHP. Any advice?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.