Jump to content

Recommended Posts

It sounds like your host may have the file_get_contents function disabled. You may want to ask them about that. But the part of the code that is failing has to do with getting the country flag. So first make sure that you have the IP database uploaded to the server. If it is, then try turning off the flag setting to get around this.

Share this post


Link to post
Share on other sites

First of all thank you very much for your prompt reply and i feel ashamed for taking me so long to reply back.

 

The date setting works fine! Found the data on database too. Cool :)

 

About the ignore list problem i mentioned, it is probably me not understanding how it works. So no worries.

 

Now here is what i find important. Here is a part of my monitor page: http://postimg.org/image/k74b9zrkx/

All of these data is from the same IP. It would be nice if there was only 1 line for this IP's data and when i click on that IP to "expand" all the data it has for this IP. I hope you understand what i mean.

Because now i get pages and pages with data of the same IP and it is not easy to find things i want.

 

Finally is it possible for "?" button to search in "ip-lookup.net" instead of  whois?

 

Thank you very much again!

Share this post


Link to post
Share on other sites

The Related checkbox was meant for expanding as you suggest. But it was added as an afterthought and to make it work would require more work than I have time for so it was never completed.

 

But the main thought that this addon began with was to monitor what was going on on the site and to be able to control it. With that in mind, notice that the time differences for the IP you show is as low as 2 seconds. That is almost certainly not a regular visitor and is most likely a search bot. Such bots should normally be excluded since they don't help your site in any way and just cause the bandwidth usage and the server load to increase.

 

There's nothing in the code to allow for switching the IP lookup site. It could be done but would require code changes. Plus, there are many such sites but some won't allow remote access without charging. I couldn't find anything on that site that says if it is allowed or not.

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

 

  • Added check for show flags back in (was removed in previous version by mistake).
  • Added an option to disable country blocking for the search engines.
  • Added code to check for intrusion attacks. The "Is Hacker" color is used to show such links.
  • Added code to check which fields are returned for the IP data to only report those present.
  • Added an option to check for unreleased changes.
  • Added an option to allow external checking for block countries - separate for both shop and admin.
  • Added a new button on the country blocking page to make changing the countries easier.
  • Added a "Ban IP" button to the fast clicks report.
  • Added additional help files per users requests.
  • Changed how the IP is obtained. Now matches what block countries uses.
  • Changed instructions for left column change.
  • Changed code in includes.modules/view_counter.php to remove some php warnings - reported by member stefan21.
  • Changed how banned IP's are checked to prevent IP 0.0.0.0 from causing a problem.
  • Changed how the block countries code works. It now uses an internal function to get the country name.
  • Changed IP Count report to show flag and mouseover IP details.
  • Changed Referrer report to show flag and mouseover IP details.
  • Fixed problem in the hacker checking code that prevented it from displaying the correct colors.
  • Fixed a number of minor coding and text mistakes.
  • Reduced redundant code, which improved the speed of the code.
  • Removed the API Key setting since it is no longer used.
  • Renamed the block countries option for admin to check countries, which is more accurate.

Share this post


Link to post
Share on other sites

The Related checkbox was meant for expanding as you suggest. But it was added as an afterthought and to make it work would require more work than I have time for so it was never completed.

 

But the main thought that this addon began with was to monitor what was going on on the site and to be able to control it. With that in mind, notice that the time differences for the IP you show is as low as 2 seconds. That is almost certainly not a regular visitor and is most likely a search bot. Such bots should normally be excluded since they don't help your site in any way and just cause the bandwidth usage and the server load to increase.

 

There's nothing in the code to allow for switching the IP lookup site. It could be done but would require code changes. Plus, there are many such sites but some won't allow remote access without charging. I couldn't find anything on that site that says if it is allowed or not.

 

Thanks for your reply again. One more thing. Almost all the IPs i get are actually bots. How do i exclude them? Because so far it is not being done automatically. 

Share this post


Link to post
Share on other sites
Hi Jack,

 

