PDA

View Full Version : loadanything: Module - NEW


shawng
10-02-06, 08:55 AM
I been killing myself with trying to mode the dotproject forums. It seamed that fix after fix, and I still could not get it to a point that I liked.

So I decided to try something new, I started by looking at some other module code, soon relizing that I could load in entire websites into the dot project module.

So i created this mode, And so far I used it to add web mail management using horde, and phpbb2 forums.

Mode only works on DHTML supported browser. I tested it on the newest firefox and IE browser with no problems.

Well here is the code.
http://www.nemesisstudios.com/public/nse-loadanything.rar

caseydk
12-02-06, 06:46 AM
Any chance you could setup a demo site others could play with?

shawng
19-02-06, 02:59 AM
sorry i dont realy have anyware to setup a demo site.

All the code is viewable, best I can do at the moment.

MacOfTheEast
19-02-06, 03:19 AM
sorry i dont realy have anyware to setup a demo site.

All the code is viewable, best I can do at the moment.The link to the .rar file that you posted seems to be dead. Is there any way that you could set up a demo user on your existing site so we can play with the mod's functionality?

MOTE

shawng
20-02-06, 02:05 AM
yep here it is

I forgot i moved it

http://www.nemesisstudios.com/public/dot_project/nse-loadanything.rar

and if this dies for some odd reason..

try this

http://www.nemesisstudios.com/public/dot_project/

Logicology
20-02-06, 02:46 AM
The RAR still doesn't work. Is it corrupt? The other rar in your web directory worked, but not the Load Anything. If I right-click, save as. It tried to save an HTML file.


By the way -- Thanks for this mod! I've been looking for a way to integrate PhpBB in dotProject forever!!

MacOfTheEast
20-02-06, 04:20 AM
So I decided to try something new, I started by looking at some other module code, soon relizing that I could load in entire websites into the dot project module.I looked at your code and it appears to me that you can use the existing LINKS module to achieve the same result.

MOTE

shawng
21-02-06, 08:43 AM
yep, you can.

I learned how to write this from looking at the help mods and other mods.

Its pritty simple for the most part.

But you cant use links out of the box..

:cool:

The RAR still doesn't work. Is it corrupt? The other rar in your web directory worked, but not the Load Anything. If I right-click, save as. It tried to save an HTML file.


By the way -- Thanks for this mod! I've been looking for a way to integrate PhpBB in dotProject forever!!


I tried the rar and hade no issues..

try updating your unzipping application.

bwells
22-02-06, 02:35 AM
shawng, this worked flawless for me. Changed it so that I could get phpBB to be shown within my system. Thanks!!!!

Brent

Logicology
22-02-06, 05:26 AM
Worked for me too. THANK YOU!

I want to duplicate this on my system to load PhpBB and also my company's webmail system. I copied the folder to a new one and changed the variable in setup.php. But dotProject doesn't seem to like the fact that the function or class is the same name as the other(?)

I tried changing the names to another arbitrary one, but that didn't work. How can I modify each one so that I can use this mod a few different times for different links.

(I know I can use the default LINKS module, but I want these to be displayed in the main menu bar.)

shawng
22-02-06, 04:10 PM
I found when using it in more then one spot I ran into the same issue just recently with my mailing mode I made.

http://www.dotproject.net/vbulletin/showthread.php?t=4495

I had to change the Aclass to something else to get multiple version of the same base setup.php script to work.


I originally did use the links module to learn how a setup.php script should work, and then changed it abit to work as the setup file. I figured no big deal, just a generic setup file.

So if some of the basic configurations of the module may conflict with the link module.

But I found that by changing the class and a few tags this issue was resolved.

The main issue being the class name of the class.



$config['mod_setup_class'] = 'someclass'; // the name of the PHP setup class


then of course the directory structure

$config['mod_name'] = 'massmail'; // name the module
$config['mod_directory'] = 'massmail'; // tell dotProject where to
$config['mod_ui_name'] = 'Mass Mailer'; // the name that is shown
$config['mod_description'] = 'Emails All Users'; // some description of


also dont forget to change this here to the the new class name



if (@$a == 'setup') {
echo dPshowModuleConfig( $config );
}

// TODO: To be completed later as needed.
class someclass {

function configure() { return true; }

function remove() {

}

function upgrade($old_version) { return true; }

function install() {

}

}
?>



hope this helps

bwells
22-02-06, 11:01 PM
Logicology,
What I did to get phpBB to work, I placed the index.php, index.html, and setup.php file within a directory called phpbb under the modules directory. I then changed the setup.php and index.php to match my current setup. What I changed in the setup.php file is below.

$config['mod_name'] = 'phpBB';
$config['mod_version'] = '1.0';
$config['mod_directory'] = 'phpbb';
$config['mod_setup_class'] = 'aclass';
$config['mod_type'] = 'user';
$config['mod_ui_name'] = 'Forum';
$config['mod_ui_icon'] = 'communicate.gif';
$config['mod_description'] = 'phpBB Module Forum';

I also changed the index.php file to point to my phpbb installation.

This is all that is needed to get phpBB to work under DotProject and have a listing in the Menu. You can do this with any other outside website you want to use.

Brent

bwells
22-02-06, 11:19 PM
Shawn,
About the time I sent that, I totally forgot about what you said needed changed. Thanks!

Brent

shawng
23-02-06, 04:49 PM
One thing i noticed about phpbb2 is the fact that it dont auto scrool to the top of the window because of the dhtml frame.

I am not sure how to make this happen.. mybe if we are lucky firefox or ie will update the browser to do this for us. but doubtfull.

:-?

If any of you guys figure it out let me know, Its not big deal. But would be nice if it did.

I tried adding some java script to a few of the .php files for phpbb2 to fix this issue but had no luck :-?

I will prob toy with it again soon, but been bussy with other stuff at the moment.

bwells
14-03-06, 06:39 AM
Hey guys, I found a javascript that will autoscroll your page to the top. I found it at http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm.
Please this in the head portion of your index.php script for your module, not phpbb. Also, make sure that you change the "var iframeids=["myframe"]" section to match the iframeId you set in the body section.

Here is the code:
<script type="text/javascript">

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigat or.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextr aHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>

Let me know if this works for ya!

Brent

shawng
15-03-06, 10:23 AM
nice bwells I will have to try it out =)

shawng
15-03-06, 11:19 AM
ok i tried it and had no luck.. but here is the code




<HTML>
<HEAD>

<script type="text/javascript">

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigat or.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextr aHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>

</HEAD>

<body onLoad="javascript:scroll(0,0)">

<iframe id="myframe" src="..//phpBB2" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

</BODY>



</HTML>

bwells
15-03-06, 11:05 PM
Shawn,
That is weird. I took your code that you placed in the reply, changed the ..//phpBB2 to ..//phpbb and it still works for me. One thing I did notice is that is if you check this in Opera, it will appear to not work. Only IE and Firefox can utilize this script. Also, I utilize a WindowsXP machine as my server running apache2triad. I don't know if this makes a difference or not, but it might be the setting for your webserver also.

Brent

Jerome!
20-04-09, 04:36 PM
The link is broken, can somebody reupload the file?

Thanks