| Author |
Message |
shotokan Worker


Joined: Aug 27, 2006 Posts: 153
|
Posted:
Sat May 05, 2007 11:38 am |
|
I have this server block running on my site (nuke 7.8 patched 3.3) and working fine but since it's taking too much space of my main page i was wondering to convert it to a module instead, this way i could use the center portion os the site to better show he NEWS which is what i want.
Well i try doing the conventional but it is not working 100%. As a block it was a two piece code. First the block itself that is an IFRAME calling another program into a different directory and like i said it's working like that.
Here is the first code that call the monitor code:
This one above is working fine and create my dropdown list option but when it comes to the second code below i am getting the famous page not found. I try but couldn't find the problem since using as a block before was working fine.
Here is the monitor code:
Any help here to find where my problem is will be greatly appreciated.
Thanks, |
Last edited by shotokan on Sun May 06, 2007 11:22 am; edited 1 time in total |
|
|
 |
shotokan Worker


Joined: Aug 27, 2006 Posts: 153
|
Posted:
Sat May 05, 2007 4:16 pm |
|
I managed to make the module to work but know there is only one small isssue. When the first program (index.php) call the second program (modules.php) into the IFRAME i got the message "you can't access this file directly". should i remove this condition from my program? |
|
|
|
 |
fkelly Moderator

Joined: Aug 30, 2005 Posts: 2090 Location: near Albany NY
|
Posted:
Sat May 05, 2007 8:20 pm |
|
You shouldn't remove that message. That's a means to assure that everything within nuke accesses files within modules by going thru modules.php. If you look at the address bar when you click on a module name you will see something like this:
| Quote: | | http://yoursite.org/html/modules.php?name=HTML_Newsletter |
If you go thru modules then the constant 'MODULE_FILE' will be defined and you won't get that message. |
|
|
|
 |
shotokan Worker


Joined: Aug 27, 2006 Posts: 153
|
Posted:
Sun May 06, 2007 11:12 am |
|
OK. I haveadded the message back but now look what happens to my module.
You can look at the codes on the zip's above since i have updated them to show what i have now.
Look at the module here. On the left menu it is called "Server Monitor"
Look that is my program index.php that is calling the monitor.php inside an IFRAME and both codes are in the same place /modules/Monitor/ so i don't know why the message is appearing to me as it was being accessed outside of the modules. |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7330 Location: Arizona
|
Posted:
Mon May 07, 2007 7:18 pm |
|
shotokan, the URL within the IFRAME really needs to have a similar structure that the above posted one has if this is a nuke module.
You current have: location.href='modules/Monitor/monitor.php?id=nn' for the iframe URL.
You need to figure out how to turn that into something more like this:
location.href='modules.php?name=Monitor&id=nn'
See what we mean by needing the module to go through modules.php?
I wondering if the following would work:
location.href='modules.php?name=Monitor&file=monitor&id=nn'
Not sure... |
|
|
|
 |
shotokan Worker


Joined: Aug 27, 2006 Posts: 153
|
Posted:
Mon May 07, 2007 7:28 pm |
|
| montego wrote: | shotokan, the URL within the IFRAME really needs to have a similar structure that the above posted one has if this is a nuke module.
You current have: location.href='modules/Monitor/monitor.php?id=nn' for the iframe URL.
You need to figure out how to turn that into something more like this:
location.href='modules.php?name=Monitor&id=nn'
See what we mean by needing the module to go through modules.php?
I wondering if the following would work:
location.href='modules.php?name=Monitor&file=monitor&id=nn'
Not sure... |
Hey Montego,
You're a genius... It worked like charm.
Thanks man. |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7330 Location: Arizona
|
Posted:
Mon May 07, 2007 7:55 pm |
|
| Quote: |
You're a genius... It worked like charm.
|
Wow. I can honestly say that I am pleasantly surprised!  |
|
|
|
 |
|
|
|
|