DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • January 23, 2018, 03:51:39 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Block Navs?  (Read 6866 times)
0 Members and 1 Guest are viewing this topic.
DarQness
Guest
« on: January 09, 2006, 07:58:24 PM »

agh.. here comes another newb question! ;P

if i wanted to block the module from showing up in a city, but not block the module from functioning... what do i type?

i tried typing in:

blocknav(modulename.php);

and

blocknav(/modules/modulename.php);

however none of them worked...

is there... something im missing from that? :S
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: January 09, 2006, 08:15:26 PM »

Code:
blocknav("runmodule.php?module=modulename");
Basically, whatever is in the village hook of the module.
« Last Edit: January 09, 2006, 08:16:09 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

DarQness
Guest
« Reply #2 on: January 09, 2006, 08:26:49 PM »

Code:
blocknav("runmodule.php?module=modulename");
Basically, whatever is in the village hook of the module.

oh i see, thanks!

umm what if i wanted to link the module to a village module? like... ok, well, i have Dhampir's Arcadia Village module installed, and i wanted to link a module to that village, but i didnt want it to show in the city the village is in... how would i link that one? i tried /modules/modulename.php for that, and it didn't work, and i dont suppose runmodule.php?module=modulename would be the way to go?

PS: ack, i hope that made sense?
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: January 09, 2006, 09:17:30 PM »

your hookname would be "footer-runmodule". There you have to check if "httpget('module') == $arcadiasmodulename" and then if the "httpget('op') is suitable for your module showing up.

OR:

Maybe Dhampir inserted a modulehook in its own in this village... Wink
Logged

Running for more than three years now:
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #4 on: January 10, 2006, 01:06:44 AM »

First of all... for a module, use blockmodule not blocknav. Ideally you should only need blocknav if it is *part* of a module that you're blocking (for example, I have blocked Chat in some areas of the game) or if it is a non-module (ie, core file).

In case XChrisX's explanation didn't quite seem clear, you could (if you wanted) block Petra's module from any of the villages and then add her to the forest

Code:
function yourmodulename_install(){;
   module_addhook("forest");

etc etc

then in your dohook

case village:
   blockmodule("petra");
   break;
case "forest":
   tlschema($args['schemas']['othernav']);
   addnav($args['othernav']);
   tlschema();
   addnav("Petra's Tattoo Parlor","runmodule.php?module=petra");

And YES... as you can see on that last line, the url you posted was correct (just change the module file name).
« Last Edit: January 10, 2006, 01:08:14 AM by SaucyWench » Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #5 on: January 10, 2006, 01:16:06 AM »

And yeah... if Dhampir hasn't written a hook, you can use either "footer-runmodule" or "header-runmodule" in every module written for LoGD. For these, you may not get a say where in the link order your new link appears (for addnav) or where on the screen your text appears (if you are hooking in order to add text).
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #6 on: January 10, 2006, 01:23:53 AM »

First of all... for a module, use blockmodule not blocknav. Ideally you should only need blocknav if it is *part* of a module that you're blocking (for example, I have blocked Chat in some areas of the game) or if it is a non-module (ie, core file).
Well, Saucy, I have to disagree with you!

"blockmodule('petra');" will stop the 'petra'-module from doing anything *after* my module has blocked your's. If my module is executed after your's, then the nav will still appear (because it hasn't been blocked and the code has already run).
"blocknav('runmodule.php?module=petra');" will prevent the Petranav, no matter where I call this function.

the "blockmodule()"-function can only be safely called from the "everyhit" hook (and even there it might interfere with the Isle of Wen... (If Wen blocks your module, that should block something else...)
Logged

Running for more than three years now:
DarQness
Guest
« Reply #7 on: January 10, 2006, 01:33:12 PM »

well actually, it's not as complicated as it seems (or so i hope so), for the arcadia village module, Dhampir has already made it customizable for the admin to just insert the module name and the module link... and i was wondering about what to insert for the link, since modulename.php and modules/modulename.php did not work...

however, the stuff in the core seems to work fine, for example, inserting

title of nav1: MightyE's Weaponry
url of nav1: weapons.php
title of nav2: Pegasus Armor
url of nav2: armor.php

etc.

so i thought a module would work as modules/modulename.php, since it's in the module folder? but apparently that didnt work...
Logged
Dannic
Guest
« Reply #8 on: January 10, 2006, 02:45:18 PM »

You need to add module nav's like so

Code:
addnav("Some Module", "runmodule.php?module=somemodule");
Logged
ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #9 on: January 10, 2006, 04:59:01 PM »

Exactly, so it would be:

title of nav3: modulename
url of nav3: runmodule.php?module=modulename

on some modules, you might have to add the op to enter, such as:

url of nav3: runmodule.php?module=modulename&op=enter

depends on where the actual shopfront is located.
Logged

DarQness
Guest
« Reply #10 on: January 10, 2006, 07:18:05 PM »

wow thanks! the link from the arcadia village  thing works now... but it still shows up in the city... =/ i added the blocknav code in the village.php in the core...
« Last Edit: January 10, 2006, 07:19:04 PM by DarQness » Logged
ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #11 on: January 10, 2006, 07:24:13 PM »

well, you COULD just take out the whole 'case "village": part from the script itself(the module). That would keep the link from showing in the village too.

« Last Edit: January 10, 2006, 07:25:01 PM by ShadowRaven » Logged

Dannic
Guest
« Reply #12 on: January 10, 2006, 07:25:04 PM »

Are you trying to block from just a specific city or all cities?
Logged
DarQness
Guest
« Reply #13 on: January 10, 2006, 07:26:37 PM »

Are you trying to block from just a specific city or all cities?

just from the main city, degolburg
Logged
ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #14 on: January 10, 2006, 07:33:11 PM »

do you have the cities module running or do you just have the one main city?

edit: except for Arcadia
« Last Edit: January 10, 2006, 07:35:10 PM by ShadowRaven » Logged

Pages: [1] 2   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
33 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search