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 3: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 3:22 PM.

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Nightcrawler), 1,165 guests, and 234 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)