Simple way to make WowRoster work as a module in PhP-Nuke

phpNuke integration forum

Simple way to make WowRoster work as a module in PhP-Nuke

Postby cennis » Thu Feb 15, 2007 5:29 am

Ghostmaster, that did it. Thx a ton for the advice. I can't believe what a simple solution this has turned out to be after many months of trial and error at integrating this roster in to PhPNuke. Cheers to a community that shares it's ideas!
User avatar
cennis
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Mon Jul 17, 2006 11:51 pm

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby nubar » Sat Feb 17, 2007 11:17 am

Thanks mate
Works great! :thumleft:
nubar
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Jan 27, 2007 2:12 am

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby JBabey » Tue Feb 20, 2007 11:32 pm

I think it would be fantastic to get the height to be dynamic, but my knowledge of I-Frames is very limited. If someone has a solution im willing to be a test dummy and have my roster down while we try some things.

To restrict access from loading the file directly, you could try renaming the index.php to something else and put a 403 forbidden as your index.php.... I have not tried this, but then, none of my guildies know its loading fully from an external location. It may ruin the dynamic links though from the banner... hmmmmm.....
Last edited by JBabey on Tue Feb 20, 2007 11:35 pm, edited 1 time in total.
JBabey
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Thu Feb 08, 2007 3:15 am

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby spydermatrix » Fri Feb 23, 2007 10:38 pm

Code: Select all
Warning: get_lang(modules/guild_roster/language/lang-english.php) [function.get-lang]: failed to open stream: No such file or directory in /home/reign/domains/reignofvengeance.org/public_html/mainfile.php on line 229

Warning: get_lang() [function.include]: Failed opening 'modules/guild_roster/language/lang-english.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/reign/domains/reignofvengeance.org/public_html/mainfile.php on line 229


this is what i am getting when i click on the link
spydermatrix
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Fri Feb 23, 2007 8:57 pm

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby natbur » Fri Apr 13, 2007 1:07 pm

I made a few changes to JBabey's code, most notibly, it now automatically resizes based on it's contents. I've only tested it in Firefox, so if someone wants to test it in IE, tha'd be great. Also, the URL isn't hardcoded anymore, it's relativly-linked. At the moment is set to assume yoursite.com/Roster/index.php. If your folder structure is different, that's what you'll need to change.
Code: Select all
<?php

/****************************************************************************/
/* ----> Module file used to load external URL's into an I-Frame            */
/*       Many thanks to forum users everywhere & specifically the           */
/*       wowroster team for inspiring me to figure this out!         <----  */
/****************************************************************************/

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);

/****************************************************************************/
/* ----> change the site URL information that you wish to load here         */

$index=0;
$go_to_address1="./Roster/index.php";
$go_to_address=rawurldecode($go_to_address1);

/* end url input <---- */


?>

<script language="JavaScript">
<!--
function calcHeight()
{
  //Smallest the frame should ever be
  var min_height=0;
  //Largest the frame should ever be, 0 for no max
  var max_height=0;

  //find the height of the internal page
  var the_height = document.getElementById('roster_iframe').contentWindow.document.body.scrollHeight;
  if(the_height< min_height)
  {
     the_height = min_height;
  }
  else if(max_height != 0)
  {
     if(the_height > max_height)
     {
        the_height = max_height;
     }
  }
  //Pad it a bit so firefox doesn't show scrollbars
  the_height=the_height + 50;
  document.getElementById('roster_iframe').height=the_height;
}
//-->
</script>

<?php
include("header.php");
define('INDEX_FILE'true);
OpenTable();


/****************************************************************************/
/* ----> iframe code to load above URL                                      */

echo "<iframe id=\"roster_iframe\" SRC=\"".$go_to_address."\" width=\"100%\" onLoad=\"calcHeight()\" 
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>\n"
;

/* end iframe load <---- */

CloseTable();
include(
"footer.php");

?>
Last edited by natbur on Fri Apr 13, 2007 2:07 pm, edited 2 times in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Simple way to make WowRoster work as a module in PhP-Nuke

Postby natbur » Fri Apr 13, 2007 2:07 pm

Also, if you want to block direct access, this method will work for you.
edit
Code: Select all
echo "<iframe id=\"roster_iframe\" SRC=\"".$go_to_address."\" width=\"100%\" onLoad=\"calcHeight()\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>\n";

to read
Code: Select all
echo "<iframe id=\"roster_iframe\" SRC=\"".$go_to_address."?id=1\" width=\"100%\" onLoad=\"calcHeight()\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>\n";

then you have to make one change to the Roster/index.php file. At the top, change
Code: Select all
<?php

/******************************
 * WoWRoster.net  Roster
 * Copyright 2002-2007

to
Code: Select all
<?php

$ref=$_GET['id'];
if($ref != 1)
{
   die ("You can't access this file directly...");
}


/******************************
 * WoWRoster.net  Roster
 * Copyright 2002-2007

If it's inappropriate to add code before the copyright, I apologize, it'll work just as well right after.
Of course, someone could just go to yoursite.com/Roster/index.php?id=1 and it'd work fine, but this will keep most people out.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Simple way to make WowRoster work as a module in PhP-Nuke

Postby zanix » Fri Apr 13, 2007 2:17 pm

Your ok, as long as it isn't edited

You can also check the referrer url to make sure only clicks from your site are authorized
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby natbur » Fri Apr 13, 2007 9:44 pm

I tried checking the referer URL, but since it's an coming from an ifame call, the HTTP_REFERER value is empty. Not sure if that's a html thing, or just firefox, but this method, though far from foolproof, seemed to be the most reliable.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Simple way to make WowRoster work as a module in PhP-Nuke

Postby zanix » Sat Apr 14, 2007 12:48 am

Oh well, it was worth asking
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby natbur » Sat Apr 14, 2007 12:57 am

I'm always open to suggestions, if anyone can figure out how to get the referer URL to work, I'd love to do it that way because it'd be harder to get around.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Simple way to make WowRoster work as a module in PhP-Nuke

Postby illidain » Fri Jul 20, 2007 9:24 pm

Hi, Is there anyway to make the module use the theme.css when the scrollbars are active? only they show as default windows scrollbars and I would like them to use same colors as the theme.

Thanks in advance

http://lofh.co.uk
illidain
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Wed Mar 28, 2007 6:33 pm

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby yahooadam » Sun Jul 29, 2007 3:41 am

Ghostmaster wrote:Is is possible to make the height dynamic, so you don't have to change the code all the time when new members are joined the guild ?

+1 for this suggestion

If you can find out how to do this, it would be awesome ^^

Yahooadam

Edit:
Doh didnt see second page
Thx :)
Last edited by yahooadam on Sun Jul 29, 2007 3:43 am, edited 1 time in total.
yahooadam
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Sun Jul 29, 2007 3:40 am

Simple way to make WowRoster work as a module in PhP-Nuke

Postby t3hp1t » Tue Jul 31, 2007 7:53 am

I cant even get it to work :(

http://team-fiya.com/da/modules.php?name=Roster

I just get a blank page?
t3hp1t
WR.net Apprentice
WR.net Apprentice
 
Posts: 12
Joined: Sat Jul 14, 2007 3:32 pm

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby yahooadam » Tue Jul 31, 2007 7:46 pm

t3hp1t wrote:I cant even get it to work :(

http://team-fiya.com/da/modules.php?name=Roster

I just get a blank page?

make sure the paths set correctly

are you using the first way to do it, or the second way (with javascript)
yahooadam
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Sun Jul 29, 2007 3:40 am

Re: Simple way to make WowRoster work as a module in PhP-Nuk

Postby t3hp1t » Wed Aug 01, 2007 3:11 am

first way
t3hp1t
WR.net Apprentice
WR.net Apprentice
 
Posts: 12
Joined: Sat Jul 14, 2007 3:32 pm

PreviousNext

Return to phpNuke

Who is online

Users browsing this forum: No registered users and 0 guests

cron