Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
helidoc
Hangin' Around



Joined: Jul 09, 2006
Posts: 49

PostPosted: Thu Feb 11, 2010 7:56 am Reply with quote

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;
?>
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Feb 11, 2010 10:43 am Reply with quote

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.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
helidoc







PostPosted: Fri Feb 12, 2010 5:55 pm Reply with quote

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 Very Happy

Image
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Sat Feb 13, 2010 7:32 am Reply with quote

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.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
helidoc







PostPosted: Sat Feb 13, 2010 9:06 am Reply with quote

That worked perfect thanks, I know my users will appreciate the missing iframes Very Happy
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

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 ©