News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[SPLIT] about custom who.template.php

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

Previous topic - Next topic

Surferbird

#180
It worked, translations is done and all show up ok.

Thank you very much moonwolf  :)
.:: Always something to ask - always grateful for assistance ::.

Niteblade

#181
I love smart people.

I'll try this when I get home.

Here's a nice little challenge.  :P Add all of these to the list. :)
affiliate blog

moonwolf

Quote from: Aslan on May 17, 2006, 07:32:44 AM
I actually have members with arachnaphobia. I too would like to change the word spiders. I did a search for any file on my machine that had the word Spider in it. I confined my search to today's date (I just downloaded and installed it):

To do this you probably want to change the individual spider's names as well.

In Sources/Subs.php

Find every line that starts with

                        'spidername' => '

If the name after that includes the word "Spider", replace Spider in that line with Crawler or whatever you want.

You need to do the same to Themes/<themename>/Who.template.php ... change every line that is the "spidername" variable to remove the word "Spider" from the crawler's name.  i.e.


                        'spidername' => 'Google spider',


becomes


                        'spidername' => 'Google crawler',
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Aslan

Thank you moonwolf. Smart and kind is a great combination!
Let everyone sweep in front of his own door,
and the whole world will be clean.
Goethe

Niteblade

I'm sorry to report that this did not work. The Amazon bot still shows up as a guest. As soon as I make a new post on my forum, this bot (as well as Google's spider) shows up to spider the page ...
affiliate blog

moonwolf

if it's still showing up as guest, make a note of the useragent that shows up after the IP address, and add that as a block to the files, the same way you added amzn_assoc and aranhabot.
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Niteblade

#186
All I see is this ...

Guest
(207.171.165.38, Mozilla)

When I track the IP, I see this...

OrgName:    Amazon.com, Inc.
OrgID:      AMAZON-4
Address:    605 5th Ave S
City:       SEATTLE
StateProv:  WA
PostalCode: 98104
Country:    US

NetRange:   207.171.160.0 - 207.171.191.255
CIDR:       207.171.160.0/19
NetName:    AMAZON-01
NetHandle:  NET-207-171-160-0-1
Parent:     NET-207-0-0-0-0
NetType:    Direct Assignment
NameServer: NS-1.AMAZON.COM
NameServer: NS-2.AMAZON.COM
NameServer: NS-3.AMAZON.COM
NameServer: AUTH00.NS.UU.NET
Comment:   
RegDate:    1999-09-23
Updated:    2002-03-19

RTechHandle: AC6-ORG-ARIN
RTechName:   Amazon.com, Inc.
RTechPhone:  +1-206-266-2187
RTechEmail:  [email protected]

OrgTechHandle: ROLEA19-ARIN
OrgTechName:   Role Account
OrgTechPhone:  +1-206-266-2187
OrgTechEmail:  [email protected]

# ARIN WHOIS database, last updated 2006-05-21 19:10
# Enter ? for additional hints on searching ARIN's WHOIS database.

PS : I enjoy your signature. Dune, eh?
affiliate blog

moonwolf

Why would Amazon's spider be showing its useragent as Mozilla?

just because the IP is Amazon's, it doesn't mean that this is coming from Amazon's spidering ...
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Niteblade

Good question.

Maybe some one'll come along and help out.
affiliate blog

DemonicInfluence

Ever think that maybe somebody from amazon was surfing with mozilla browser?

Niteblade

Quote from: DemonicInfluence on May 22, 2006, 08:23:17 PM
Ever think that maybe somebody from amazon was surfing with mozilla browser?

Within seconds after each time a new post is created ?
affiliate blog

Owdy

#191
Quote from: moonwolf on May 17, 2006, 08:24:42 AM
Quote from: nite0859 on May 16, 2006, 10:17:26 PM
I put an amazon affiliate link on my site since the purpose is financial education.

207.171.165.38 is the spider or bot that's always on my site, and a whois reveals that it is amazon. Any possible way to add it (and the rest of the ip range) to the file in the first post ?

in Sources/Subs.php

Find:

There is no need to edit Subs.php if you wanna ad spiders to this action. Just ad them to this file, Who.template.php.

Quote from: Surferbird on May 17, 2006, 04:22:49 AM
Can someone clever SMF person or the author of this Who thing tell us where to change this 3 words to other language? Here is many clever persons in this forum, please someone who understand php, help us with this!
Where, in what file should this 3 words be translated/changed to own language?

Guests
Members
Spiders

This is how i translated this to finnish:
// 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 (
'Jäsenet' => array(),
'Vieraat' => array(),
'Hakurobotit' => 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'] != 0 )
$brokendown['Jäsenet'][] = &$context['members'][$key];
else if ( $spider )
$brokendown['Hakurobotit'][] = &$context['members'][$key];
else
$brokendown['Vieraat'][] = &$context['members'][$key];
  }


Again, just edit this file, nothing else.
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

moonwolf

Quote from: Owdy on May 23, 2006, 12:27:50 AM
There is no need to edit Subs.php if you wanna ad spiders to this action. Just ad them to this file, Who.template.php.

the patch covers if you have the Googlebot & Spiders mod installed as well, hence the Subs.php changes.  it makes sense if the people who wanted the changes in the improved Who mod to give them the same options for the User Info Center block.
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Owdy

#193
Quote from: moonwolf on May 23, 2006, 08:07:53 AM
Quote from: Owdy on May 23, 2006, 12:27:50 AM
There is no need to edit Subs.php if you wanna ad spiders to this action. Just ad them to this file, Who.template.php.

the patch covers if you have the Googlebot & Spiders mod installed as well, hence the Subs.php changes.  it makes sense if the people who wanted the changes in the improved Who mod to give them the same options for the User Info Center block.
I understand that, but this topic isn't about Googlebot & Spiders mod. If your code is for some other MOD, at least say it when you post your code. Even better, post your code to Googlebot & Spiders mod topic where it belongs.

If user just wanna use this file/action, your modifications are totally unnecessary.

Thanks.
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

moonwolf

Actually, I was posting the mod for both, but your gratitude is appreciated.  next time you come up with the answers instead?  it was your mod to begin with after all.

and people wonder why no-one bothers to answer questions for weeks.
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Owdy

No need to get angry here. I just say at least tell people that your code is for some other mod, not for this file. People allways get mixed up with thise 2 mods and you arent helping clearing that up.
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

moonwolf

I don't get angry - just bored.

the confusion over the two mods might be because those using your Who mod might also want the Googlebot & Spiders mod so they have consistency between who's online and the Who page itself.  maybe you should consider merging the two.  either way, I'm not going to assume they have one and not the other, since the changes apply to both, so I post code to change both.  When it gets confusing, I clarified.

I'm not all that interested in boosting my post count by posting redundancies to two separate threads, and unlikely to consider it very efficient to have people who ask for help have to go look at 2 separate threads to read the exact same thing with just filenames and line numbers changed.

If that offends your sensibilities - *shrugs*

the fix is posted, people can see where it goes.  arguing over where the fix got posted is fairly boring.
hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive]
Original code, patches, and fragments by the author are  licensed under a hxxp:creativecommons.org/licenses/by-nc-sa/2.5/ [nonactive].
Just a pity that even has to be said.

Owdy

#197
Sorry to get you bored but i have right to keep my topic clean and understandable. If you find that boring, move on.

* Owdy starts to clean to house.

edit: topic splitted. Original: http://www.simplemachines.org/community/index.php?topic=19243.0
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: