[SPLIT] about custom who.template.php

Started by Ben_S, November 03, 2004, 01:19:53 PM

Previous topic - Next topic

Owdy

#40
Changed these

$known_agents = array (
array (
'agent' => 'WISENutbot',
'name' => 'Looksmart Spider',
                        'spider' => true,
),
array (
'agent' => 'MSNBot',
'name' => 'MSN Spider',
'spider' => true,
),
array (
'agent' => 'W3C_Validator',
'name' => 'W3C Validator',
        'spider' => true,
),
array (
'agent' => 'Googlebot-Image',
'name' => 'Google Image-Spider',
'spider' => true,
),
array (
'agent' => 'Googlebot',
'name' => 'Google Spider',
'spider' => true,
),
array (
'agent' => 'Mediapartners-Google',
'spider' => true,
                 ),
array (
'agent' => 'Scooter',
'name' => 'Altavista Spider',
'spider' => true,
),
array (
'agent' => 'Ask Jeeves',
'spider' => true,
),
                 
               array (
'agent' => 'GigaBot',
'spider' => true,
),

                array (
'agent' => 'ia_archiver',
'spider' => true,
),
array (
'agent' => 'FAST-WebCrawler',
'spider' => true,
),
array (
'agent' => 'Yahoo! Slurp',
'spider' => true,
),
array (
'agent' => 'Inktomi Slurp',
                        'spider' => true,
),

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' => 'NG/2.0',
),
array (
'agent' => 'MSIE',
                ),
);





Q: can we change this:
QuoteGoogle Spider
(66.249.71.28, Google Spider)
to
QuoteGoogle Spider
(66.249.71.28, Googlebot)
?
Like guest and users have. (name + agent)




Quote from: [Unknown] on April 16, 2005, 10:45:41 AM
You'll have to create your own group for moderators and use that id.  When viewing the "who's online" page, no one will ever be in group 3.  Group 2 is global moderators only.

-[Unknown]
No, i need to use Mikes script. It does this by default. Thank you M! :)
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Owdy

+

array (
'agent' => 'Gecko',
'name' => 'Mozilla',
                ),
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

edi67

work perfectly thanx MiKes and Owdy

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Thantos

Quote from: Owdy on May 30, 2005, 05:02:53 PM
Q: can we change this:
QuoteGoogle Spider
(66.249.71.28, Google Spider)
to
QuoteGoogle Spider
(66.249.71.28, Googlebot)
?
Like guest and users have. (name + agent)
change
$result = isset($poss['name']) ? $poss['name'] : $poss['agent'];
To
$result = $poss['agent'];

Owdy

Perfect mike!

Edi67, how did you ad those flags?
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Owdy

Quote from: MikeMill on May 30, 2005, 07:45:41 PM

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

Hmmm, that kills this also:

array (
'agent' => 'Gecko',
'name' => 'Mozilla',
                ),


All Mozillas appears Cecko.

Could it be done something like in orginal script:


if ($agent == '')
{
if (strpos($user_agent, 'Mozilla/4.') !== false)
$agent = 'Netscrape 4';
if (strpos($user_agent, 'Gecko') !== false)
$agent = 'Mozilla';
elseif (preg_match('~(MSIE\s+[^;)]+)~', $user_agent, $match) == 1)

$agent = $match[1];
elseif ($user_agent != '')
$agent = 'MSIE';
else
$agent = '???';
}
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

edi67

Quote from: Owdy on May 31, 2005, 04:03:01 AM
Edi67, how did you ad those flags?

i have location MOD and i only add this part in bold to these line blue for have the directly the flags of the users i think is very useful:

<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />     <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>';
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Thantos

use this:
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'];
}


now you can have as much flexibility as you want.
'spidername' =>
will tell you what to rename 'guest' to
'name' =>
will tell you what to name the agent as.

Owdy

#48
Now it works. Thanks again!  :D :D

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

edi67

Quote from: MikeMill on May 31, 2005, 11:27:37 AM
use this:
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'];
}


now you can have as much flexibility as you want.
'spidername' =>
will tell you what to rename 'guest' to
'name' =>
will tell you what to name the agent as.

please tell me mike where insert this code? and for which purpose ?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

nokonium

Quote from: nokonium on May 29, 2005, 12:55:48 PM
What I mean is, could who.template.php be modified to lookup the IP of Guests in an array and if it finds a match, it would add some custom text, according to the entries in the lookup.

Slightly different context, the forum software has to match the IP of logged in guests to a user name, would it be possible to give admins the ability to use the same code to lookup guests, because quite often they are members who haven't logged in?



JayBachatero

wow good job.  i like how its diveided bet users guests and spiders.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

sensovision

Gret mod, Owdy! I was looking for something like this long ago, thanks!

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

sensovision

ups, Owdy, I've just realized that I've just post in the test related to other mod :P I was referring to GoogleBot and Spiders which I've installed, but I'll look now to this mod to see how it's work and whenver I need it :)

Harro

Got a question about this.
I installed this, and it works great.
But google is crawling the forum, but it just appears as guest.
I have the ip (looked if up and saw that it was google), so can I add this to the who.template.php somewhere, so when googlebot is crawling with that ip, it will appear as googlebot and not as a guest?

Owdy

Im afraid not. You can ad UserAgents, not IP's.If you point your mouse over that users agent (example MSIE), what it says about agent?
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Harro

It says
Mediapartners-Google/2.1

It's a google adsense spider.

Owdy

Weird, it is in that file.
* Owdy goes to check.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Advertisement: