DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • August 18, 2019, 06:50:33 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Problem with dragonkills.php module  (Read 2196 times)
0 Members and 1 Guest are viewing this topic.
Tela
Guest
« on: March 18, 2008, 10:53:28 PM »

Listed in the download section, HERE.

It's the module to "show dragonkills in vital info", and it doesn't seem to work with 1.1.1 - My guess is because of the charstats hook, but I don't know..My only experience really is with 1.1.1 and it's very limited. The error I receive is:

Code:
PHP Warning: "dragonkills_dohook did not return an array in the module dragonkills for hook charstats."
in /lib/modules.php at 530.
Call Stack:
2: trigger_error("<b>dragonkills_dohook</b>...", 512) called from /lib/modules.php on line 530
3: modulehook("charstats") called from /lib/pageparts.php on line 692
4: charstats() called from /lib/pageparts.php on line 124
5: page_footer() called from village.php on line 302

And the module is found below, minus the "settings" and "run" sections. It's a very small module. The module can be downloaded in it's entirety from the link at the top of this post. However, should it remain borked, it should be moved to the unsupported module section. Though, I am sure it is an easy fix.

Code:
function dragonkills_install(){
module_addhook("charstats");
    return true;
}

function dragonkills_uninstall(){
return true;
}

function dragonkills_dohook($hookname,$args){
global $session;
switch($hookname){
case "charstats":
if (get_module_pref("user_showdks") == 1 && get_module_setting('allow_showdks')){
$title = translate_inline("Personal Info");
      $stat = translate_inline("DragonKills");
$new = $session['user']['dragonkills'];
setcharstat("Personal Info",$stat,$new);
break;
}
default:
//nuthing
}
}

Also, I'm not sure if this is the proper place to post this. I was unable to find a post regarding this module.
Logged
Rohen
Codemeister
****
Offline Offline

Posts: 264


View Profile WWW
« Reply #1 on: March 18, 2008, 11:17:55 PM »

The do_hook function have no return argument, thats what the warning tell you.

Code:
function dragonkills_dohook($hookname,$args){
global $session;
switch($hookname){
case "charstats":
if (get_module_pref("user_showdks") == 1 && get_module_setting('allow_showdks')){
$title = translate_inline("Personal Info");
      $stat = translate_inline("DragonKills");
$new = $session['user']['dragonkills'];
setcharstat("Personal Info",$stat,$new);
break;
}
default:
//nuthing
}
       return $args;
}

should work.
Logged

Tela
Guest
« Reply #2 on: March 19, 2008, 01:52:54 AM »

Thanks Rohen. Smiley

Don't know how I missed that AND the module thread when I looked earlier. I submitted the fix in the module's thread. Smiley
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #3 on: May 17, 2009, 08:37:06 PM »

Elessa, could you please delete the dragonkills.zip file in the downloads section (link at top of first post), module doesn't work.

Attached is a modified version that you can replace it with. Thank you. Smiley
Logged

Check My Modules for the latest versions.
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #4 on: May 17, 2009, 08:57:41 PM »

done. download link remains the same.  Smiley
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
102 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search