| Author |
Message |
helidoc Hangin' Around

Joined: Jul 09, 2006 Posts: 43
|
Posted:
Thu Feb 11, 2010 7:56 am |
|
I've been doing some major work on my site the last few months trying to clean it up. Very old theme and content, since the upgrade to 2.4 one of the things I've been shooting to do is get rid of the use of iframes in my modules. Most of the modules that called an html file I was able to use the following code to accomplish just that, writing my page in xhtml and removing the head, body, and html tags.
| Code: | <?php
if ( !defined('MODULE_FILE') )
{
die("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include_once('header.php');
include('somepage.html');
include_once('footer.php');
?> |
Where I am stuck at is my use of groups and the modules I have for those groups, I have certain forum shortcuts in the modules block that are visable to certain users. I use the following code to direct them to that particular forum, but it uses an iframe and I would certainly like to drop the use of the iframe I have yet to figure out how to accomplish this any help would be appreciated.
| Code: | <?
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if(!IsSet($mainfile)) { include_once ("mainfile.php"); }
$index=0;
$go_to_address1="./modules.php?name=Forums&file=viewforum&f=5";
$go_to_address=rawurldecode($go_to_address1);
OpenTable();
echo "<center><h4><a href=\"index.php\">Click to close.</a></h4></center>";
echo "<iframe SRC=\"".$go_to_address."\" width=\"100%\" height=\"1200\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>";
CloseTable();
die;
?> |
|
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
|
Posted:
Thu Feb 11, 2010 10:43 am |
|
Can you post a screen shot of what this does. I am having a hard time visualizing what this is supposed to be doing. I guess I understand what this particular file does, but not where. |
|
|
|
 |
helidoc Hangin' Around

Joined: Jul 09, 2006 Posts: 43
|
Posted:
Fri Feb 12, 2010 5:55 pm |
|
Here's a screenshot as you can see by clicking on the Trades module in the NukeNav box what the code above does is open the particular forum into an iframe bypassing the forum index so that you do not see the other forums listed. You then have to click the click to close at top to close out the iframe. What I'm attempting to do is get rid of iframes all together if it can be done. Thanks
 |
|
|
|
 |
nuken RavenNuke(tm) Development Team

Joined: Mar 11, 2007 Posts: 1435 Location: North Carolina
|
Posted:
Sat Feb 13, 2010 7:32 am |
|
If you just want to redirect to a certain page, you could create a module with an index.php that has something like the following:
| Code: | <?php
/************************************************************************/
/* 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(!defined('MODULE_FILE')) {
header('Location: ../../index.php');
die();
}
Header("Location: modules. php?name=Forums&file=viewforum&f=5");
?>
|
You would need to remove the space between modules. and php.
Just change the Location to the forum you want it to point to. |
|
|
|
 |
helidoc Hangin' Around

Joined: Jul 09, 2006 Posts: 43
|
Posted:
Sat Feb 13, 2010 9:06 am |
|
That worked perfect thanks, I know my users will appreciate the missing iframes  |
|
|
|
 |
|
|
|
|