nb Core Community
February 07, 2012, 08:14:01 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: 1.2.3 +nb is now final and released

@new registrations. I will not allow any new registrations here as there are more (real person) spambots here than ever.... captcha proved to be ineffective.

After your registration, mail me at ( admin AT shinobilegends.com ) from the mail address you want to register. Provide some text about you and possibly your game.
 
   Home   Help Search Calendar Downloads Login Register  
Pages: [1]
  Print  
Author Topic: Help with adding a navigation link to a module  (Read 703 times)
Alchemion
Guest
« on: November 23, 2009, 07:59:43 pm »

Hi, Oliver,

I am trying to connect unite the totalinventory module with the inventorypopup module from Item System.

I resumed to this solution: I blocked the link to item inventory (item system) from appearing in charstats and tried to insert it directly in the totalinventory module, under the equipment stuff list...

the modified code from totalinventory.php module is (with Bold text):

//*****STARTING EQUIPPED  DISPLAY*****
   require_once("modules/totalinventory/equipped.php");

     $eqd = translate_inline("Equipment detalis");
         $display.="<a href='runmodule.php?module=inventorypopup' onClick=\"".popup("runmodule.php?module=inventorypopup").";return false;\" target='_blank' align='center' style=\"font-size:12px\">$eqd</a>";   
         addnav("","runmodule.php?module=inventorypopup");
         addnav("`n",$display);


I also modified modules/totalinventory/equipped.php with this (in bold):

//BEGIN EQUIPPED DISPLAY
   //STARTING DISPLAY OF THE WEAPONS SUB CATEGORY
   $ti_equippedcat_weapons=1;
   if ($ti_equippedcat_weapons==1) {
   
   $infolink= "<a href='runmodule.php?module=inventorypopup' target='_blank' onClick=\"".popup("runmodule.php?module=inventorypopup","500x300")."; return false;\" 'class='motd'>Detailed Equipment</a>";
       addnav("","runmodule.php?module=inventorypopup");
       addnav("More Infos",$infolink);
 
         
      rawoutput("<font color=#800000><center><b><u><br>");
      output("Weapons");
      rawoutput("</b></u></center></font>");
   }   
      //DISPLAYING THE CORE WEAPON

The issue is that NO LINK appears in the "Equipped Items" column of the Equipment List pop-up window...

Please tell me where did I put the code wrongly or unsufficiently ?..

Thank you.
Emanuel C.
Logged
Alchemion
Guest
« Reply #1 on: November 24, 2009, 12:20:07 pm »

Hi,
I couldn't help myself from trying different codes...
I have eventually found the solution:

I have modified the modules/totalinventory/equipped.php with this (in bold):

//BEGIN EQUIPPED DISPLAY

   rawoutput("<center><b><u>");
    addnav("","runmodule.php?module=inventorypopup");
        rawoutput("<a href='runmodule.php?module=inventorypopup' class='colDkBlue'>Click for MORE details !</a>");
   rawoutput("</b></u></center>");

   //STARTING DISPLAY OF THE WEAPONS SUB CATEGORY


Also, I have modified the modules/inventorypopup.php with this (in bold):

        addnav("","runmodule.php?module=totalinventory");
      rawoutput("<a href='runmodule.php?module=totalinventory'>Back to the general inventory list</a>");

   output("`n`nYour are currently wearing the following items:`n`n");

Edit: And, of couurse I have blocked the module from appearing in stats, modifying the modules/totalinventory.php with this (in bold):

                blockmodule("runes");
      blockmodule("inventorypopup");

and

                unblockmodule("runes");
      unblockmodule("inventorypopup");

Maybe others would be interested also...

The Ancient Chemist
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 306



View Profile WWW
« Reply #2 on: November 27, 2009, 02:23:12 pm »

blocking / unblocking is tricky.

If you merge (and hence partly rewrite) modules, you can just delete the addnav() itself.

Some modules do nasty stuff.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!