<?php
/*
Framebrowser - add external content within your Xoops site 
Want to add content within your Xoops website? 
I have fixed framebrowser to work with your Xoops portals. 

To be honest the above text is paraphrased from the text on the Postnuke site.
http://mods.postnuke.com/modules.php?op=modload&name=News&file=article&sid=863


FRAME BROWSER for PHP-NUKE 5.2 : Web Portal System
====================================================================

Copyright (c) 2001 by ~ Mario Stoitsov (stoitsov@inrne.bas.bg)

This module will integrate any website into your PHP-NUKE portal
using an <iframe> tag with all its advantages and disadvantages

Usage: framebrowser.php?urlnav=anyurl

No Special requirements.

Thanks to Attila Seres (lophas@yahoo.com) NUKE-BROWSER

Made some tiny changes so that this also works with the awesome
Xoops portal system - Have fun - mike@jeweetwel.net

This program is free software. You can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License.
*/



if(!IsSet($mainfile)) { include ("mainfile.php"); }

// empty url
if($urlnav==''){
include("header.php");
OpenTable();
echo ("<center><b><font color=red> No URL selected. </font> </b></center>");
//echo "<br><br><table border=0 cellpadding=0 cellspacing=0 align='center'><tr><td align='center'><form action='framebrowser.php' method=post><font size=1><center>Frame Browser</center></font><input type=text name=urlnav></form></td></tr></table>";
CloseTable();
include("footer.php");
die;
}

// set url
$urladdress=$urlnav;
if(substr($urladdress,0,1)=="/") $urladdress=substr($urladdress,1,strlen($urladdress)-1);
if(substr($urladdress,0,7)!="http://") $urladdress='http://'.$urladdress;
if(substr($urladdress,strlen($urladdress)-1,1)=="&") $urladdress=substr($urladdress,0,strlen($urladdress)-1);

// url not correct
$urladdress1=$urladdress.'/';
if(!@fopen($urladdress1,"r")){
if(!$header) include("header.php");
OpenTable();
echo ("<center><b>URL address <font color=red> ".$urladdress." </font> not found. </b></center>");
//echo "<br><br><table border=0 cellpadding=0 cellspacing=0 align='center'><tr><td align='center'><form action='framebrowser.php' method=post><font size=1><center>Frame Browser</center></font><input type=text name=urlnav></form></td></tr></table>";
CloseTable();
include("footer.php");
die;
}

// url opened
$urladdress=rawurldecode($urladdress);
include("header.php");
include "wacky/includes/init.php";
OpenTable();

$urladdressstring=$urladdress;
if(strlen($urladdressstring)>50)$urladdressstring=substr($urladdressstring,0,50).'...';
echo '<table class=outline><tr><td><table cellspacing="1" cellpadding="5"><tr><td class="blockTitle">&nbsp;Wacky Days</td></tr><tr><td class=head><table cellspacing=16 cellpadding=15><tr><td class=blockWacky><br>&nbsp;&nbsp;Welcome to the Activity Directors Network!<br>&nbsp;&nbsp; &nbsp;&bull;&nbsp;Search our ".. on this Day in History" database for Famous Days in History, Famous Birthdays, Famous Events ...<br>&nbsp;&nbsp; &nbsp;&bull;&nbsp;Find Theme Days, National Ice Cream Month, National Hug your Neighbor Week in the Wacky Days Database. <br>&nbsp;&nbsp; &nbsp;&bull;&nbsp;Add a New Event, a New Anecdote, a Sentimental Poem... <br>&nbsp;&nbsp;<b>NOTE:</b> Please use the Contact Us Form on the Main Menu to report any changes or errors.<br></td></tr></table></td></tr><td class="blockContent">';
echo "<iframe SRC=\"".$urladdress."\" WIDTH=\"100%\" HEIGHT=\"1200\" FRAMESPACING=0 FRAMEBORDER=no BORDER=0 SCROLLING=auto></iframe>";
CloseTable();
include("footer.php");
die;

?>

