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

Pedja

Here are definitions for some more spiders


                array (

'agent' => 'Pogodak.co.yu',

'spidername' => 'Pogodak',

'spider' => true,

),

                array (

'agent' => 'TridentSpider',

'spider' => true,

),


                array (

'agent' => 'ccubee',

'spider' => true,

),

                array (

'agent' => 'Alcohol Search',

'spider' => true,

),


RebelRose

Great thanks, I will add this to the php file and also on my site.

tones_ie

Hi Pedja...


thanks for the info....  How to add global mods to see this please ?

Pedja

If I understood mod well, it relays on Vew IP privilege. Anyone who is alowed to see user IP's would be able to see all details.

Pedja

One more update. Several more crawlers are added to the list and also template changed to show resolved mnemoninc address together with IP.

Just replace old Who.template.php with this one.




<?php



// 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>';

$brokendown = array (

'Members' => array(),

'Guests' => array(),

'Spiders' => array(),

);



foreach($context['members'] AS $key => $member)

{

$spider getAgent($member['query']['USER_AGENT'], $context['members'][$key]['name'], $agent$member['id'] == 0);

$context['members'][$key]['agent'] = $agent;

$member['query']['USER_AGENT'] = isset($member['query']['USER_AGENT']) ? $member['query']['USER_AGENT'] : '';

if ( $member['id'] != )

$brokendown['Members'][] = &$context['members'][$key];

else if ( $spider )

$brokendown['Spiders'][] = &$context['members'][$key];

else

$brokendown['Guests'][] = &$context['members'][$key];

}

// echo '<pre>'; print_r($brokendown['Spiders']); echo '</pre>'; return;

foreach($brokendown AS $group => $members)

