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

Recent

Welcome to TinyPortal. Please login or sign up.

May 23, 2024, 06:05:42 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,197
  • Total Topics: 21,221
  • Online today: 67
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 47
  • Total: 47

Stats Block Modified

Started by Jokey, December 19, 2008, 11:59:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jokey

I have a code for the .098 TP Stats Block, and was wondering if anyone knew how to code it for TP 1.0.5??

In the default theme

languages/TPortal.english.php

Find:

$txt['tp-users'] = 'Users';


Add this after:

$txt['tp-hidden'] = 'Hidden';
$txt['tp-buddies'] = 'Buddies';
$txt['tp-spiders'] = 'Spiders';


default/TPortalBlocks.template.php

Find:

echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
   echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />



Replace with:


           echo '<br />'.$bullet.$txt['tp-hidden'].': '.$online['hidden'];
   echo '<br />'.$bullet.$txt['tp-buddies'].': '.$online['buddies'];
   echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
         echo '<br />'.$bullet.$txt['tp-spiders'].': '.$online['num_spiders'];
   echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />



Lord Anubis

Hey Smurfy have you seen my modification of this?

http://www.tinyportal.net/index.php/topic,22854.0.html

Also, can you get a screenshot of yours so I can peek at?

Jokey

#2
Quote from: Lord Anubis on December 20, 2008, 12:39:38 AM
Hey Smurfy have you seen my modification of this?

http://www.tinyportal.net/index.php/topic,22854.0.html

Also, can you get a screenshot of yours so I can peek at?

They look like nice blocks Anubis, but this code modifies the Stats Block that comes with TP, only thing is the new TP doesn't have bullet calls, and uses < li > calls?  I tried to reode it to match but I kept screwing up something.

this is what the old tp block looked like when modified -


I want the current version of TP to be able to modified the same way, right now the normal view is like this -


I would like it to use the bullets and images, but just can't get the coding right, and to list the different user categories

This is the current code in the TPBlocks.template.php


// add online users

echo '

<h5><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>

<ul>

<li>';



$online = ssi_whosOnline('array');

echo $txt['tp-users'].': '.$online['num_users']. '

</li>

<li>'.$txt['tp-guests'].': '.$online['guests'].'</li>

<li>'.$txt['tp-total'].': '.$online['total_users'].'</li>

<li style="width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';



foreach($online['users'] as $user)

{

echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];

echo '<br />';

}

echo '

</li>

</ul>';

}

echo '

</div>';

}



:'(

Lord Anubis

Why not use my modified block...the first one is exactly what you want...and if you use Earcade or Chat you can use the others....

Jokey

Quote from: Lord Anubis on December 20, 2008, 05:25:10 PM
Why not use my modified block...the first one is exactly what you want...and if you use Earcade or Chat you can use the others....

Your code to FIND is not in the new TP php template, that's why I am looking for someone to write it to match the NEW TP.

Jokey

#5
Well I finally figured out how to do it!!

In the default theme

languages/TPortal.english.php

Find:

$txt['tp-users'] = 'Users';


Add this after:

$txt['tp-hidden'] = 'Hidden';
$txt['tp-buddies'] = 'Buddies';
$txt['tp-spiders'] = 'Spiders';


default/TPortalBlocks.template.php

Find:

<li>'.$txt['tp-guests'].': '.$online['guests'].'</li>



Replace with:


<li>'.$txt['tp-hidden'].': '.$online['hidden'].'</li>
<li>'.$txt['tp-buddies'].': '.$online['buddies'].'</li>
<li>'.$txt['tp-guests'].': '.$online['guests'].'</li>
<li>'.$txt['tp-spiders'].': '.$online['num_spiders'].'</li>
<li>'.$txt['tp-total'].': '.$online['total_users'].'</li>





;D