Advertisement:

Author Topic: [SPLIT] about custom who.template.php  (Read 62332 times)

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #40 on: May 30, 2005, 05:02:53 PM »
Changed these

Code: [Select]
$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:
Quote
Google Spider
(66.249.71.28, Google Spider)
to
Quote
Google Spider
(66.249.71.28, Googlebot)
?
Like guest and users have. (name + agent)



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! :)
« Last Edit: May 30, 2005, 06:51:09 PM by 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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #41 on: May 30, 2005, 06:58:24 PM »
+

Code: [Select]
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

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
[SPLIT] about custom who.template.php
« Reply #42 on: May 30, 2005, 07:18:33 PM »
work perfectly thanx MiKes and Owdy

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
[SPLIT] about custom who.template.php
« Reply #43 on: May 30, 2005, 07:45:41 PM »
Q: can we change this:
Quote
Google Spider
(66.249.71.28, Google Spider)
to
Quote
Google Spider
(66.249.71.28, Googlebot)
?
Like guest and users have. (name + agent)
change
Code: [Select]
$result = isset($poss['name']) ? $poss['name'] : $poss['agent'];To
Code: [Select]
$result = $poss['agent'];

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #44 on: May 31, 2005, 04:03:01 AM »
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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #45 on: May 31, 2005, 06:55:10 AM »

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

Hmmm, that kills this also:

Code: [Select]
array (
'agent' => 'Gecko',
'name' => 'Mozilla',
                ),

All Mozillas appears Cecko.

Could it be done something like in orginal script:

Code: [Select]
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

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
[SPLIT] about custom who.template.php
« Reply #46 on: May 31, 2005, 09:14:35 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

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
[SPLIT] about custom who.template.php
« Reply #47 on: May 31, 2005, 11:27:37 AM »
use this:
Code: [Select]
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.

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #48 on: May 31, 2005, 11:49:00 AM »
Now it works. Thanks again!  :D :D

« Last Edit: May 31, 2005, 12:12:16 PM by 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

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
[SPLIT] about custom who.template.php
« Reply #49 on: May 31, 2005, 05:21:53 PM »
use this:
Code: [Select]
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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #50 on: May 31, 2005, 11:13:11 PM »
Download file from first post.
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

Offline nokonium

  • Full Member
  • ***
  • Posts: 680
  • Gender: Male
  • TinyPortal Support Team
    • Our-Local
[SPLIT] about custom who.template.php
« Reply #51 on: June 02, 2005, 03:56:57 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?



Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
[SPLIT] about custom who.template.php
« Reply #52 on: June 02, 2005, 04:33:45 PM »
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

Offline sensovision

  • Jr. Member
  • **
  • Posts: 250
  • Gender: Male
    • Some photos made by me:)
[SPLIT] about custom who.template.php
« Reply #53 on: June 07, 2005, 07:18:21 AM »
Gret mod, Owdy! I was looking for something like this long ago, thanks!

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #54 on: June 07, 2005, 11:22:48 AM »
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

Offline sensovision

  • Jr. Member
  • **
  • Posts: 250
  • Gender: Male
    • Some photos made by me:)
[SPLIT] about custom who.template.php
« Reply #55 on: June 07, 2005, 12:07:06 PM »
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 :)

Offline Harro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,122
  • Gender: Male
  • I'm watching you
[SPLIT] about custom who.template.php
« Reply #56 on: June 09, 2005, 03:40:09 PM »
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?

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #57 on: June 09, 2005, 03:48:39 PM »
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

Offline Harro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,122
  • Gender: Male
  • I'm watching you
[SPLIT] about custom who.template.php
« Reply #58 on: June 09, 2005, 04:30:51 PM »
It says
Mediapartners-Google/2.1

It's a google adsense spider.

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
[SPLIT] about custom who.template.php
« Reply #59 on: June 09, 2005, 04:33:11 PM »
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