{"id":257885,"date":"2015-05-25T15:24:02","date_gmt":"2015-05-25T11:24:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=257885"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=257885","title":{"rendered":"\u0413\u0435\u043e\u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433 \u043f\u043e \u0433\u043e\u0440\u043e\u0434\u0430\u043c (\u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c, \u0441\u0442\u0440\u0430\u043d\u0430\u043c) \u0434\u043b\u044f WordPress"},"content":{"rendered":"<br \/>\n<h2>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043e\u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433 \u043f\u043e \u0433\u043e\u0440\u043e\u0434\u0430\u043c \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 wordpress. \u041f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0433\u0435\u043e\u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433-\u043f\u043b\u0430\u0433\u0438\u043d\u044b (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043b\u0430\u0442\u043d\u044b\u0435), \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0441 \u0433\u043e\u0440\u043e\u0434\u0430\u043c\u0438 (\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u044b). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 github, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0451.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u0431\u0430\u0437\u044b<\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0431\u0430\u0437\u0443. \u0418 \u044d\u0442\u043e, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u0434\u0430\u0436\u0435 \u0434\u0435\u043b\u0430\u043b CURL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e ip, \u0438 \u043f\u0430\u0440\u0441\u0438\u043b \u0438\u0445. \u041d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043d\u0435 \u0442\u043e\u0447\u043d\u044b, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043e\u0434\u0438\u043d \u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0438\u0439 IP \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u043e \u043a\u0430\u043a \u041c\u043e\u0441\u043a\u0432\u0443, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0420\u043e\u0441\u0441\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0420\u043e\u0441\u0441\u0438\u0435\u0439, \u043d\u043e \u0438 \u0441 \u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c\u044e \u0438 \u0423\u043a\u0440\u0430\u0438\u043d\u043e\u0439. \u041f\u0435\u0440\u0435\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 <strike>\u043a\u0443\u0447\u0443<\/strike> \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0437, \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Sypex Geo. \u0423 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e-\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0430\u0437. \u0423\u0441\u043b\u043e\u0432\u043d\u043e-\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 REST API \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 xml, json \u0438 jsonp. \u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0439\u043b\u0430, \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439. \u0423\u0441\u043b\u043e\u0432\u043d\u043e-\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u0430\u044f, \u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 10 000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b<\/h2>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b, \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0443\u043c\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431 \u0443\u0441\u043b\u043e\u0432\u043d\u043e-\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0430\u0437\u044b, \u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u0437\u0430 \u0434\u0435\u043d\u044c-\u0434\u0432\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u043e\u043c \u0431\u0430\u0437\u044b. <\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0438 REST API. \u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u0433\u043e\u0440\u043e\u0434\u043e\u0432 (\u0441\u0442\u0440\u0430\u043d, \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432). \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430.<br \/>  \u0415\u0449\u0451 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4de\/385\/96f\/4de38596f97b44dba7f8cdd5104e818e.png\"\/><br \/>  <i>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/i><\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441 WordPress \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0440\u0435\u0434\u043a\u043e (\u043a\u0430\u043a \u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 CMS) \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f, \u043d\u0430\u0447\u0430\u043b \u0447\u0438\u0442\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0445 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435. \u0418\u0434\u0435\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0437\u044f\u043b \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0433\u0435\u043e-\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0415\u0449\u0451 \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e. \u0420\u0435\u0448\u0438\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439.<\/p>\n<p>  \u0412\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0448\u0443 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u041f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u0434\u0432\u0435 \u043e\u043f\u0446\u0438\u0438: \u0442\u0438\u043f \u0431\u0434 \u0438 \u044f\u0437\u044b\u043a \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"php\">register_activation_hook(__FILE__, 'wp_sypexgeo_activation'); function wp_sypexgeo_activation() { \tupdate_option('sgeo_language', 'en'); \tupdate_option('sgeo_dbase', 'loc'); } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 <\/p>\n<pre><code class=\"php\">    add_filter('the_content', 'geotargeting_filter'); \tadd_filter('the_content_rss', 'geotargeting_filter'); \tadd_filter('the_excerpt', 'geotargeting_filter'); \tadd_filter('the_excerpt_rss', 'geotargeting_filter'); <\/code><\/pre>\n<p> \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">geotargeting_filter<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">function geotargeting_filter($s) { \t\t\/\/parse Country \t\tpreg_match_all(&quot;#\\[&quot; . GEOTARGETING_COUNTY . &quot;\\s*(in|out)=([^\\]]+)\\](.*?)\\[\/&quot; . GEOTARGETING_COUNTY . &quot;\\]#isu&quot;, $s, $country); \t\t\/\/parse Country \t\tpreg_match_all(&quot;#\\[&quot; . GEOTARGETING_REGION . &quot;\\s*(in|out)=([^\\]]+)\\](.*?)\\[\/&quot; . GEOTARGETING_REGION . &quot;\\]#isu&quot;, $s, $region); \t\t\/\/parse Country \t\tpreg_match_all(&quot;#\\[&quot; . GEOTARGETING_CITY . &quot;\\s*(in|out)=([^\\]]+)\\](.*?)\\[\/&quot; . GEOTARGETING_CITY . &quot;\\]#isu&quot;, $s, $city); \t\tif (empty($country) && empty($region) && empty($city)) { \t\t\treturn $s; \t\t} \t\t$base_type = get_option('sgeo_dbase'); \t\tif ($base_type == 'loc') { \t\t\t$ipdata = getLocInfo(); \t\t} elseif ($base_type == 'rm') { \t\t\t$ipdata = getRemInfo(); \t\t} \t\tif (!empty($country)) { \t\t\tforeach ($country[0] as $i =&gt; $raw) { \t\t\t\t$type = strtolower($country[1][$i]); \t\t\t\t$countries = strtolower(trim(str_replace(array(&quot;\\&quot;&quot;, &quot;'&quot;, &quot;\\n&quot;, &quot;\\r&quot;, &quot;\\t&quot;, &quot; &quot;), &quot;&quot;, $country[2][$i]))); \t\t\t\t$content = $country[3][$i]; \t\t\t\t$countries = explode(&quot;,&quot;, $countries); \t\t\t\t$replacement = &quot;&quot;; \t\t\t\tif ((($type == &quot;in&quot;) && in_array($ipdata['country'], $countries)) || (($type == &quot;out&quot;) && !in_array($ipdata['country'], $countries))) { \t\t\t\t\t$replacement = $content; \t\t\t\t} \t\t\t\t$s = str_replace($raw, $replacement, $s); \t\t\t} \t\t} \t\tif (!empty($region)) { \t\t\tforeach ($region[0] as $i =&gt; $raw) { \t\t\t\t$type = strtolower($region[1][$i]); \t\t\t\t$regions = strtolower(trim(str_replace(array(&quot;\\&quot;&quot;, &quot;'&quot;, &quot;\\n&quot;, &quot;\\r&quot;, &quot;\\t&quot;), &quot;&quot;, $region[2][$i]))); \t\t\t\t$content = $region[3][$i]; \t\t\t\t$regions = explode(&quot;,&quot;, $regions); \t\t\t\t$replacement = &quot;&quot;; \t\t\t\tif ((($type == &quot;in&quot;) && in_array($ipdata['region'], $regions)) || (($type == &quot;out&quot;) && !in_array($ipdata['region'], $regions))) { \t\t\t\t\t$replacement = $content; \t\t\t\t} \t\t\t\t$s = str_replace($raw, $replacement, $s); \t\t\t} \t\t} \t\tif (!empty($city)) { \t\t\tforeach ($city[0] as $i =&gt; $raw) { \t\t\t\t$type = strtolower($city[1][$i]); \t\t\t\t$cities = strtolower(trim(str_replace(array(&quot;\\&quot;&quot;, &quot;'&quot;, &quot;\\n&quot;, &quot;\\r&quot;, &quot;\\t&quot;, &quot; &quot;), &quot;&quot;, $city[2][$i]))); \t\t\t\t$content = $city[3][$i]; \t\t\t\t$cities = explode(&quot;,&quot;, $cities); \t\t\t\t$replacement = &quot;&quot;; \t\t\t\tif ((($type == &quot;in&quot;) && in_array($ipdata['city'], $cities)) || (($type == &quot;out&quot;) && !in_array($ipdata['city'], $cities))) { \t\t\t\t\t$replacement = $content; \t\t\t\t} \t\t\t\t$s = str_replace($raw, $replacement, $s); \t\t\t} \t\t} \t\treturn $s; \t}<\/code><\/pre>\n<\/div>\n<\/div>\n<p> \u0412 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0431\u0430\u0437\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0451\u0442 \u043f\u043e\u0438\u0441\u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0433\u043e\u0432 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0438 \u0441\u0432\u0435\u0440\u043a\u0430 \u0438\u0445 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 \u0442\u0435\u0433\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u043e\u043d\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f.<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  \u0414\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0442\u0440\u0430\u043d: <\/p>\n<pre><code class=\"php\">[GeoCountry in=Belarus,Russia]\u041f\u0440\u0438\u0432\u0435\u0442 Belarus,Russia![\/GeoCountry]<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432: <\/p>\n<pre><code class=\"php\">[GeoRegion in=Moscow]\u041f\u0440\u0438\u0432\u0435\u0442 Moscow Region![\/GeoRegion]<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0433\u043e\u0440\u043e\u0434\u043e\u0432: <\/p>\n<pre><code class=\"php\">[GeoCity in=\u041c\u0438\u043d\u0441\u043a,\u0411\u0440\u0435\u0441\u0442]\u041f\u0440\u0438\u0432\u0435\u0442 \u041c\u0438\u043d\u0441\u043a,\u0411\u0440\u0435\u0441\u0442![\/GeoCity]<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u044b (\u0440\u0435\u0433\u0438\u043e\u043d\u044b, \u0433\u043e\u0440\u043e\u0434\u0430) \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u00about\u00bb: <\/p>\n<pre><code class=\"php\">[GeoRegion out=Minsk,Brest]\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c, \u043a\u0440\u043e\u043c\u0435 Minsk,Brest![\/GeoRegion]<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435:<\/p>\n<p>  <i>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 WordPress. \u042d\u0442\u043e \u0432\u0430\u0448\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c. \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0435\u0451, \u0437\u0430\u0442\u0435\u043c \u043f\u0438\u0448\u0438\u0442\u0435! \u041d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b: [GeoCity in=Minsk]+375295552255[\/GeoCity][GeoCity out=Minsk]+375475552255[\/GeoCity]<\/i><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043c\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u043f\u0438\u0448\u0438\u0442\u0435. \u0422\u0430\u043a\u0436\u0435, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u0431\u0430\u0437\u0443 (\u0433\u0435\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u043b\u0438 \u0435\u0449\u0451 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c) \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0439\u0442\u0435, \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u0438. <\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043b\u0430\u0433\u0438\u043d: <a href=\"https:\/\/github.com\/akalevich\/wp-sypexgeo\">wp-sypexgeo<\/a>             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/258705\/\"> http:\/\/habrahabr.ru\/post\/258705\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h2>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043e\u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433 \u043f\u043e \u0433\u043e\u0440\u043e\u0434\u0430\u043c \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 wordpress. \u041f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0433\u0435\u043e\u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433-\u043f\u043b\u0430\u0433\u0438\u043d\u044b (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043b\u0430\u0442\u043d\u044b\u0435), \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0441 \u0433\u043e\u0440\u043e\u0434\u0430\u043c\u0438 (\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u044b). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 github, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0451.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-257885","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257885"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257885\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}