{

echo '

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">

<tr>

<td class="catbg">'
$group'</td>

</tr>

</table>

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">

<tr class="titlebg">

<td width="30%"><a href="' 
$scripturl '?action=who;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="" border="0" />' '''</a></td>

<td style="width: 14ex;"><a href="' 
$scripturl '?action=who;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="" border="0" />' '''</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 ($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'] . '" border="0" 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>';

echo '

</td>

<td nowrap="nowrap">'
$member['time'], '</td>

<td>'
$member['action'], '</td>

</tr>'
;
   if ( !empty($member['ip']) ) {
                echo 
'<tr class="windowbg'$alternate '2' '''"><td colspan="3">';
    
echo '<span class="smalltext">';
echo '<b><a href="' $scripturl '?action=trackip;searchip=' $member['ip'] . '" target="_blank" title="' $member['ip'] . '" class="smalltext2">' $member['ip'] . '</a></b> (' host_from_ip($member['ip'])  . '), <acronym title="' $member['query']['USER_AGENT'] . '">' $member['agent'] . '</acronym>';
 
echo '<br /> User agent: ' $member['query']['USER_AGENT']; 

                echo 
'</span>';
                echo 
'</td></tr>';

                 }

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

$alternate = !$alternate;

}

echo '</table><br/>';

}

echo '

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder"><tr><td class="titlebg">

<b>'
$txt[139], ':</b> '$context['page_index'], '

</td></tr></table>'
;



}



function 
getAgent( &$user_agent, &$user_name, &$result$guest )

{

$known_agents = array (

                
//Search Spiders

array (

'agent' => 'WISENutbot',

'spidername' => 'Looksmart spider',

                        
'spider' => true,

),

array (

'agent' => 'MSNBot',

'spidername' => 'MSN spider',

'spider' => true,

),

array (

'agent' => 'W3C_Validator',

'spidername' => 'W3C Validaator',

        'spider' => true,

),

array (

'agent' => 'Googlebot-Image',

'spidername' => 'Google-Image Spider',

'spider' => true,

),

array (

'agent' => 'Googlebot',

'spidername' => 'Google spider',

'spider' => true,

),



array (

'agent' => 'Mediapartners-Google',

'spidername' => 'Google AdSense spider',

'spider' => true,

),



                array (

'agent' => 'Openbot',

'spidername' => 'Openfind spider',

'spider' => true,

                ),

array (

'agent' => 'Yahoo! Slurp',

'spidername' => 'Yahoo spider',

'spider' => true,
),



                array (

'agent' => 'FAST-WebCrawler',

'spider' => true,

                ),

                array (

'agent' => 'Wget',

'spider' => true,

                ),

array (

'agent' => 'Ask Jeeves'

'spider' => true,



),

array (

'agent' => 'Speedy Spider',

'spider' => true,



),

array (

'agent' => 'SurveyBot',

'spider' => true,



),

array (

'agent' => 'IBM_Planetwide',

'spider' => true,



),



                array (

'agent' => 'GigaBot',

'spider' => true,



),

array (

'agent' => 'ia_archiver',

'spider' => true,

),

array (

'agent' => 'FAST-WebCrawler',

'spider' => true,



),

array (

'agent' => 'Inktomi Slurp',

                        
'spider' => true,

),

                

                array (

'agent' => 'appie',

'spidername' => 'Walhello spider',

'spider' => true,

),

                array (

'agent' => 'Pogodak.co.yu',

'spidername' => 'Pogodak',

'spider' => true,

),

                array (

'agent' => 'TridentSpider',

'spider' => true,

),


                array (

'agent' => 'ccubee',

'spider' => true,

),

                array (

'agent' => 'Alcohol Search',

'spider' => true,

),

                array (

'agent' => 'Google Wireless Transcoder',

'spider' => true,

),

                array (

'agent' => 'ichiro',
'spidername' => 'Goo Japan / Inktomi robot',
'spider' => true,

),

                array (

'agent' => 'NaverBot',

'spider' => true,

),

 //mobiles

 array (
'agent' => 'Nokia'
 ),
 array (
'agent' => 'Samsung',
 ),
 array (
'agent' => 'Ericsson',
 ),
array (
'agent' => 'Siemens',
 ),
  array (
'agent' => 'Motorola',
),
                
//Browsers

 
array (

'agent' => 'Opera',

),

array (

'agent' => 'Firefox',

),

array (

'agent' => 'Firebird',

),

array (

'agent' => 'Safari'

),

           
array (

'agent' => 'Netscape',

),

array (

'agent' => 'MyIE2'

),

array (

'agent' => 'Konqueror'

),

array (

'agent' => 'Galeon'

),

array (

'agent' => 'KMeleon',

),

                array (

'agent' => 'NG/2.0',

),



                array (

'agent' => 'Gecko',

'name' => 'Mozilla',

         
),

                array (

'agent' => 'MSIE',



                ),

);



foreach( 
$known_agents AS $poss )

if (strpos(strtolower($user_agent), strtolower($poss['agent'])) !== false)

{

if ( $guest && isset($poss['spider']) && $poss['spider'] )

$user_name = isset($poss['spidername']) ? $poss['spidername'] : (isset($poss['name']) ? $poss['name'] : $poss['agent']); 

$result = isset($poss['name']) ? $poss['name'] : $poss['agent']; 

return isset($poss['spider']) && $poss['spider'];

}

$result $user_agent;

return false;

}



?>



RebelRose


Pedja

Two more crawlers



                array (

'agent' => 'MJ12bot',
'spidername' => 'Majestic12',
'spider' => true,

),

                array (

'agent' => 'IsMySiteUp',
'spider' => true,

),




Pedja

Well, here is one list: http://www.psychotekk.de/appendix/appendix7.shtm

It would be interesting to have users comeing through proxies or anonymizers detected separately.

Skipdawg

Wouldn't it be cool if you could make a self updating bots/spiders list. To check for new ones or old ones no longer used. Probably could be done but would likely be a pain to code up. But sure would be cool. Maybe some day.  ;)
Skipdawg's Community

Powered by SMF 1.1.3

Pedja

Quote from: Skipdawg on October 12, 2006, 03:40:18 PM
Wouldn't it be cool if you could make a self updating bots/spiders list. To check for new ones or old ones no longer used. Probably could be done but would likely be a pain to code up. But sure would be cool. Maybe some day.  ;)

It is half day job to create site. Problem is that such list cannot be selfupdating, someone has to see what are spiders signatures and enter them. But then anyone else could just download list. That should not be a problem.

But I guess there is no such need onthis. You just need to recognize spiders that come often to your site to distinguish traffic they make. And those are several mayor spiders. Less frequent spiders are not that important.

ramystyle

Hi and thanks for the mod !

I installed it on RC3 and installation was successfull !
I have set permissions for guests, members and admin to view bots and I have checked all boxes in the setup page (in features and options --> Googlebot & Spiders )

Now my problem is that I never see any bots on my site (Although yahoo is slurping my page every 10 mins or so..) So I don't even know if the mod is working correctly on my site or not :S

Any ideas why spiders names are not showing ?

(www.multimontreal.com)

TheGamer


DaBoROE09

thanks i love this file.  it works great.  i owe you big time dude.

mike

ramystyle

Anyone ?

I still don't have any spiders showing (although yahoo is slurping my page every 10 mins) !

I tried uninstalling the mod and reinstalling it ! It installed ok !! But can't see anthing :(

Kindred

Why do people think that trying to install/uninstall/reinstall will have a different effect the second (or third or fourth) time? Computers do not leanr by repetition, they do the same thing, the same way, every time.

maybe you didn't replace the who.template.php in your actual theme directory?

Сл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."

RoarinRow

Anyone have an updated who.template.php file?  Mine is dated 9/10/06 9.44kb in size.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Kindred

why do you need an updated one?   Mine is dated back in July and it works just fine...
Сл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."

ramystyle

Good point.. I haven't replaced.. I just downloaded the file from this thread and replaced it..
I'll see if it works now !

RoarinRow

Quote from: Kindred on November 16, 2006, 02:36:42 AM
why do you need an updated one?   Mine is dated back in July and it works just fine...

Mine works fine too, just seeing if anyone has a new version with more list of spiders added to the file.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

ramystyle

So strange.. I replaced the file with the one on this thread.. And still nothing..
No clue why... I guess i'm jsut unlucky !

Advertisement: