Version: 1.00, by Simon Lloyd
Developer Last Online: May 2023
Category: Miscellaneous Hacks -
Version: 3.8.x
Rating:
Released: 11-22-2009
Last Update: Never
Installs: 18
Supported Template Edits
Re-useable Code Translations
This "Mod" will allow you to have a floating notice box in your Forumhome, however it can easily be adapted to show wherever you like!
The original javascript for the float and the box are from here http://www.jtricks.com/javascript/na.../floating.html all the information here does is help you understand where to put the code and how to use it etc
Go to AdminCp>Style Manager>YOUR STYLE>Header and underneath
PHP Code:
$ad_headerEnd
add this (currently it is set to only show to unregistered users)
PHP Code:
<!-- float div -->
<if condition="THIS_SCRIPT == 'index' AND is_member_of($bbuserinfo,1)"><script type="text/javascript"><!--
/* Script by: www.jtricks.com
* Version: 20071017
* Latest version:
* www.jtricks.com/javascript/navigation/floating.html
*/
var floatingMenuId = 'floatdiv';
var floatingMenu =
{
targetX: -290,
targetY: 90,
floatingMenu.doFloat = function()
{
// Check if reference to menu was lost due
// to ajax manipuations
if (!floatingMenu.menu)
{
menu = document.getElementById
? document.getElementById(floatingMenuId)
: document.all
? document.all[floatingMenuId]
: document.layers[floatingMenuId];
initSecondary();
}
var stepX, stepY;
floatingMenu.computeShifts();
var cornerX = floatingMenu.calculateCornerX();
var stepX = (cornerX - floatingMenu.nextX) * .07;
if (Math.abs(stepX) < .5)
{
stepX = cornerX - floatingMenu.nextX;
}
var cornerY = floatingMenu.calculateCornerY();
var stepY = (cornerY - floatingMenu.nextY) * .07;
if (Math.abs(stepY) < .5)
{
stepY = cornerY - floatingMenu.nextY;
}
floatingMenu.show = function()
{
floatingMenu.menu.style.display='block';
return false;
}
//--></script>
</if>
<!-- float div end -->
Now go to Headinclude and right at the very bottom add
PHP Code:
<if condition="THIS_SCRIPT == 'index' AND is_member_of($bbuserinfo,1)"><<div id="floatdiv" style="
position:absolute;
width:200px;height:50px;left:0px;top:0px;
padding:16px;background:#FFFFFF;
border:2px double #2266AA">
This is a floating javascript menu.
</div> </if>
the reason for capturing the SCRIPT and the USERGROUP in both places is to prevent a page script error (denoted by a little yellow triangle at the bottom left of your browser)
I used a little css to jazz mine up, again go to your style>Main CSS and in the additional CSS Definitions add this
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3965
vBulletin Message
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.