Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jul 2007
Posts: 103
member
member
Joined: Jul 2007
Posts: 103
I've spent a couple of minutes in bringing the contentislands back to ubb-threads. The script is very basic, but you can adapt it as you like. I used the External Island feature to make this work. First create a new Post Island. In my example I used post island 12 for this.
Then create the following PHP and upload this to anywhere on your board:
Code
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";

$txt ="<table width=\"100%\">";
$txt = $txt.get_include_contents("/var/www/forums/test/languages/dutch 7.2/portal_islands.php");
$txt = $txt.get_include_contents("/var/www/forums/test/languages/dutch 7.2/generic.php");
$txt = $txt.get_include_contents("/var/www/forums/test/cache/post_island_12.php");
$txt = $txt."</table>";

$txt = str_replace("/ubbthreads.php?","http://forumtst.merudi.net/ubbthreads.php?",$txt);
$txt = str_replace("\"","\\\"",$txt);
$txt = str_replace("\r","",$txt);
$txt = str_replace("\n","",$txt);

echo "document.write(\"";
echo "$txt";
echo "\")";



function get_include_contents($filename) {
    if (is_file($filename)) {
        ob_start();
        include $filename;
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
    return false;
}

?> 
Don't forget to change it to your dir's ofcourse wink.
Now the following is only needed in the page this island needs to be shown:
Code
<script src="http://forumtst.merudi.net/cis_nl.php"
language="Javascript1.3" type="text/javascript"></script>
Ofcourse set the correct URL to your uploading file. And your done.
If you want any formatting, it cannot hurt to include some stylesheets in your php, but feel free as you go along. This is only a little example wink.

Have fun.

Last edited by nims2; 07/08/2007 2:21 PM.
Joined: Jul 2007
Posts: 103
member
member
Joined: Jul 2007
Posts: 103
p.s. Here's the php code, if you want to include your styletemplates and let them a little more formatted. Just copy them from your styled.css file and paste them in the php. I used mine, but ofcourse you can use yours wink
Code
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";


$style = "<style type=\"text/css\">
.cisland {
	font-weight: bold;
}

.tdheader {
	font-size: 10pt;
	font-weight: bold;
	color: #fefbff;
	background: #666699;
	padding: 2px;
	border: 0px solid #666699;
	background-image: url(http://forumtst.merudi.net/images/merudi/cell3.gif);
	background-repeat: repeat-x;
	}

.alt-1 {
background: #fffefe;
color: #000002;	
padding: 2px;
border: 0px solid #666699;
background-image: url(http://forumtst.merudi.net/images/merudi/cell.gif);
background-repeat: repeat-x;


}
.alt-1 a:link {
font-weight: bold;
}
.alt-1 a:visited {
font-weight: bold;
}
.alt-1 a:active {
font-weight: bold;
}
.alt-1 a:hover {
font-weight: bold;
}



  </style>
";

$txt = $style;

$txt = $txt."<table class=\"cisland\" width=\"100%\">";
$txt = $txt.get_include_contents("/var/www/forums/test/languages/dutch 7.2/portal_islands.php");
$txt = $txt.get_include_contents("/var/www/forums/test/languages/dutch 7.2/generic.php");
$txt = $txt.get_include_contents("/var/www/forums/test/cache/post_island_12.php");
$txt = $txt."</table>";

$txt = str_replace("/ubbthreads.php?","http://forumtst.merudi.net/ubbthreads.php?",$txt);
$txt = str_replace("\"","\\\"",$txt);
$txt = str_replace("\r","",$txt);
$txt = str_replace("\n","",$txt);



echo "document.write(\"";
echo "$txt";
echo "\")";



function get_include_contents($filename) {
    if (is_file($filename)) {
        ob_start();
        include $filename;
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
    return false;
}

?> 

Last edited by nims2; 07/08/2007 2:22 PM.

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Cook Book for relocating a Live Forum to a new host
by InlinersAdmin - 01/17/2025 9:41 PM
Inundated!: Who's Online - Guests
by Z65Paul - 01/15/2025 11:39 PM
online table full
by ehill - 01/13/2025 9:23 AM
Upgraded to ver8 - now can't login
by phoenix011235 - 10/24/2024 7:50 AM
Another error
by Baldeagle - 10/07/2024 8:08 PM
Who's Online Now
1 members (mavorg), 174 guests, and 149 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)