TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 365
  • Total: 365

Users Online Today Mod

Started by insanemustang, April 30, 2008, 04:24:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

Oh, you already posted a response and may have missed my link.

http://www.tinyportal.net/index.php?topic=22723.msg184320#msg184320

This is a scrolling block that has recent posts in it. You should be able to alter it for members.

IchBin

#11
Quote from: Ianedres on May 06, 2008, 08:35:08 PM
Quote from: IchBin™ on May 06, 2008, 08:29:09 PM
Thats why you make a backup. :) Then its as easy as just replacing the file with the original if you screw it up.

The other thing I find so helpful is have the direct link to your block management in the admin panel bookmarked- so you can disable a buggy block if need be.  8)

There's a few things you can do in that case. Often, you can hit the back button in your browser if you keep that window open. :) And of course, you can add ;noblocks to your URL to disable all blocks as admin.
True dat!  :coolsmiley:

insanemustang

QuoteYou should be able to alter it for members.

That was funny lol

insanemustang

Anyone got the "bubba way" for me to do this?

JPDeni

I'm sorry. I misunderstood your level of expertise. :)

Can you post the code you're using now? The original post that you linked to added the users online today in the statsbox, which is different than what your graphic shows.

insanemustang

#15
I think this it - thank you for helping me.

   // add online users
            echo '<hr /><img src="'.$settings['images_url'].'/icons/online.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br />';

            $online = ssi_whosOnline('array');
   echo $bullet.$txt['tp-users'].': '.$online['num_users'];
   echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
   echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
<div style="width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';

      foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
   }
echo '</div>';
         }
echo '</div>';

JPDeni

Well I won't be able to give you the full code for the block without the current full code from the block. :) But maybe I can give you what you need to work it out yourself.

At the beginning of your block, before anything else, add


echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>

<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">';


At the end of your code -- the very bottom of the block -- add


echo '
</div>
</div>
   ';


I know this works for scrolling recent topics. It should work for your users online today.

insanemustang

I'm sorry.  The code I gave you was from the TPortalBlocks.template.php

My code for the block is:
echo '<img src="'.$settings['actual_images_url'].'/icons/online.gif'.'"  /> <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a>';
ssi_whosOnline_today();


I'm sorry, I should have been more specific.  How does this change what you posted?

JPDeni

It probably doesn't. :) It's just that I was going to post the whole thing to make it easier for those who come along in the future. Also, it makes it easier for me to test it out.


echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>

<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">';

echo '<img src="'.$settings['actual_images_url'].'/icons/online.gif'.'"  /> <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a>';
ssi_whosOnline_today();

echo '
</div>
</div>
   ';

insanemustang

Ok, I tried copying that and putting it in place of what I had on the tpportalblocks.template.php and I got a ton of errors

Can you help me out with where that goes, what it replaces, etc...

Thank you for your help

This website is proudly hosted on Crocweb Cloud Website Hosting.