Custom Who.template.php - separated list for users, guests and spiders

Started by Owdy, November 03, 2004, 01:15:56 PM

Previous topic - Next topic

chep

Please backup BoardIndex.template.php first

Then attempt this below.

Change this:

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];


To this:


  echo ' (';
  // Show the number of buddies online?
  if ($context['show_buddies'])
   echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];
  echo ')';


By the way .. I didn't add it in there for you but it looks like you are missing the code for the hidden members in that same section. Perhaps some mod edited it out , but just thought I would mention it...

Jade Elizabeth

oh i requested it. it was like that (missing a space) before i removed that part of the code. i didnt want hidden members counted at all :D lol
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

appears to have worked



thankyou! (though i still wont believe it, howd you do it?)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

chrishicks

I'm about to finally add this to my forum and was wondering if anyone could point me to a place that has a really loaded list of spiders/bots(a copy/paste list for a code newbie)? I have the current version installed on my test board and many bots/spiders actually show up under guests. thank you in advance

chrishicks

another thing, I see it was mentioned about the issue with Firefox. when I browse my forum using Firefox everyone is shown with the MSN browser. in IE it works fine however. was a workaround for the Firefox issue ever found?

DeMar

Do someone have the latest spider list? Can you post it here?

How can I see in the who.template from which country visitors are. But only for admins.

Thanks

[embed-flash(width,height)]

Alejandro1

I really need some help, sice my forum is live and I don't want to f### it up  ;D

This is my Who.template.php and it doesn't look anything like the one that I downloaded from the topicstart:

<?php
// Version: 1.1; Who

// The only template in the file.
function template_main()
{
global $context, $settings, $options, $scripturl, $txt;

// Display the table header and linktree.
echo '
<div style="padding: 3px;">'
, theme_linktree(), '</div>
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg">
<td width="30%"><a href="'
. $scripturl . '?action=who;start=', $context['start'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td style="width: 14ex;"><a href="'
. $scripturl . '?action=who;start=', $context['start'], ';sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td>'
, $txt['who_action'], '</td>
</tr>'
;

// This is used to alternate the color of the background.
$alternate = true;

// For every member display their name, time and action (and more for admin).
foreach ($context['members'] as $member)
{
// $alternate will either be true or false. If it's true, use "windowbg2" and otherwise use "windowbg".
echo '
<tr class="windowbg'
, $alternate ? '2' : '', '">
<td>'
;

// Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
if (!$member['is_guest'])
{
echo '
<div style="float: right; width: 14ex;">
'
, $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
'
, $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
</div>'
;
}

echo '
<span'
, $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';

if (!empty($member['ip']))
echo '
(<a href="'
. $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank">' . $member['ip'] . '</a>)';

echo '
</td>
<td nowrap="nowrap">'
, $member['time'], '</td>
<td>'
, $member['action'], '</td>
</tr>'
;

// Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
$alternate = !$alternate;
}

echo '
<tr class="titlebg">
<td colspan="3"><b>'
, $txt[139], ':</b> ', $context['page_index'], '</td>
</tr>
</table>'
;
}

?>


Is there someone so helpfull as to help me out with this? I'm using SMF 1.1.4, with TP0.9.8 and Blocs's Enterprise theme.

Already installed the Googlebot v2.0.3 mod, adapted my modifications.dutch-utf8.php and have the functions for that mod available in my adminpanel, but nothing changes in  my users online, so I guessed I first would have to install this mod to get it working properly.

Any help would be greatly appreciated  ;D

DeMar

Do someone have the latest spider list? Can you post it here?

How can I see in the who.template from which country visitors are. But only for admins.

Thanks

[embed-flash(width,height)]

JimM

Here is a site I find quite useful when Spiders/Bots show up that are not in the template.

http://www.user-agents.org/index.shtml
Jim "JimM" Moore
Former Support Specialist

john34516

i upload the new who.template but

on my main page show only for example 2 Guests, 4 Users and not spiders

why that??

what i have to do to show and spiders?




Chadrew

QuoteHey,
I installed Googlebot & Spiders mod and this mod on my Safmc theme.
All this mod does is show a separate table for spiders in "Who's Online" page.
What I also want it to do is show "Active spiders in last 15 minutes" like on my default theme. What do I edit and where?

Nevermind, I found out myself.

DarkCAMV

Hi!, thanks for the mod, it's really usefull, but well here's my trouble...

I've installed this file and the mod Googlebot & Spiders, the Googlebot is doing what I want, for regular users show the spiders as guests, but if a regular user sees the Who's Online List, the spiders are shown...

So my question is, is there a way to show the spiders as guest for regular users on the Who Online List?

Deaks

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

DarkCAMV


Kindred

in other words... you want to combine two mods to make them both do something that neither was designed to do...


Of course there is a way... but I suggest that you either write the code or request someone to write it for you...   this is not the thread for that, however.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FotoZone

2. What if i wanna ad more spiders or user agents?

Spiders, find:
Code:

//Search Spiders

ad after:
Code:

array (
         'agent' => 'Openbot',
         'spidername' => 'Openfind spider',
         'spider' => true,
                ),



User agents/browsers, find:
Code:

//Browsers

ad after:
Code:

array (
      'agent' => 'Epiphany',
       ),



not  in who.template

DarkCAMV

Quote from: Kindred on December 16, 2007, 08:07:45 PM
in other words... you want to combine two mods to make them both do something that neither was designed to do...

Not exactly, with the Google and Spiders mod I don't have any trouble, all I want is that the Who's Online List show the spiders for admins and moderator only.


khokon

Best forum for sharing adsense revenue so far in the world http://forum.alljobsbd.com [nofollow]

JimM

Jim "JimM" Moore
Former Support Specialist

Advertisement: