TinyPortal

Development => Block Codes => Topic started by: ontap on April 06, 2006, 12:21:19 PM

Title: Hidden Users & Buddies
Post by: ontap on April 06, 2006, 12:21:19 PM
being messing about with the Forum Stats block where it shows 'Users Online',
i wanted to add both hidden users and buddies...

The total dosent count hidden users or maybe its counted in 'users' itsself.. not sure
see the image below.

this is how to add Hidden users & buddies to the Stats Block.

allways backup!!  ;)

Open:
languages/TPortal.english.php

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

Add After:

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


Open:
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-total'].': '.$online['total_users'].'<hr />

Title: Re: Hidden Users & Buddies
Post by: G6Cad on April 06, 2006, 01:40:16 PM
Thank you OnTap :)
Fun future and it works like a charm :)
Title: Re: Hidden Users & Buddies
Post by: Mitchâ„¢ on April 12, 2006, 12:02:34 AM
Thanks so much for this!
I did what you said and it worked like a charm.

/me apologizes to G6 and says, "I did not realize you said the same thing."
Title: Re: Hidden Users & Buddies
Post by: rbh on April 12, 2006, 06:01:25 AM
if we have it set on our boards not to allow people to hide their online status will this still work, just leaving out the lines of code for hidden user?
Title: Re: Hidden Users & Buddies
Post by: resurgence on April 12, 2006, 07:07:50 AM
could you add spiders, too? and how?
Title: Re: Hidden Users & Buddies
Post by: G6Cad on April 12, 2006, 09:06:49 AM
That need a whole engine to show up.
You can find a mod for googlebot and spiders on the SMF forums in the modsection
Title: Re: Hidden Users & Buddies
Post by: resurgence on April 13, 2006, 05:03:10 AM
yup. i know. i have it. which is why i wanted to know if i could add spiders and stuff :) since mine doesn't show it at all.
Title: Re: Hidden Users & Buddies
Post by: ontap on April 13, 2006, 05:15:07 AM
Quote from: resurgence on April 12, 2006, 07:07:50 AM
could you add spiders, too? and how?

Easily  ;)... are you talking about the Googlebot & Spiders MOD? (http://mods.simplemachines.org/index.php?action=download;mod=143;id=13842)

this is how you would do it.

Open TPortal.english.php
Find:
$txt['tp-buddies'] = 'Buddies';

Add After:
$txt['tp-spiders'] = 'Spiders';

Open TPortalBlocks.template.php
Find
echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];

After Add:
echo '<br />'.$bullet.$txt['tp-spiders'].': '.$online['num_spiders'];
Title: Re: Hidden Users & Buddies
Post by: resurgence on April 13, 2006, 05:17:14 AM
xD i was playing around with that, i kept typing in

$online['spiders'];

that's why it didn't work lol thanks!
Title: Re: Hidden Users & Buddies
Post by: HaxXxoR on April 13, 2006, 05:19:43 AM
for some reason i cant get this to work on the Black 22 theme..... anyone have any ideas?
Title: Re: Hidden Users & Buddies
Post by: ontap on April 13, 2006, 05:20:54 AM
Quote from: HaxXxoR on April 13, 2006, 05:19:43 AM
for some reason i cant get this to work on the Black 22 theme..... anyone have any ideas?

just had a quick look at your site. do you have the Googlebot & Spiders MOD Installed?
Title: Re: Hidden Users & Buddies
Post by: HaxXxoR on April 13, 2006, 05:21:37 AM
yeah you can see it when you click on the forums button
Title: Re: Hidden Users & Buddies
Post by: Gargoyle on April 14, 2006, 02:06:21 AM
This should be in the base code... Maybe an option for the googlebot mod or something..

Thaks for the code. It works great!!
Title: Re: Hidden Users & Buddies
Post by: deadpoeticstar on May 04, 2006, 02:26:27 PM
i cant seem to find this file in my sources index

tportalblocks.template.php
Title: Re: Hidden Users & Buddies
Post by: G6Cad on May 04, 2006, 02:31:58 PM
The template files you find in the themes directorys

If it is a source file it's just called "filename.php"
Title: Re: Hidden Users & Buddies
Post by: deadpoeticstar on May 04, 2006, 02:41:46 PM
Need Help Fast!

Parse error: parse error, unexpected '<' in .../Themes/default/TPortalBlocks.template.php on line 501


<div style="width: 100%; height: 23ex; overflow: auto;">';

that was highlighted as a parse error in the TPblocks


Found the error

but now where to add buddies into the code

$online = ssi_whosOnline('array');
   echo $bullet.$txt['tp-users'].': '.$online['num_users'];
   echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
       echo '<br />'.$bullet.$txt['Spiders'].': '.$online['num_spiders'];
   echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
Title: Re: Hidden Users & Buddies
Post by: G6Cad on May 04, 2006, 03:09:01 PM
Just add this in right after

echo '<br />'.$bullet.$txt['tp-buddies'].': '.$online['buddies'];

echo '<br />'.$bullet.$txt['tp-hidden'].': '.$online['hidden'];

So it looks like this

echo '<br />'.$bullet.$txt['tp-hidden'].': '.$online['hidden'];
echo '<br />'.$bullet.$txt['tp-buddies'].': '.$online['buddies'];
Title: Re: Hidden Users & Buddies
Post by: deadpoeticstar on May 04, 2006, 03:12:02 PM
ok one last thing if i were to make it echo so in the online list it showed the staff as seperate from users how would that happen?

like this?:

echo $bullet.$txt['tp-staff'].': '.$online['num_staff'];
Title: Re: Hidden Users & Buddies
Post by: HaxXxoR on May 17, 2006, 06:02:36 PM
I tried to install the Spiders mod and got it to work but for some reason the Spiders part is Blank. Screen shot below. Anyone got any ideas? And yes i did check the code over again a few times. Please help  :tickedoff: :tickedoff:
Title: Re: Hidden Users & Buddies
Post by: Nokonium on May 17, 2006, 06:09:14 PM
Depending on what you have here

   $online = ssi_whosOnline('array');
   echo $bullet.$txt['tp-users'].': '.$online['num_users'];
   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 />  ';


You need this in TPortal.english.php

//spiders and buddies
$txt['tp-spiders'] = 'Spiders';
$txt['tp-buddies'] = 'Buddies';
Title: Re: Hidden Users & Buddies
Post by: HaxXxoR on May 17, 2006, 06:13:16 PM
My first part is like this
$online = ssi_whosOnline('array');
   echo $bullet.$txt['tp-users'].': '.$online['num_users'];
   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 />
<div style="width: 100%; height: 23ex; overflow: auto;">';


And the second part that supposed to be in TPortal.english.php does that just go anywhere?
Title: Re: Hidden Users & Buddies
Post by: G6Cad on May 17, 2006, 06:40:31 PM
You can add the text about anywhere in there as long as it is inside the php tags
Title: Re: Hidden Users & Buddies
Post by: ontap on May 18, 2006, 04:59:37 PM
Quote from: HaxXxoR on May 17, 2006, 06:02:36 PM
And yes i did check the code over again a few times. Please help  :tickedoff: :tickedoff:

your missing the "txt" part..

Look In Themes/default/languages/TPortal.english.php

and add...
$txt['tp-spiders'] = 'Spiders';
Title: Re: Hidden Users & Buddies
Post by: navjotjsingh on June 13, 2006, 04:03:45 PM
How to display list of Spiders in Block just like Users list is displayed?
Title: Re: Hidden Users & Buddies
Post by: G6Cad on June 13, 2006, 04:13:48 PM
You need to have the google bot and spider mod installed on your smf first, then do those steps explained in this thread.
The mod you find on Simplemachines in their download section :)
Title: Re: Hidden Users & Buddies
Post by: navjotjsingh on June 13, 2006, 04:16:14 PM
I know..that...But just like usernames are displayed...I want all spiders listed against bullets..like

.Google
.MSN
Title: Re: Hidden Users & Buddies
Post by: G6Cad on June 13, 2006, 04:18:15 PM
That i cant help you with, the only way i have seen this is the amount of spiders that are crawling the forum
Title: Re: Hidden Users & Buddies
Post by: Crip on June 27, 2006, 01:13:50 PM
Thanks Maxâââ,¬Å¾Ã,¢ ..
this is a nice little addiction ;)

crip
Title: Re: Hidden Users & Buddies
Post by: whoesa on August 17, 2006, 11:54:23 PM
I installed the google & spider mod today. It seem to work just fine. But im having some problems finding the code in TPortalBlocks.template.php because all the codes inside that file are alligned on the top.  :o Is that normal? See attachement please.

Anyone that could help me out here? Thanks.
Title: Re: Hidden Users & Buddies
Post by: Max on August 18, 2006, 01:09:20 AM
That would confuse anyone right there! all the code in one line hehe

i have added the google bot code into TPortalBlocks.template.php for you.

see attachment
Title: Re: Hidden Users & Buddies
Post by: whoesa on August 18, 2006, 01:24:16 AM
Worked like a charm.  :up: Thank you very much.  :)

One quick question: Is it normal that all the code is in 1 line?
Title: Re: Hidden Users & Buddies
Post by: Max on August 18, 2006, 01:37:57 AM
Quote from: whoesa on August 18, 2006, 01:24:16 AM
One quick question: Is it normal that all the code is in 1 line?

Wont do any harm having it all in the same line, just easier to read/code if it was all seperate  ;)

Wordpad shows it all in the same line but with notepad is dosent!  :D
Title: Re: Hidden Users & Buddies
Post by: whoesa on August 18, 2006, 01:53:17 AM
Ah ok thanks...good to know  ;)
Title: Re: Hidden Users & Buddies
Post by: resurgence on October 27, 2006, 02:25:40 PM
i added the code for the boardindex already, but i would like it in the userbox

is there a way to add flashchat users in the box as well?

i don't need to know what room they're in, i just want to know if there are people in there.

Title: Re: Hidden Users & Buddies
Post by: resurgence on October 27, 2006, 09:25:37 PM
anyone?