Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TranslatedTitle($Title) {
- ConnectWithMySQLDatabase();
- $v = mysql_query("SELECT * FROM `ProductTranslations` WHERE `Type`=0 ORDER by id ASC");
- while($vrowis = mysql_fetch_array($v)){
- $English[] = $vrowis['English'];
- $Bulgarian[] = $vrowis['Bulgarian'];
- }
- foreach($English as $word){
- $pos = strpos($Title, $word);
- if ($pos !== false) {
- //english word found
- $Title = "$word " . str_replace($English, '', $Title);
- break;
- }
- }
- $TranslatedTitle = str_replace($English, $Bulgarian, $Title);
- return $TranslatedTitle;
- }
- function TranslatedSize($Title) {
- ConnectWithMySQLDatabase();
- $v = mysql_query("SELECT * FROM `ProductTranslations` WHERE `Type`=1 ORDER by id ASC");
- while($vrowis = mysql_fetch_array($v)){
- $English[] = $vrowis['English'];
- $Bulgarian[] = $vrowis['Bulgarian'];
- }
- foreach($English as $word){
- $pos = strpos($Title, $word);
- if ($pos !== false) {
- //english word found
- $Title = "$word " . str_replace($English, '', $Title);
- break;
- }
- }
- $TranslatedTitle = str_replace($English, $Bulgarian, $Title);
- return $TranslatedTitle;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement