Author Topic: Help with adding a navigation link to a module  (Read 4083 times)

Alchemion

  • Guest
Help with adding a navigation link to a module
« 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.

Alchemion

  • Guest
Re: Help with adding a navigation link to a module
« 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

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 320
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: Help with adding a navigation link to a module
« 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.
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