Thanks for your help,

 

I saw you did a new 1.6 version so today I update from my 1.5 installed to the new 1.6.

 


Up to now the last problem I reported has not recurred but I am having a new one.  I am trying to block countries in:

 

View Counter -> Tools -> Block Countries

 

I select any country from the left list then I do click on block countries buttons but it only closes this option screen.

When I return to the Block Countries option, It does not display anything at the right side of the screen, I understood that it should display a box on the right side showing the blocked countries.

 

Thanks a lot in advanced.


 

 

 


 

I would like to ask you some help. I am running ViewCounter 1.5 in a

Share this post


Link to post
Share on other sites

@@NUKE1989

 

Thanks for your reply again. One more thing. Almost all the IPs i get are actually bots. How do i exclude them? Because so far it is not being done automatically. 

There's nothing in the code to automatically exclude bots. You have to do that yourself. For the good bots, like google, Bing and Yahoo, you shouldn't exclude them since that will ruin your listings with them. For the bad bots, it depends on the bot. Some will obey an entry in the robots file while others won't so they have to be blocked with the .htaccess file. Yandex is one of the most difficult to block. See this thread for doing that. Others like ahrefs and amazon can be stopped by using the block by range and entering the domain name, like ahrefs.com. Search bots use many IP's so just blocking by IP will be a lot of extra work.  

Share this post


Link to post
Share on other sites

I select any country from the left list then I do click on block countries buttons but it only closes this option screen.

When I return to the Block Countries option, It does not display anything at the right side of the screen, I understood that it should display a box on the right side showing the blocked countries.

 First, be sure you have the option to block countries enabled in the settings. Then, in Tools->Block Countries, you have to select the countries you want to block in the left list and save those. The list on the right is only for showing how many block, per country, have been done. If none have occurred, the list will be empty. This is explained in the text on that page.

 

The above applies to 1.6. It is unclear to me which version you are using. The country blocking code is completely different between the two and I don't recommend using that option when 1.5 is being used.

Share this post


Link to post
Share on other sites

Hi, just updated to version 1.6 on a test server and receive the following when selecting reports. hacker attemps

 

 Warning: Illegal string offset 'file_name' in C:\xampp\htdocs\shopbs\admin\includes\functions\view_counter.php on line 97

 

Jack, any advise please?

 

mike

Edited by Mikepo

osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites

@@Mikepo That's due to an undeclared array member. The following should work, though it may not be the final fix. I'll wait and see how you make out. :)  In that file, find:

    foreach ($cmpArry as $test) {
        if (preg_match('/' . $test . '/', $view['file_name']) || preg_match('/' . $test . '/', $view['arg'])) {
            return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
        }
    }

and change it to

    foreach ($cmpArry as $test) {
        if (isset($view['file_name'])) {
            if (preg_match('/' . $test . '/', $view['file_name'])) {
                return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
            }
        }
        if (isset($view['arg'])) {
            if (preg_match('/' . $test . '/', $view['arg'])) {
                return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
            }
        }
    }

Share this post


Link to post
Share on other sites

@@Jack_mcs,  that's done the trick.  I'll carry on and install in the live shop.  I'll let you know


osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites

In the later versions of php, more warnings are shown than in earlier versions. For the most part they can be ignored. The ones you mention are just saying a name is being referenced without first being declared. That can be a problem if the code is not working but in this case they can be ignored since the code works. They can be fixed but it is time consuming doing that and I can't do that currently, especially since they are not showing for me either. So I suggest you add the following after the  last require statement at the top of the View Counter files:

  ini_set('display_errors','0'); 

For example, in the admin/view_counter_reports.php file, the last require statement is

require(DIR_FS_CATALOG . 'view_counter/IP2Location.php');

so change that to

require(DIR_FS_CATALOG . 'view_counter/IP2Location.php');
ini_set('display_errors','0'); 

Share this post


Link to post
Share on other sites

@@Jack_mcs, Thanks for the response.  The php versions between test and live servers must be different as you suggest. I'll add what you suggest.

 

