DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • May 19, 2013, 03:38:27 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Module Hook - bank.php  (Read 3073 times)
0 Members and 1 Guest are viewing this topic.
aes
Guest
« on: August 15, 2004, 09:16:51 AM »

Hi,

Will there be an ability to add a module to bank.php in 0.9.8pr3?  I've taken a look at the code couldn't find modulehook anywhere.

Thanks,
aes
Logged
dut
Guest
« Reply #1 on: August 15, 2004, 10:14:51 AM »

Just add the hook. That's like the eighth request I've seen from different people here. If some of you are ashamed of your code, post it here under completed modules and I'll personally help you clean it up as much as I'm able.
Then, all you have to mention is that you added at line 42 in bank.php(or whatever):
Code:
modulehook("banknav", array("foo"=>$x, "bar"=>$y));

You guys are at least adding them in on your own test servers to see if your code works, right? Wink

Personally, I say that if there's no reason in the core code to call a module there, the patch and code should be released. That's the point of having a "core" and a "module system" under the current license. I've personally got Kendaer to give in, in writing here on story hooks and trust anyone who says "I'll relesase the code for this in 2 weeks when the story arch is over"... at least until the first time they screw that system over. Then they're  blackballed for life, i guess.

acttually, i apologize, aes for hijacking your thread with this license crap... have you seen where i've seen this heading, though?

  -- dut
« Last Edit: August 15, 2004, 01:36:21 PM by dut » Logged
aes
Guest
« Reply #2 on: August 15, 2004, 11:10:49 AM »

Thanks dut.

I've added in:

modulehook("bank", array());

to line 8 in bank.php and I'm able to test my module fine now.

WRT to license stuff, I'm a huge fan of  the new CC license scheme.  I'll be happy to post my finished module and diff version of bank.php when I'm done.  (~ 2 days or  so).

Thanks again.

aes
Logged
dut
Guest
« Reply #3 on: August 15, 2004, 01:37:21 PM »

what have ya got cooking, by the way? Wink Just Gem Storage in the main bank or something exotic?

  -- dut
Logged
aes
Guest
« Reply #4 on: August 15, 2004, 01:43:23 PM »

Right on the money dut.  Smiley  I'm almost done with a module that will allow users to sotre gems in the bank.
Logged
Kendaer
Guest
« Reply #5 on: August 15, 2004, 02:50:12 PM »

Actually, these sorts of requests are useful.
I know that there are useful places for modulehooks which don't have them yet.
That said however, you can *always* make use of the the header/footer hooks
which belong to every page.

for every file (ie, village.php, bank.php, forest.php, etc) there are two automatically defined hooks.

header-<name> and footer-<name>

These can be used if you don't need to put the links on only a specific sub-page (based on op) or something.  For the bank, this sounds like the right thing to use.

I would just use the 'footer-bank' modulehook and register your module to make use of it.  Some of the pre-existing hooks pre-date those being added, so are (sometimes) superflous.

Given that Aes was planning on putting his modulehook right at the top however,  one of the two global hooks for the file should work.  (btw, for most files, it's irrelevant which of header or footer hooks you use.).. It's only relevante which if you are doing output.  Header hooks will come before the bulk text of the page, footer hooks after.  If you need something in the middle of the page or something that only appears after you've chosen some option or another on the page, that is when you need to get a special hook added Wink
Logged
aes
Guest
« Reply #6 on: August 16, 2004, 03:09:20 AM »

Thanks Kendaer,

I think the new module I've made (Gem Vault) requires the modulehook added to bank.php as it requires a bit of user interaction.  If you want to take a look at it It's now posted in my users folder and I've also put a post to the Completed Modules forum with a link to it as well.

Let me know if you think I could get away with using either the header or footer hooks, however, given your last post I don't think they will be adequate for this module.

Regards,
aes
Logged
Kendaer
Guest
« Reply #7 on: August 16, 2004, 07:52:15 AM »

Aes,
it'd work just fine with the footer-bank or header-bank hooks.

Since all you do on the hook is add the nav (which then goes through runmodule) you aren't dependant on a specific hook.
Logged
aes
Guest
« Reply #8 on: August 16, 2004, 08:09:33 AM »

Hi Kendaer,

I removed the modulehook line from bank.php and changed my bankgems.php module to use footer-bank.  I then reinstalled the module using the Module Manager but then wasn't able to see the link on the left nav anymore.

Any ideas?  I'll dig around and see what I can find.

Regards,
aes
« Last Edit: August 16, 2004, 08:09:50 AM by aes » Logged
aes
Guest
« Reply #9 on: August 16, 2004, 08:54:16 AM »

Right, if I use header-bank it works fine which is cool because now no changes need to be made to bank.php.

Thanks again.
Logged
Kendaer
Guest
« Reply #10 on: August 16, 2004, 11:12:40 AM »

Hi Kendaer,

I removed the modulehook line from bank.php and changed my bankgems.php module to use footer-bank.  I then reinstalled the module using the Module Manager but then wasn't able to see the link on the left nav anymore.

Any ideas?  I'll dig around and see what I can find.

Regards,
aes

Very odd.. It should have worked.. I'll have to mess with it and see if I can find out why/fix it.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
25 Guests, 1 User
Minato
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search