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
Great work Simon I was going to suggest that you do this, believe it or not One question before I install it, which I think I know the answer to but I want to check first, does it take the colour from whatever your standard notice background is, ie default, or do you adjust it to your own preference?
Great work Simon I was going to suggest that you do this, believe it or not One question before I install it, which I think I know the answer to but I want to check first, does it take the colour from whatever your standard notice background is, ie default, or do you adjust it to your own preference?
If you follow the instructions given and do the CSS part you can choose to have the floating box whatever colour you desire, you can match it to your background, notices.....etc its just a matter of changing the colour in the css.