btw, this is a great addon and does precisely what it say on the tin. 

 

Thanks again

Mike


osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites
Hello Jack,

 

I have 1.5 version updated to 1.6 version on Osc 2.3.1.

 

BLOCK COUNTRIES tool seems to be working fine now. Please help me with this question.

 

A friend from blocked country tried to connect and he received the following message:

 

You requested MY URL 403 Forbidden was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." 

 

Is there some way to change this message to the connections blocked by Viewcounter in orden to give to blocked customer a more helping message?, for example:

 

Sorry, we believe that you are trying to access this server from outside Chile, which is not permitted.  If you believe we have made a mistake, we apologize and ask that you please email us to help@@Domain.cl

 

Thanks in advanced.

Share this post


Link to post
Share on other sites

@@elara Those messages come from apache but you can override them by providing your own. There are several ways to do this but I recommend the custom error addon since it provides an easy way to make the errors part of your site. However, I don't think that will work in this case because in order to show the message, the person has to have access to the site. If they are given access for the error messages, then they are not really blocked.

 

In the includes/modules/view_counter_country_block.php file, you can try changing the line that reads exit; to exit('Show this message'); I'm not sure that will work, for the reason already given, but it is worth a quick try..

Share this post


Link to post
Share on other sites

 

@@Mikepo That's due to an undeclared array member. The following should work, though it may not be the final fix. I'll wait and see how you make out. :)  In that file, find:

    foreach ($cmpArry as $test) {
        if (preg_match('/' . $test . '/', $view['file_name']) || preg_match('/' . $test . '/', $view['arg'])) {
            return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
        }
    }

and change it to

    foreach ($cmpArry as $test) {
        if (isset($view['file_name'])) {
            if (preg_match('/' . $test . '/', $view['file_name'])) {
                return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
            }
        }
        if (isset($view['arg'])) {
            if (preg_match('/' . $test . '/', $view['arg'])) {
                return ' style="background-color:' . $colors[COLOR_IS_HACKER] . '" '; 
            }
        }
    }

I had the same problem. This did the trick. Thank you for the code to correct this error message.

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Hi,

 

First let me say thank you for providing us with this contribution. It's a great tool.

 

I currently have Version 2.3.4 BS and I have just installed the View Counter V 1.6

 

I had a few errors when I installed this contribution which were listed here already. I was able to fix them with no problem thanks to your additional help.

 

I have one final error message that is not listed here yet and I hope that you can help me if possible.

 

 

Warning: unpack(): Type V: not enough input, need 4, have 0 in   public_html/view_counter/IP2Location.php on line 376

 

 

Can you please help me ?

 

Thank you in advance.

Share this post


Link to post
Share on other sites

@@sunshynecraftsbeads I can't do anything about that error since it uses the encrypted database. However, I found this mention of that problem and the cause was that the database file had not been unzipped.  So you may want to verify you have done that and renamed the database as explained in the install file. If that is not the cause, you can try downloading another, different, database to see if that helps.

Share this post


Link to post
Share on other sites

@@sunshynecraftsbeads I can't do anything about that error since it uses the encrypted database. However, I found this mention of that problem and the cause was that the database file had not been unzipped.  So you may want to verify you have done that and renamed the database as explained in the install file. If that is not the cause, you can try downloading another, different, database to see if that helps.

 

 

 

 

I double checked everything I did & everything was done as per your install instructions. They were straight forward instructions and easy to follow. Thank you for that.

 

Originally I downloaded the IP2LOCATION -  DB3_LITE. So I tried downloading the IP2LOCATION - DB5_LITE this time and everything is working fine now. It must have been the DB3 Database that was the problem. For me anyways.

 

Thanks again for taking the time to help me.

Share this post


Link to post
Share on other sites

@@Jack_mcs

Hi Jack

 

Love this.

I nearly got 100% correct, just one question.

When I go to admin>View Count> Reports>IP Counts, then hover over the IP address; country code, country name,region name and  city name, are all blank, so I must have uploded something to the incorrect place. I suspect it may have something to do with

" rename it to view_counterDB.BIN and upload it into the view_counter directory in the root of the shop.I really was unsure where to load it, but currently have it under IP2Location.php as view_counterDB.BIN The code for my downlaod from IP2Loacation web site was DB3LITEBIN  (at the moment the shop is in a sub directory)

Any thoughts, or is this what I should expect.

 

Many thanks

Grandp

Share this post


Link to post
Share on other sites

@@grandpa Does the monitor section work correctly? If not, then the only things I can think of that may cause this is that you didn't enable View Counter in the settings or there is something wrong with the database file.  For the latter, to be clear, you have to unzip it from the download from that site, before renaming and uploading it. Also, It should be uploaded into a directory named view_counter. That is in the new files so it should have been created when uploading them but it doesn't hurt to check.

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Many thanks for your reply.

I uninstalled the DB then reinstalled. The only change I made was to turn on the View counter in config to True. Then went to View Counter Monitor and this is what I found

Fatal error: Uncaught exception 'Exception' with message 'invalid data, remaining: AQ6tegHKmnuATpaSTsOgUcKd_CfDtY64YUTFUKzaHpIAUP9lTgIqZskbwf_6DFnVhUCTc0rztb6pdYtOaNjF2cIQRkTMREmx8F2DfPnswsizvf4Zty6qM0sUIZAauvVmFjJLC1s6cMsP9c2OKLBvCFHskcjoK3SQ4hcGDzNYejm9TW_Lg9b9k3ZCE6n-we6Fdq3mA6uc723Pj8hqytbkqgM1Sp34wOtjTGhPcytM1CGALz8WDZwYsBsNd0raxZGanQBKwR02biZrmOJZplyu__D-M5oSq5CtCZMdIomFWwwLi32wLXSnCRYb6ZbpvUDUI_Gn7RTfBYJT2EGQUVFsjmp3In9a8Gimexi1fvGOgCvxR1HYRgydLs64ufohYFEdMXWXFq9rz2hVirKoVvMAi2APMcnr1HusCNuzR0mi7VE8yr-scqT6vGxf9KGmMF1zBnBe_pUDnJXVTL-u7xdYq6lC2mWJLSN85d0h5BpaaKi3Pet4cz9GOuozCrJA6MLd4o4sD2cg9_6_ya9Ss-IVdFVJWO2Ye27zZ1MOX1OQ1xA11HR-Y6qFgFNtXrsPvyHVrk4JjlTFENJoAAuuL4wmNDbEPBpNThrUZd73IMrtRKEOtuiOqsaHN-TeU3BPQehT9zpE_DMNT4UESvvq-KiwA0kKI_2PERlQEioPkFUhYnV_mGQ9o8CsKDOnjjRwo_LDIMsA0xt25vf1aTh9Blkv4nqEk6M10kAfaRC1x1-UEVh9U2kXL11HV3hv26mqxpawXAm0ZTrSNrPYVAneYC2A58zDnIZjhCTJbMiOFSxt1V6GEmbUZiwxJB0JiQnFH63scgxGf491BRCHuSeArfJV-RAOXZ8cGoY7uDWURTxHGPkjt9_ulzcADilDcDPBxLC6' in /home/XXXX/public_html/BS234FINAL/admin/inc in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 1713

Cheers

John

Edited by grandpaj

Share this post


Link to post
Share on other sites

I don't know why that is failing. But in looking at the code, there may be a mistake that is preventing the proper error from showing. Please fine this line in the admin/includes/functions/view_counter.php file

if (tep_not_null($whois_data)) 

and change it to

if (tep_not_null($data)) { 

Try it again after making that change to see if the error changes.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

@@Jack_mcs

Hi Jack

 

Just downloaded a dif version of the DB form IP2Location, and problem appears to be solved.

 

Many thanks

 

Kind regards

Grandp

Edited by grandpaj

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×