UBB.Dev
Posted By: Gizmo [7.x] Headerless CustomIslands - 05/24/2010 11:06 PM
Name: UBB.Headerless CustomIslands

Author: Gizmo (James of VNC Web Design)

Requirements: UBB.Threads 7.x (not compatible with UBB.Threads 6.x or below)

Current Version: v0.1

About:
If you've visited any of my client sites you'll see Custom Islands holding data placed around the forums without requiring editing of data outside of the Custom Islands (at least after modifying where you want to have the Custom Islands displayed).

Demo: I don't currently have a demo available.

Install Instructions:
You'll want to first go to "Portal Layout" area of the Control Panel and select the "External Use" link for the island you wish to use; really here all we need is 3 lines that show the "path" to files (here it's the /var/www/mysite.tld lines) for the Custom Island that we're going to be using (all code is displayed below), for this example we're going to be using the Custom Island #8.

PHP Code (For header/footer includes)
Code

<div class="vnc_ads">
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo("<table width=\"100%\">");
include("/var/www/mysite.tld/forum/languages/english/portal_islands.php");
include("/var/www/mysite.tld/forum/languages/english/generic.php");
include("/var/www/mysite.tld/forum/cache/portal_box_8.php");
echo("</table>");
?>
</div>

Smarty Code (for use inside of template files)
Code

<div class="vnc_ads" align="center">
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo("<table>");
include("/var/www/mysite.tld/forum/languages/english/portal_islands.php");
include("/var/www/mysite.tld/forum/languages/english/generic.php");
include("/var/www/mysite.tld/forum/cache/portal_box_8.php");
echo("</table>");
{/php}
</div>

New Style Code (Insert at "Extra Properties")
Code

.vnc_ads .tdheader {
display: none;
}
.vnc_ads .alt-1 {
background-color: #CCCCCC;
}

In the above "Code" sections (PHP or Smarty) you'll see:
Code
$style_side="";$tbopen="";$tbclose="";

These are:
$style_side=""; - Additional Style Data, Left Side of current style definitions.
$tbopen=""; - Just after table open.
$tbclose=""; - Just before table close.

You'll likely never need to change these; they are a part of the default syntax for the external use island in the UBB.

In the Style Code you'll see that we've added "vnc_ads", this is so we can change tdheader and alt-1 without having to modify any base code (it could just as easily be "my_ads" or anything other than what's being used by the base code of the UBB). The modified tdheader just hides the headerbar. The modified alt-1 just sets a background color.

What you'll do now is either edit a template and place the Smarty Code in the file at the approximate location you'd want it (say showflat.tpl above the quickreply box) and then save the template then clear your cache and your newly placed custom island is ready to go.

In our code above we've assumed you want the island centered where you place it, otherwise just remove the ' align="center"' from the "div" tag in the code. You can also add ' width="100%"' to the "table" tag above if you want it to display the full width of the area you're placing it in.

Pricing: Free
© UBB.Developers