Ignore:
Timestamp:
Jan 20, 2014, 3:37:44 PM (11 years ago)
Author:
maron
Message:
  • Fixed: Bad parse text from google translator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r754 r758  
    144144
    145145
    146 function GetTranslateGoogle($text) {
     146function GetTranslateGoogle($text,$withouttitle = false) {
    147147  global $System;
    148148//  $text = 'Balthule\'s letter is dire. This Cult of the Dark Strand is a thorn in my side that must be removed. I have been dealing with some of the Dark Strand scum northeast of here at Ordil\'Aran. One of their number possesses a soul gem that I believe holds the secret to the cult\'s power.$b$bBring it to me, and I will be able to decipher the secrets held within.';
     
    167167  $data = substr($data, strpos($data,'>')+1);
    168168  $data = substr($data, 0, strpos($data,'</div>'));
    169   while (strpos($data,'>') !== false and strpos($data,'<') !== false)
     169
     170  if ($withouttitle)
     171  while ((strpos($data,'>') !== false and strpos($data,'<') !== false) and (strpos($data,'>') > strpos($data,'<')))
    170172  {
    171173    $partbefore = substr($data, 0, strpos($data,'<'));
Note: See TracChangeset for help on using the changeset viewer.