Jump to content


Enable and disable a function?

  • Please log in to reply
No replies to this topic

#1 dbgtrulz

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 05 April 2006 - 05:56 PM

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 adding to pages without editing them, so that it is alot easier to install modules. But, I need to make a module that removes 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:
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?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users