Osclass Support Forums

Osclass theme support => Epsilon Osclass Theme => Topic started by: Vlad7 on May 24, 2022, 06:12:45 PM

Title: Determine my location
Post by: Vlad7 on May 24, 2022, 06:12:45 PM
Hello, why can't my location be determined. I allowed to determine the location, but it cannot determine, geolocation is also enabled on the smartphone, but the location does not determine.
Title: Re: Determine my location
Post by: MB Themes on May 24, 2022, 07:07:21 PM
No city found 200km around your location.
Or you do not have coordinates filled for your cities.
Title: Re: Determine my location
Post by: Vlad7 on May 24, 2022, 07:28:49 PM
I have all the coordinates of the cities.

An error has occurred

[24-May-2022 20:14:33 Europe/Kiev] PHP Warning:  Undefined array key "d_coord_lat" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 635
[24-May-2022 20:14:33 Europe/Kiev] PHP Warning:  Undefined array key "d_coord_long" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 636
Title: Re: Determine my location
Post by: MB Themes on May 24, 2022, 07:40:15 PM
Need to check what is on those lines.  ???
Title: Re: Determine my location
Post by: Vlad7 on May 24, 2022, 08:03:48 PM
further errors occur  :-\

[24-May-2022 20:30:17 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562
[24-May-2022 20:30:23 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562
[24-May-2022 20:36:58 Europe/Kiev] PHP Warning:  Undefined array key "HTTP_USER_AGENT" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 1004
[24-May-2022 20:36:58 Europe/Kiev] PHP Warning:  Undefined array key "HTTP_USER_AGENT" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 1005
[24-May-2022 20:36:58 Europe/Kiev] PHP Warning:  Undefined array key "HTTP_USER_AGENT" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 1006
[24-May-2022 20:36:58 Europe/Kiev] PHP Warning:  Undefined array key "HTTP_USER_AGENT" in /home2/ukagroco/public_html/oc-content/themes/epsilon/functions.php on line 1007
Title: Re: Determine my location
Post by: MB Themes on May 25, 2022, 10:01:55 AM
@Vlad7
Thank you, all issues will be fixed in 1.0.7

These 2 are most probably related to mail server.
Code: [Select]
[24-May-2022 20:30:17 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562
[24-May-2022 20:30:23 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562
Title: Re: Determine my location
Post by: Vlad7 on May 25, 2022, 01:32:19 PM
@Vlad7
Thank you, all issues will be fixed in 1.0.7

These 2 are most probably related to mail server.
Code: [Select]
[24-May-2022 20:30:17 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562
[24-May-2022 20:30:23 Europe/Kiev] PHP Warning:  <strong>SMTP Error: Could not authenticate.</strong><br />
 in /home2/ukagroco/public_html/oc-includes/osclass/utils.php on line 562


Yes you are right.  There were problems with mail
Title: Re: Determine my location
Post by: Vlad7 on May 27, 2022, 09:11:08 AM
I have not been able to find the reason why I do not determine my location. Has anyone encountered such a problem?
Title: Re: Determine my location
Post by: Vlad7 on June 05, 2022, 09:07:39 PM
I updated the theme to 1.0.7 and still the location is not detected automatically! What could be the reason for such a problem? I checked on your demo site, it works for you. I did a fresh installation on ocslas8.0.2+epsilon1.0.7 hosting and it doesn't work for me!
Title: Re: Determine my location
Post by: MB Themes on June 06, 2022, 12:10:04 PM
@Vlad7
What is your URL and what exactly is now problem? I remember we've fixed several issues reported. After update cleaning of cookies is needed.
Problem I remember was that in some actions, coordinates were not transfered into cookies.
Title: Re: Determine my location
Post by: Vlad7 on June 06, 2022, 07:43:18 PM
Look please https://ukagro.com.ua/
Title: Re: Determine my location
Post by: MB Themes on June 07, 2022, 03:25:10 PM
@Vlad7
You are getting error on ajax request.
Try to enable error logging and check what is there:
https://ukagro.com.ua/index.php?ajaxRequest=1&ajaxFindCity=1&latitude=48.971678&longitude=21.7104383
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 03:32:06 PM
@Vlad7
You are getting error on ajax request.
Try to enable error logging and check what is there:
https://ukagro.com.ua/index.php?ajaxRequest=1&ajaxFindCity=1&latitude=48.971678&longitude=21.7104383

Do you mean errors in the error.log file?
Title: Re: Determine my location
Post by: MB Themes on June 07, 2022, 03:56:57 PM
Yes, you have error 500 there, but it is not visible what cause it.
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 04:20:36 PM
The file contains errors from two lags. Maybe I need to contact the technical support of my hosting?
Title: Re: Determine my location
Post by: MB Themes on June 07, 2022, 04:24:27 PM
Well you must enable error log to see what error it is.
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 04:43:01 PM
cPanel has no errors for this site
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 07:37:47 PM
Journal in Osclass?
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 09:06:13 PM
Well you must enable error log to see what error it is.

Let me know am I on the right track? :(
Title: Re: Determine my location
Post by: mwindey on June 07, 2022, 10:58:30 PM
When this is in functions.php it shows location but I am not able to put it in front.<?php   

function get_client_ip()
{
    $ipaddress = '';
    if (isset($_SERVER['HTTP_CLIENT_IP'])) {
        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED'];
    } else if (isset($_SERVER['REMOTE_ADDR'])) {
        $ipaddress = $_SERVER['REMOTE_ADDR'];
    } else {
        $ipaddress = 'UNKNOWN';
    }

    return $ipaddress;
}
$PublicIP = get_client_ip();
$json     = file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     = json_decode($json, true);
$country  = $json['country'];
$region   = $json['region'];
$city     = $json['city'];
?>
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 11:03:24 PM
functions.php <?php   

function get_client_ip()
{
    $ipaddress = '';
    if (isset($_SERVER['HTTP_CLIENT_IP'])) {
        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED'];
    } else if (isset($_SERVER['REMOTE_ADDR'])) {
        $ipaddress = $_SERVER['REMOTE_ADDR'];
    } else {
        $ipaddress = 'UNKNOWN';
    }

    return $ipaddress;
}
$PublicIP = get_client_ip();
$json     = file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     = json_decode($json, true);
$country  = $json['country'];
$region   = $json['region'];
$city     = $json['city'];
?>

what is this? please explain.
Title: Re: Determine my location
Post by: mwindey on June 07, 2022, 11:26:33 PM
@Vlad7

It determines clients ip country province and state ... put it in functions.php but i am not able to get it in search results yet..
Code: [Select]
<?php   

function get_client_ip()
{
    
$ipaddress '';
    if (isset(
$_SERVER['HTTP_CLIENT_IP'])) {
        
$ipaddress $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset(
$_SERVER['HTTP_X_FORWARDED_FOR'])) {
        
$ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset(
$_SERVER['HTTP_X_FORWARDED'])) {
        
$ipaddress $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset(
$_SERVER['HTTP_FORWARDED_FOR'])) {
        
$ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset(
$_SERVER['HTTP_FORWARDED'])) {
        
$ipaddress $_SERVER['HTTP_FORWARDED'];
    } else if (isset(
$_SERVER['REMOTE_ADDR'])) {
        
$ipaddress $_SERVER['REMOTE_ADDR'];
    } else {
        
$ipaddress 'UNKNOWN';
    }

    return 
$ipaddress;
}
$PublicIP get_client_ip();
$json     file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     json_decode($jsontrue);
$country  $json['country'];
$region   $json['region'];
$city     $json['city'];
?>

Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 11:36:57 PM
No, total fall.
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 11:41:30 PM
I contacted my hosting provadur, they have no problem. Questions only to the developers of the theme template.
Title: Re: Determine my location
Post by: Vlad7 on June 07, 2022, 11:51:12 PM
Error log included, see.
Title: Re: Determine my location
Post by: MB Themes on June 08, 2022, 09:04:25 AM
@Vlad7
Queries are OK, you had error 500 that represents some PHP errors.
https://docs.osclasspoint.com/debug-php-errors
Title: Re: Determine my location
Post by: Vlad7 on June 08, 2022, 01:02:01 PM
If everything is in order, why doesn't it work for me!!!?
Title: Re: Determine my location
Post by: mwindey on June 08, 2022, 03:42:45 PM
https://www.etutorialspoint.com/index.php/24-visitors-location (https://www.etutorialspoint.com/index.php/24-visitors-location)
I am trying to implement it myself and maybe MB Themes can help us on this...
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 08:22:57 AM
I think we should stop here, step out, look on issue and start again.

...
...
...

Open this page:
https://ukagro.com.ua/index.php?ajaxRequest=1&ajaxFindCity=1&latitude=48.971678&longitude=21.7104383

If you enable error logging, instead "HTTP ERROR 500" you should see error details. We need those details.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 03:48:29 PM
hello, the magazine is on. Here is what I get
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 03:51:32 PM
@Vlad7
It's database log, not php error log.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 04:03:43 PM
I turned everything on
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 04:14:46 PM
try to disable OSC_DEBUG_LOG
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 04:17:39 PM
OK
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 04:23:23 PM
I am not sure if it works properly for you, as this link shows empty page instead of error:
https://ukagro.com.ua/index.php?ajaxRequest=1&ajaxFindCity=1&latitude=48.1467173&longitude=17.1385448
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 04:26:33 PM
I follow the link and see this
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 04:28:19 PM
Last time, its database query log visible to admin only, its is not error at all.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 04:38:49 PM
how can i enable what you want to see?
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 04:42:44 PM
@Vlad7
Contact your hosting provider.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 05:09:56 PM
The hosting provider could not determine the reason for the error 500 on the page, recommended contacting the developer  :'(
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 05:15:33 PM
Lol. Host do not know how to get error behind 500. Leave such host. Until you do not have error, cannot help at all.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 05:20:42 PM
Usually they quickly helped me, for example, on the page in the topic with banner optimization for Adsense, there was also a 500 error and they fixed it. Why they can't now I don't understand.

What file should be here?
Title: Re: Determine my location
Post by: MB Themes on June 09, 2022, 06:02:12 PM
Its no help, just tells you error. You are not asking them for resolution.
Title: Re: Determine my location
Post by: Vlad7 on June 09, 2022, 06:20:25 PM
Look, I got something here after removing the "welcome" plugin
Title: Re: Determine my location
Post by: MB Themes on June 10, 2022, 01:23:34 PM
@Vlad7
You should have this on line 15 in this file:
Code: [Select]
  function wlc_param_update( $param_name, $update_param_name, $type = NULL, $plugin_var_name = NULL ) {
maybe you use older version.
Title: Re: Determine my location
Post by: Vlad7 on June 12, 2022, 04:16:16 PM
the problem with determining my location turned out to be simple. Only in one city the coordinates were not registered.
I managed to determine this error only on version php7.4, which immediately, when searching for a location, determined only the city in which there were no registered coordinates. On the php8.0 version of the city, it simply did not determine any and there were no errors. By adding the coordinates everything worked.
Title: Re: Determine my location
Post by: MB Themes on June 13, 2022, 08:07:04 AM
@Vlad7
Did you have "null" there?
Title: Re: Determine my location
Post by: Vlad7 on June 13, 2022, 06:31:03 PM
Yes, out of a large list of cities, only one city had empty latitude and longitude lines
Title: Re: Determine my location
Post by: MB Themes on June 14, 2022, 09:50:04 AM
@Vlad7
Thanks, SQL just need a bit of coalesce, will be implemented in next update ;)
Title: Re: Determine my location
Post by: Sulaiman Jeremiah Damilola on June 14, 2022, 02:47:12 PM
Need to check what is on those lines.  ???

Good day!

For the modification of the Epsilon theme to ensure that the
location' on each published display product card at the home page,  premium box section and the search page has this format "city, region, country" just like the delta theme format.

Instead of the Epsilon theme default "city, country"

How much will it cost?

Thanks