forum integration

Use GitHub to post feature requests for phpwcms.
Locked
valjah
Posts: 10
Joined: Wed 3. Mar 2004, 01:38

forum integration

Post by valjah »

i know this has been discussed before here, but i got lost between all the posts... so here are my questions:
- has anybody ever (successfully) tried to integrate a forum or message board into our favorite cms?
- is anybody currently working on this mission and how are you getting along?

i started working on this problem with "my little forum", which i find nice and clean and small - but you have to make serious changes in the phpwcms engine to get it to work...

peace,

valjah
Pappnase

Post by Pappnase »

hello

at the moment!

create an forum layout! where you have no right table.
create an forum template! place in the main block an iframe.
create an sitstructure an choose the forum template.

and also you can look to olivers thread

http://www.phpwcms.de/forum/viewtopic.php?t=1019
valjah
Posts: 10
Joined: Wed 3. Mar 2004, 01:38

Post by valjah »

that's a good intermediate solution that i hadn't thought of...
there's only that ugly scrollbar if the forum gets too big, since the iframe doesn't resize itself (that would be nice).
but other than that, i think it works fine for my needs.
brans

Post by brans »

hmm I think you're coding a forum that is database driven and you could just make a php-script that returns an iframe depending on how big the forum is...your just have to find the right rule so that the iframe never gets to small ;) but that shouldn't be a problem! include this with the {PHP:} tag and you've got this ugly scrollbar in the middle of the design gone ;)
valjah
Posts: 10
Joined: Wed 3. Mar 2004, 01:38

iframe resize

Post by valjah »

i found a solution using javascript. i know it's not the purest html but i tested it on IE6 and mozilla 1.6 and it works just fine! it's just a few lines of javascript and it's resizing the iframe every time i click a link in the forum (iframe). perfect!

the javascript looks like this (in the header):

Code: Select all

<script language="JavaScript">
<!--
function calcHeight()
{
	var the_height=document.getElementById('the_iframe').contentWindow.document.body.scrollHeight; //find the height of the internal page
	document.getElementById('the_iframe').style.height=the_height; //change the height of the iframe
}
//-->
</script>

the iframe in the main block looks like this:

Code: Select all

<iframe src="forum/forum.php" id="the_iframe" onLoad="calcHeight();" width="100%" height="1" name="the_iframe" scrolling="no" frameborder="0">if you see this text your browser doesn't support iframes...</iframe>
this is where i found the code: http://guymal.com/mycode/iframe_size.shtml


have fun, valjah
Jenpet
Posts: 74
Joined: Fri 6. Feb 2004, 15:43

Post by Jenpet »

have you got an example on your site perhaps ? The problem is I think, that it's nice to have no scrollbars, but a design that is totally stretched from 600px to 1200px for the forum is not that nice.....
valjah
Posts: 10
Joined: Wed 3. Mar 2004, 01:38

Post by valjah »

well, you should be able to control the forum so it doesn't display more than a certain number of lines, but i haven't figured that out yet. i'm just starting with phpwcms and now i have to get into the code of the forum, too...
sorry, at the moment i don't have an example of this online because i'm still constructing the site on my local computer (apache/win32) and i'm reluctant to open my firewall for outside access...
i will let you know when my site is up and running on an external server.
only this much: i think the iframe solution looks very good (but that's of course highly subjective, as probably everything concerning design).

peace, valjah
snobba
Posts: 166
Joined: Sat 6. Mar 2004, 12:41
Location: Sweden
Contact:

Post by snobba »

Hi Valjah,

I think your solution to this problem looks great! But when I put it in a template and try it I'll get a javascript errror and I will only see a 1 pixel height iframe..

I have put this in the header:
<script language="JavaScript">
<!--
function calcHeight()
{
var the_height=document.getElementById('the_iframe').contentWindow.document.body.scrollHeight; //find the height of the internal page
document.getElementById('the_iframe').style.height=the_height; //change the height of the iframe
}
//-->
</script>
And this in the main:
<iframe src="http://www.phpwcms.de/forum/" id="the_iframe" onLoad="calcHeight();" width="100%" height="1" name="the_iframe" scrolling="no" frameborder="0">if you see this text your browser doesn't support iframes...</iframe>
Really strange because when I put the iframe on with out the javascript it works great..

Thanks,

Martin
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

Try "html head:" instead of "header:" for the javascript
snobba
Posts: 166
Joined: Sat 6. Mar 2004, 12:41
Location: Sweden
Contact:

Noop

Post by snobba »

Thanks Dexxus, but it still won't work for me. Do I have to have something in the js onload do you think? Or is there something with the frontend.js? Here is what I get in my head(source code)..

Code: Select all

<head>
<title>phpwcms :: web based content management system</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript"> 
<!-- 
function calcHeight() 
{ 
   var the_height=document.getElementById('the_iframe').contentWindow.document.body.scrollHeight; //find the height of the internal page 
   document.getElementById('the_iframe').style.height=the_height; //change the height of the iframe 
} 
//--> 
</script>
<meta name="description" content="dfa">
<script src="./phpwcms_template/inc_js/frontend.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="./phpwcms_template/inc_css/frontend.css">
</head>
I'll send you the Swedish translation when I can get things to work..

Thanks - Martin
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

:(

i know why it doesn't work! when I try to read the ScrollHeight of an external Website (other Domein!) there is a securityproblem! java script does not allow read external sites. thats how i understand this...

i try to integrate external content (not on my server) and it sucks!!!!!!!!
Locked