Jump to content

Transliteration During Domain Validation and Register


tatocaster

Recommended Posts

Hello,

what i'm trying to accomplish is replace some characters (აბც) with some english ones and vise versa.

I've tried 2 ways to do that - both failed.

 

First of all i tried by making a hook

add_hook("PreDomainRegister",1,"hook_transliterate");

 

Unfortunatelly inside my main function - i cannot neither get the client information neither return it.

 

function hook_transliterate($vars) {

$firstname= $vars["params"]["firstname"];

$domain = $vars["params"]["domain"];

 

return str_replace("a char","b char",$firstname");

}

 

$firstname is nothing - and of course my return is not working as well.

 

Then i tried to do a Transliteration hook , so i made a hooks.php file and placed it in /www/whmcs/hooks/transliterate.php

 

 

My code is :

 

function hook_transliterate($string) {

$string = str_replace("a","w",$string);

$string = str_replace("b","v",$string);

return $string;

}

add_hook("Transliteration",1,"hook_transliterate") ;

 

 

Unfortunatelly it seems is never triggers.

 

 

Then I tried

add_hook("DomainValidation",999,"hook_transliterate");

 

hook activates every time when domain availability checking running but, i want to transliterate this string and return to client input as different characters for ex: abc = აბც . it would be great to save in DB also like these. Any help will be appreciated.

 

Thanks

Edited by tatocaster
bolded code
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated