{"id":25102,"date":"2021-09-10T01:13:11","date_gmt":"2021-09-09T18:13:11","guid":{"rendered":"https:\/\/doc.bnix.vn\/?p=25102"},"modified":"2022-08-14T07:05:16","modified_gmt":"2022-08-14T00:05:16","slug":"hook-cat-dau-thong-tin-user-khi-dang-ky-ten-mien-quoc-te-tren-whmcs","status":"publish","type":"post","link":"https:\/\/doc.bnix.vn\/hook-cat-dau-thong-tin-user-khi-dang-ky-ten-mien-quoc-te-tren-whmcs\/","title":{"rendered":"Hook c\u1eaft d\u1ea5u th\u00f4ng tin user khi \u0111\u0103ng k\u00fd t\u00ean mi\u1ec1n qu\u1ed1c t\u1ebf tr\u00ean WHMCS"},"content":{"rendered":"\n\n
Hi\u1ec7n t\u1ea1i, \u0111\u1ec3 \u0111\u0103ng k\u00fd t\u00ean mi\u1ec1n qu\u1ed1c t\u1ebf, ch\u00fang ta s\u1ebd li\u00ean k\u1ebft v\u1edbi 1 ho\u1eb7c v\u00e0i nh\u00e0 cung c\u1ea5p t\u00ean mi\u1ec1n (registrar) nh\u01b0 namesilo, namecheap, resellerclub,…<\/p>\n
Nh\u01b0ng khi \u0111\u0103ng k\u00fd, th\u00f4ng tin kh\u00e1ch h\u00e0ng c\u00f3 d\u1ea5u s\u1ebd b\u1ecb th\u00f4ng b\u00e1o l\u1ed7i kh\u00f4ng \u0111\u0103ng k\u00fd \u0111\u01b0\u1ee3c.<\/p>\n
H\u00f4m nay m\u00ecnh xin chia s\u1ebd 1 \u0111o\u1ea1n code, nh\u00fang v\u00e0o hook c\u1ee7a whmcs \u0111\u1ec3 c\u1eaft d\u1ea5u profile kh\u00e1ch h\u00e0ng khi \u0111\u0103ng k\u00fd t\u00ean mi\u1ec1n qu\u1ed1c t\u1ebf.<\/p>\n
Ch\u00fang ta v\u00e0o th\u01b0 m\u1ee5c includes -> hooks, t\u1ea1o file t\u00ean l\u00e0 fix_utf8_name.php<\/p>\n
Sau \u0111\u00f3 edit file v\u00e0 th\u00eam \u0111o\u1ea1n code sau v\u00e0o r\u1ed3i save l\u1ea1i<\/p>\n
<?php \r\n function hook_transliterate($string) {\r\n $string = preg_replace(\"\/(\u00e0|\u00e1|\u1ea1|\u1ea3|\u00e3|\u00e2|\u1ea7|\u1ea5|\u1ead|\u1ea9|\u1eab|\u0103|\u1eb1|\u1eaf|\u1eb7|\u1eb3|\u1eb5)\/\", 'a', $string);\r\n $string = preg_replace(\"\/(\u00e8|\u00e9|\u1eb9|\u1ebb|\u1ebd|\u00ea|\u1ec1|\u1ebf|\u1ec7|\u1ec3|\u1ec5)\/\", 'e', $string);\r\n $string = preg_replace(\"\/(\u00ec|\u00ed|\u1ecb|\u1ec9|\u0129)\/\", 'i', $string);\r\n $string = preg_replace(\"\/(\u00f2|\u00f3|\u1ecd|\u1ecf|\u00f5|\u00f4|\u1ed3|\u1ed1|\u1ed9|\u1ed5|\u1ed7|\u01a1|\u1edd|\u1edb|\u1ee3|\u1edf|\u1ee1)\/\", 'o', $string);\r\n $string = preg_replace(\"\/(\u00f9|\u00fa|\u1ee5|\u1ee7|\u0169|\u01b0|\u1eeb|\u1ee9|\u1ef1|\u1eed|\u1eef)\/\", 'u', $string);\r\n $string = preg_replace(\"\/(\u1ef3|\u00fd|\u1ef5|\u1ef7|\u1ef9)\/\", 'y', $string);\r\n $string = preg_replace(\"\/(\u0111)\/\", 'd', $string);\r\n $string = preg_replace(\"\/(\u00c0|\u00c1|\u1ea0|\u1ea2|\u00c3|\u00c2|\u1ea6|\u1ea4|\u1eac|\u1ea8|\u1eaa|\u0102|\u1eb0|\u1eae|\u1eb6|\u1eb2|\u1eb4)\/\", 'A', $string);\r\n $string = preg_replace(\"\/(\u00c8|\u00c9|\u1eb8|\u1eba|\u1ebc|\u00ca|\u1ec0|\u1ebe|\u1ec6|\u1ec2|\u1ec4)\/\", 'E', $string);\r\n $string = preg_replace(\"\/(\u00cc|\u00cd|\u1eca|\u1ec8|\u0128)\/\", 'I', $string);\r\n $string = preg_replace(\"\/(\u00d2|\u00d3|\u1ecc|\u1ece|\u00d5|\u00d4|\u1ed2|\u1ed0|\u1ed8|\u1ed4|\u1ed6|\u01a0|\u1edc|\u1eda|\u1ee2|\u1ede|\u1ee0)\/\", 'O', $string);\r\n $string = preg_replace(\"\/(\u00d9|\u00da|\u1ee4|\u1ee6|\u0168|\u01af|\u1eea|\u1ee8|\u1ef0|\u1eec|\u1eee)\/\", 'U', $string);\r\n $string = preg_replace(\"\/(\u1ef2|\u00dd|\u1ef4|\u1ef6|\u1ef8)\/\", 'Y', $string);\r\n $string = preg_replace(\"\/(\u0110)\/\", 'D', $string);\r\n return $string;\r\n}\r\n?><\/pre>\nCh\u00fac c\u00e1c b\u1ea1n kinh doanh th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"
Hi\u1ec7n t\u1ea1i, \u0111\u1ec3 \u0111\u0103ng k\u00fd t\u00ean mi\u1ec1n qu\u1ed1c t\u1ebf, ch\u00fang ta s\u1ebd li\u00ean k\u1ebft v\u1edbi…<\/p>\n","protected":false},"author":3,"featured_media":25103,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[1],"tags":[73],"class_list":["post-25102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cai-dat-vps","tag-whmcs"],"_links":{"self":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts\/25102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/comments?post=25102"}],"version-history":[{"count":0,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts\/25102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/media\/25103"}],"wp:attachment":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/media?parent=25102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/categories?post=25102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/tags?post=25102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}