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,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 393
  • Total: 393

Embedding my blog

Started by KirkhamsEbooks, June 02, 2011, 05:05:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KirkhamsEbooks

Aloha,

The version is the latest 2.0 5rc I'm wondering if there's a way for a guy pretty new to php to embed my blog into the front page of my forum using tiny portal? I'd even be happy with an iframe
http://kirkhamsebooks.com/forum/

Rick

ZarPrime

Rick,

Welcome to the TP Support Site.

This would be pretty easy to do, especially if you are using an iframe.  Just look in the TP FrontPage Settings and set it up to display Articles only on the FrontPage.  Then setup a featured article (and no other articles) to show on the FP.

You could then use the code below in a php article to display the blog.  You'd have to change the source url of course and maybe the width and height for what looks good.

echo '<center><iframe frameborder=0 scrolling=no width=1000 height=750 src="http://www.YourBlog.com/your blog/" align=top></iframe></center>';


ZarPrime

Ken.

Hi Rick... Welcome to TinyPortal.

The method that ZarPrime mentions works very well and you can see a working example on my site...
Our FamilyForum Blogs

Mine uses a somewhat more complex code snippet that has a few setup issues, but I'll post the code if you wish.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

sysengr

Ken,

I would very much like to see how you have your set up. 

Many thanks!

Ken.

Quote from: sysengr on June 19, 2011, 04:48:41 PM
Ken,

I would very much like to see how you have your set up. 

Many thanks!

Hello sysengr, welcome to TinyPortal.
Are you saying that you want to see the code?

Here is is:
1/ Insert this code in an HTML article.
2/ Then, at the bottom of the code you'll see a place to plug in your links.
3/ Add links to your theme as desired... (my forum pages have a Wordpress link at the bottom.)
Please Note: This code has been around for a long time and while it still works OK on my site it may not do so on yours. You may need to adjust height and width settings to get it working
correctly.
Unfortunately you may find that support for this piece of code may be very minimal because the TinyPortal Code Specialist who originally put this code together for me is no longer with us.


<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[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+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.YOUR_WORDPRESS_ADDRESS_HERE" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="overflow: visible; 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.

This website is proudly hosted on Crocweb Cloud Website Hosting.