Jump to content


This topic is now archived and is closed to further replies.


Enable and disable a function?

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");
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?

Share this post

Link to post
Share on other sites


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.