We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
[CODE] Move 'User(s) browsing this...' to top; By Stefan
Topic Started: Jan 25 2010, 10:59 AM (101 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Stefan
[CODE
 
Move 'User(s) browsing this...' to top]
Quote:
 
<script type='text/javascript'>
<!--
// move 'User(s) browsing this ...' to top
// code by ticlo/Stefan

// following line determines whether the active users must move to the top in a topic view
// set it to
// moveAtTopicView = true
// to move it
// moveAtTopicView = false
// to keep it where it is
moveAtTopicView = true

// following line determines whether the active users must move to the top in a forum view
// set it to
// moveAtForumView = true
// to move it
// moveAtForumView = false
// to keep it where it is
moveAtForumView = true

if ((moveAtForumView && document.location.href.match(/showforum\=/)) ||
(moveAtTopicView && document.location.href.match(/showtopic\=/))) {
var us = null
var ms = null
e = document.getElementsByTagName('DIV')
for (n = 0; n < e.length; n++) {
if (e[n].className == 'tableborder') {
e2 = e[n].getElementsByTagName('DIV')
for (i = 0; i < e2.length; i++) {
if ((e2.className == 'activeuserstrip' && e2.innerHTML.match(/User\(s\) are reading this topic/)) ||
(e2.className == 'darkrow2' && e2.innerHTML.match(/User\(s\) are browsing this forum/))) {
if (!us) {
us = e2.cloneNode(true)
e2.style.display = 'none'
}} else if (e2.className == 'row2' && e2.innerHTML.match(/Members:/)) {
if (!ms) {
ms = e2.cloneNode(true)
e2.style.display = 'none'
}}}
if (us || ms) {
tbs = e[n].getElementsByTagName('TABLE')
if (us) tbs[0].parentNode.insertBefore(us, tbs[0])
if (ms) tbs[0].parentNode.insertBefore(ms, tbs[0])
us = null
ms = null
}}}}

// -->
</script>

This code moves the bars with User(s) browsing this topic/forum to the top.
Put it in Admin CP->Board Wrappers->Header & Body, after <% BOARD %>

The green line determines whether the active users must move to the top in a topic view. Set it to
Code:
 
moveAtTopicView = true

to move it to the top, or to
Code:
 
moveAtTopicView = false

to keep it where it is

The red line determines whether the active users must move to the top in a forum view. Set it to
Code:
 
moveAtForumView = true

to move it to the top, or to
Code:
 
moveAtForumView = false

to keep it where it is
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Codes & Modifications · Next Topic »
Add Reply