• Welcome to Simple Machines Community Forum. Please login or sign up.

SMF 1.x & 2.x - Custom Who.template.php - Displays Users, Guests & Spiders

Started by MoreBloodWine, September 23, 2010, 05:25:21 PM

Previous topic - Next topic

MoreBloodWine

First I will start with a famous quote...

Quote from: Owdy on November 03, 2004, 01:15:56 PM
*** This is NOT the Googlebot & Spiders mod, you can find that mod by clicking here. ***

Ok, first and foremost... ALWAYS back up your original files before replacing them. As for what the attached file does, it replaces your currently used themes Who.template.php file and breaks it into three parts. Instead of lumping everything together it creates separate lists for Users, Guests & Spiders as seen here on my site.

It currently has about 200 or so agents for Spiders, Browsers & Phones... I took the time to alphabetize it so it's easily managed when adding new agents. This is a pretty straight forward setup so you can't really screw it up but should you have any questions please reply to this thread and I will try to answer it.

Few things to note:

1. This file was originally hosted and created by Owdy, he has decided to give up support on it for the numerous idiots who can't seem to understand that this has nothing to do with the Googlebot & Spiders mod. I'm sorry if what I just said seems harsh but it's the cold hearted truth. In any case, he has given me permission to re-host it and provide support for it by adding new agents etc. when needed.

2. Any questions regarding the Googlebot & Spiders mod will be ignored as this has nothing what so ever to do with that mod.

3. Anyone re-hosting the files code with new agents will be ignored as I don't have the time to comb through hundreds of agents to find whats new and add them to the main file. So, with that said new agents will only be accepted in the following formats and at which point they will be added to the main file.

Code (If Spider) Select
        array (
            'agent' => ' ',
            'spidername' => ' ',
            'spider' => true,
        ),


Code (If Phone) Select
        array (
            'agent' => ' ',
            'name' => ' ',   
        ),


Code (If Browser) Select
        array (
            'agent' => ' ',
        ),


Edit: Since SMF seems to be stubborn (set) in their ways with permissions here I have to host the file off site at one of my forums, please feel free to register if you want since it's a multi platform gaming site. In any case, you can DL the file from the below link.

Custom Who.template.php
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Request for the admins, please if you can allow me permissions to edit the main attached file as I only have the option to delete it.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Oya

Quote from: MoreBloodWine on September 23, 2010, 05:49:53 PM
Request for the admins, please if you can allow me permissions to edit the main attached file as I only have the option to delete it.

not without changing the whole permissions on this board so that everyone can upload attachments

MoreBloodWine

Quote from: Oya on September 23, 2010, 06:18:11 PM
Quote from: MoreBloodWine on September 23, 2010, 05:49:53 PM
Request for the admins, please if you can allow me permissions to edit the main attached file as I only have the option to delete it.

not without changing the whole permissions on this board so that everyone can upload attachments
Assuming that that is infact the case which it remains to be seen then I'll have to end up hosting it locally or some BS.

Edit: Come to think of it, if that is the case, with the team they have they could easily code in something simple. No I don't mean just for me but everyone as a whole who has a file thats part of their tip/trick.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Oya

nto without altering smfs core code and they dont generally like doing that here because it makes upgrading harder

attachments are simply based on 'can post them in this board'

MoreBloodWine

Well either way between permissions by board and makin a new attachments group it should be doable without modifying anything now that I think about it.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Oya

not really because then youd have to add anyone who ever posted a thread here to that group which is very very manual

MoreBloodWine

Quote from: Oya on September 23, 2010, 08:28:53 PM
not really because then youd have to add anyone who ever posted a thread here to that group which is very very manual
True but only if said person asks to be added.

Edit: Again, it would only be for people with tips that use files so no, not everyone with a post here.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


choloman05

This file reminds me of a really good one that was floating around here somewhere years ago.  As with that one, using this file give me tonsss of errors in my error log.

MoreBloodWine

Quote from: choloman05 on September 28, 2010, 06:03:58 PM
This file reminds me of a really good one that was floating around here somewhere years ago.  As with that one, using this file give me tonsss of errors in my error log.
I'm sorry but I have t ocry foul on that because its running fine on my 1.1.11 live site and a 2.0 test site, if it errord on you then you either have something else conflicting with it or you tried to make a change toe the file yourself which then errord.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


choloman05

I have 0 mods installed on a fresh installation of 2.0RC3.  I don't know why, but I get tons of errors.  The old template I was talking about did the exact same thing on various versions of SMF. 

Maybe I need to change some setting or something I'm not thinking about though.  But even disabling template evals doesn't cut down on the errors.

MoreBloodWine

Quote from: choloman05 on October 10, 2010, 06:55:48 PM
I have 0 mods installed on a fresh installation of 2.0RC3.  I don't know why, but I get tons of errors.  The old template I was talking about did the exact same thing on various versions of SMF. 

Maybe I need to change some setting or something I'm not thinking about though.  But even disabling template evals doesn't cut down on the errors.
I honestly wish I had soemthing to tell you but I have a 1.1 live site a 1.1 test site and even a 2.0 test site and this file is all working 100% flawlessly on them without a single error in either SMF or my cPanel.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


snoopy_virtual

Hi MoreBloodWine

Fist of all thanks for continuing Owdy's work. I have been using this way to display the whosonline page for ages and it would be a pity if we don't have somewhere to add new spiders etc.

I can see you have problems with the permission to modify the attached file in the fist post, so I don't know how you are going to do this, but anyway here there are 3 spiders more:


array (
'agent' => 'SBIder',
'spidername' => 'SBIder',
'spider' => true,
),
array (
'agent' => 'noxtrumbot',
'spidername' => 'Noxtrum Spider',
'spider' => true,
),
array (
'agent' => 'Sogou web spider',
'spidername' => 'Sogou Spider',
'spider' => true,
),

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

MoreBloodWine

Quote from: snoopy_virtual on October 12, 2010, 11:55:24 AM
Hi MoreBloodWine

Fist of all thanks for continuing Owdy's work. I have been using this way to display the whosonline page for ages and it would be a pity if we don't have somewhere to add new spiders etc.

I can see you have problems with the permission to modify the attached file in the fist post, so I don't know how you are going to do this, but anyway here there are 3 spiders more:


array (
'agent' => 'SBIder',
'spidername' => 'SBIder',
'spider' => true,
),
array (
'agent' => 'noxtrumbot',
'spidername' => 'Noxtrum spider',
'spider' => true,
),
array (
'agent' => 'Sogou web spider',
'spidername' => 'Sogou spider',
'spider' => true,
),

Thx for those, as for updating the file... until rather I should say if SMF ever gets around to setting up permissions or whatever for me to mod the file that I may just have to delete it from the main post and host it locally. I also have a few other ideas on how to handle it but either way I'm working on the "hosting" problem.

But ya, thx for the new submissions and your welcome for the continuation ;-)

Edit: Thought I would add that one of my ideas which would seem to be the best is make a database thats hosted by me that the file would grab it's info from but that would most likely mean turning it into an actual mod because of all the connection info that would need to happen. Even then I'm not sure if it would even be that stable because of all the data it would have to pull. Another idea though thats sort of based off this one is make it like I just said but have it save the info locally to your site so it only polls for data when new data is found. The submission process for new spiders etc would still pretty much be the same but if I could get this idea working it would make the updating / distribution pretty damn smooth.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


snoopy_virtual

There are a lot of mods that the only thing they do is upload to your forum a few images (avatar mods, icon mods, etc) so I don't see a big problem if you just turn this into a mod.

I mean a mod that the only thing it does is to replace the original SMF Who.template.php file with this one.

Or even better (just a little more complicated but possible) a mod that modify the original SMF Who.template.php file to leave it like this one.

That way you will have full control all the time and you won't need to have anything hosted anywhere else.

Of course it's up to you. Whatever you decide just say it here so we (me and the rest of the people using this thing) know where/how to find/add new entries.  ;)

PS.- If you haven't done mods before PM me and I can give you a hand. It doesn't seem too difficult to do.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

MoreBloodWine

What I was talking about in my edit was turning this in to a mod thats sort of like Stop Spammer in that it connects to an offsite DB of sorts to gather / check info. So like if this got turned into a mod it would connect to my site somewhere whenever someone loads the Whos Online page and check for new info and if found store it locally on the users site that way everytime the whos online is loaded it wouldnt poll for all available data but instead check for new data to DL. Again this is just one of my many ideas but probbaly the most complicated of them all.
Quote from: snoopy_virtual on October 12, 2010, 01:43:46 PM
There are a lot of mods that the only thing they do is upload to your forum a few images (avatar mods, icon mods, etc) so I don't see a big problem if you just turn this into a mod.

I mean a mod that the only thing it does is to replace the original SMF Who.template.php file with this one.

Or even better (just a little more complicated but possible) a mod that modify the original SMF Who.template.php file to leave it like this one.

That way you will have full control all the time and you won't need to have anything hosted anywhere else.

Of course it's up to you. Whatever you decide just say it here so we (me and the rest of the people using this thing) know where/how to find/add new entries.  ;)

PS.- If you haven't done mods before PM me and I can give you a hand. It doesn't seem too difficult to do.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


snoopy_virtual

Well, I am co-author (together with M-DVD) of mod Stop Spammer and the only responsible for that mod just now (until M-DVD has again free time and decide to come back) and I have also another mod (httpBL) that needs to look for data inside an external database all the time, so I understand what you say.  ;)

Of course what you say would be a solution and it can be done. The problem is sometimes you get problems if you need to rely on an external DB too much. Sometimes the external DB is not available. Sometimes there are connexion problems, etc.

You just need to read the support threads for both mods (Stop Spammer and httpBL) and you will see how many times I had to deal with problems somebody has because there was a problem with the connexion with the external DB.

I have been always trying to change both mods to make them use (when possible) internal data instead of relying all the time on external data.

For example with mod httpBL it has been more or less easy to do it. In my last version 2.4 every time the mod checks the external DB it adds the data to the cache (if it's activated) and/or the session, so next time the same IP comes back the mod don't need to check the external DB, but the internal cache and/or session (if they haven't expired).

With mod Stop Spammer it's a little more difficult, but I have found also another solution. Just installing as well the mod Anti-Spam Verification Questions. (For people using SMF 1.x). (It is already built inside SMF 2.0 so people using 2.0 just need to add some questions so that's working properly).

These Verification Questions will stop 99% of the spammer robots before they need to be checked by mod Stop Spammer, so it reduces drastically the amount of external connexions needed.

===============

In your case you will need to find also a way to reduce also the amount of external connexions needed.

For example an idea will be to create 2 different DBs:

An external DB hosted where ever you want and an internal one inside every forum DB (just a new table in the DB I mean). (Or just a text file that can be included every time it's needed).

The mod will use always the internal data but you can put a button inside the mod's config page to check the external DB and update the data if needed.

I think something like that is what you were talking about before in one of your posts.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

MoreBloodWine

All very good info, I'll give it a more detailed read later as I sort of just skimmed it but as far as issues go with the DB, I don't see it as being to bad because it would only be a connection issues if new data was available for download as all data would be stored on the users site after being DL from the DB I would set up if I took this route.

So it might work soemthing like this...

1. Initial install
2. Users views whos online
3. Page loads and connects to me, since this is an initial install it downloads all available data (spiders, users etc.)
4. After data has been DL it is then stored locally on the users site
5. User closes page
6. 2 hrs later user reloads whos online
7. Whos online checks DB against stored data and finds one new spider
8. New spider gets DL and stored locally with the rest of the data

So everything would always be stored locally on the users site so aside from connection issues during the inital install everything should run pretty smoothly if this route was taken. Also, the server I use for my sites etc has pretty decent uptimes and I could easily add a mirror backup service so for the most part I could easily guarantee a 99% uptime leaving 1% for the unexpected.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


snoopy_virtual

I see.

That's a lot better plan than the one I was suggesting.

Anyway, to avoid the connexion problems I was talking about the only things you will need to add are:


  • When installing the mod it should initialize the locally stored data with all the spiders etc known at the moment you publish your mod
  • Every time the whosonline page try to connect to the external DB, if there is a connexion problem it should assume there is no changes in the external DB

This way you will have something like this:

1. Initial install. All known data at the moment the mod was published is stored locally on the users site
2. Users views whos online
3. Page loads and try to connects to you. Since this is an initial install (maybe a few months after mod was published) maybe there are a lot of new data
4. There is a problem with the connexion. So the page assumes there is no new data and just uses local data
5. User closes page
6. 2 hrs later user reloads whos online
7. Whos online checks external DB against stored data but this time there is no problem with the connexion, so it finds one new spider (or a lot of new data)
8. New data gets DL and stored locally with the rest of the data

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

snoopy_virtual

Checking again the list of spiders I found another one missing:


array (
'agent' => 'bingbot/2.0',
'spidername' => 'MSN Spider',
'spider' => true,
),

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Advertisement: