Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
sak
Worker
Worker


Joined: Jul 06, 2005
Posts: 172

PostPosted: Wed Jul 06, 2005 5:41 am Reply with quote

Well I've finally got a nuke installation (7.8 patched, sentinel, other goodies) that I'm happy with. I've been messing with calendars and all sorts of other crap. I'm almost there Wink

I just have one more need though. We've got another website (php site) that keeps track of some member data and our members frequently need to access this. Rather than just have a link from our phpnuke site to open a new browser window for the other php site, is there a good/easy way to port a page into nuke?

I guess what I'm asking is...when a registered user clicks on a link under modules or wherever...I would like it to open the other site in sort of a frame within the phpnuke site. I would also like it to cut out the blocks on the right, but leave the rest (top, left blocks, bottom) of the phpnuke site intact.

If I had any skills in coding I could maybe just combine the other php site into nuke, but that's beyond my abilities at this point in time. Any thoughts/recommendations are GREATLY appreciated Very Happy

Thanks all!
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Wed Jul 06, 2005 6:53 am Reply with quote

Try something like this. This does require that your php.ini file has allow_url_fopen = On . Try it and if it works then you're ok Smile. Save this as modules/YOUR_MODULE/index.php and activate through the acp. You may have different code as your first line ( if ( !defined('MODULE_FILE') ) ) depending on what version and patch level you are at.
Code:
<?

if ( !defined('MODULE_FILE') )
{
   die("You can't access this file directly...");
}
$index=0; //supress right blocks
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
@get_lang($module_name);
include ('header.php');
OpenTable();
echo file_get_contents('http://yahoo.com');
CloseTable;
include('footer.php');
die();
?>
 
View user's profile Send private message
sak
PostPosted: Wed Jul 06, 2005 7:31 am Reply with quote

very neat raven! I think I'm pretty darn close now. The only problem is it sort of affects the whole site (the colors/formatting) of the phpnuke site all change when it loads up the other php site. Other than that, there's a few issues with hyperlink references and such, but I'm working those out I think.
 
Raven
PostPosted: Wed Jul 06, 2005 7:44 am Reply with quote

Great! Post back if you get stuck.
 
sak
PostPosted: Fri Jul 08, 2005 2:05 am Reply with quote

I've been playing with the iframes stuff, and things seem to be working decently now Smile

One quick question tho. Is there a way to disable the left blocks too? I notice $index=0 takes care of the right blocks, but what about the left? I've tried to search for the answer, but haven't been able to find it Sad
 
Raven
PostPosted: Fri Jul 08, 2005 8:05 am Reply with quote

RTM Only registered users can see links on this board! Get registered or login!
 
sak
PostPosted: Sun Jul 10, 2005 4:17 am Reply with quote

Once again thanks. I guess my searches weren't good enough Sad Didn't type HIDE left blocks.

Everything is working very very nicely now and looking great. I have one small problem though.

The content of the iframe is a php site as i said, and the links at the top (all main navigation links) completely overtake the browser window when clicked, rather than staying nicely confined to its iframe like a good little script.

Just about all of the other links are ones in tables (the site is basically a large database viewer, lots of tables/rows/columns and everything is sortable and has details when clicked. It's just these darn links at the top that don't seem to use the same method.

I wish i knew enough about php to hypothesize what the problem is, but all I can guess is the links in the tables use some different method than the ones at the top. I've dug into the files a bit in hopes of spotting something obvious, but I guess you could say it's a different "language" to me Wink

anyone else that has used iframes run into this type of problem? it happens in both IE and firefox (first thing i checked) so i can't just blame IE this time


EDIT: Found out what it was. I did a bit more research into iframes and found that target="_top" will destroy them Wink Maybe someone else will come across this and find this info helpful


Last edited by sak on Sun Jul 10, 2005 6:07 am; edited 1 time in total 
sak
PostPosted: Sun Jul 10, 2005 4:51 am Reply with quote

[Ignore] Groovy I hate to post another question here, but here goes:

If one wished to hide the main logo of the site for a certain module, would one have to create an alternate header.html file that excludes the logo? And then use an if/else to decide which header.html file to load based upon which module is in use? This is the only way apparent to me, but had to ask just in case there's something much easier im missing Groovy [/Ignore]

edit: figured it out ^_^


Last edited by sak on Sun Jul 10, 2005 5:37 am; edited 3 times in total 
sak
PostPosted: Sun Jul 10, 2005 5:00 am Reply with quote

This is what I come up with, gonna test it out in a sec. just modified a random theme file

Code:
    if ($name=="MODULE_NAME") {

    $tmpl_file = "themes/THEME_NAME/altheader.html";
    }
    else $tmpl_file = "themes/THEME_NAME/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    if ($name=="MODULE_NAME") {}
    else blocks(left);


one working way to do it
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©