TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 110
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 63
  • Total: 63

TP showing up along with the SMF-header in custom subfolder header?

Started by Innocenzia, July 27, 2008, 11:07:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Innocenzia

Sure. Just tell me when you want me to take it away and if you need any other file copied as well.  :) I thought it might not be allowed to post such long code-files, thereby i offered to take it away. :)

bloc

It seems it calls SSI.php already, so there is no need to require the TPortal file then. And yes, you can just remove it if you like :)

How about only changing this part:

$ssi_layers = array('main');

to
$ssi_layers = array('main','tp');

..does that change anything?


Innocenzia

Yes, it changes quite a lot. Now only the SMF-header is visible, including the TP-errors mentioned in the first post, then this text:

"Unable to load the 'tp_above' template."

And that's it. I can't see the actual content of the site or anything.Might count as progress though?

Ken.

Maybe I'm not understanding correctly what your goal is here, but its sounds to me like you are simply trying to 'pull' your eFiction page into your SMF/TP forum?
If that's the desired result have you considered an iFrame? Many people have used that approach when pulling the Coppermine Gallery into their forum... works good and only requires a TP article to do the job.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Innocenzia

Thanks for the suggestion, actually it's a bit of both, and since iframes need specified height (correct me if i'm wrong), it would of course be a problem with iframes since some pages might be very long and some short.

It's also bridged, so the user is logged in at efiction as well and can post stories and so on. :)

But yes, i guess I'm trying to pull/wrap efiction with SMF/TP. :)
So that it looks like efiction is actually a part of the site and not a whole different site. :) 

Cheers, Inno.

Ken.

Here's two of mine:
Wordpress
Coppermine

Both use 'auto-resizing' iframe code and works reasonable well... in some setups the resizing part is not perfect but overall its an easy solution. AFAIK no one has come up with an easier way to pull in these two programs into SMF/TP and from the sound of it you may be faced with the same issue with eFiction.

But... my opinion could very easily be wrong so don't let me stop the process because if you can find a way to do eFiction maybe it will work for cpg and WP.  :)
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Innocenzia

Could you please tell me more about the auto-resizing code, i've not heard about such a code before. :)

Yes, i hope that it will actually work this way. :D So i'm keeping my fingers crossed for a solution. ^^ Would be great for Coppermine, WP and Gallery's and such as well. ^^ even thought i'm not using any of those at the moment.

Ken.

This is the code that is currently in use on my site, it has been posted here on TP for a long time now so if you do a search for iframes or coppermine you should be able to find lots of info on how it works.

At the bottom of the code look for "<iframe id=" and adjust the url to your needs.
<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(navigator.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)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids] : document.getElementById(iframeids)
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+FFextraHeight;
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>

<iframe id="myframe" src="http://www.yoursitehere.com/coppermine/" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Innocenzia

Thanks, i'll try that for my other simpler javascript-quizzes. :)

However, if possible i would still like to be able to wrap the eFiction-part with SMF/TP since a few of my members are consantly using: open link in new window, and they would then get out of the iframe, and possibly close the site it self, just using the eFiction.  And then lose all links and such.

This website is proudly hosted on Crocweb Cloud Website Hosting.