/**
  * Parse text.
  * @param 
  * @return array
  */
 function ParseText()
 {
     global $conv;
     global $htmlRegexFull;
     $misspel = array();
     $marker = "|";
     $text = $this->text;
     if (preg_match_all('/(<.*?\\>)|(&nbsp;)/si', $this->text, $tags) != 0) {
         foreach ($tags[0] as $tag) {
             $text = str_replace($tag, GetStr($marker, strlen($tag)), $text);
         }
     }
     if (preg_match_all($this->wordEx, $text, $words, PREG_OFFSET_CAPTURE) != 0) {
         $lastWordPos = -1;
         for ($i = 0; $i < count($words[0]); $i++) {
             $wordRec = $words[0][$i];
             $pos = $conv->strpos($text, $wordRec[0], $lastWordPos + 1);
             $lastWordPos = $pos + $conv->strlen($wordRec[0]);
             if (!$this->TestWord($wordRec[0])) {
                 $misspel[] = array($pos, $conv->StrLen($wordRec[0]));
             }
         }
     }
     return $misspel;
 }
Esempio n. 2
0
function download($code)
{
    global $imgpath, $stylepath, $lang;
    $size = GetStr($code, 'size');
    $language = GetStr($code, 'language');
    $type = GetStr($code, 'type');
    $os = GetStr($code, 'os');
    $date = GetStr($code, 'date');
    $author = GetStr($code, 'author');
    $level = GetStr($code, 'level');
    $publish = GetStr($code, 'publish');
    $publishlink = GetStr($code, 'publishlink');
    $preview = GetStr($code, 'preview');
    $hits = GetStr($code, 'hits');
    $descrip = GetStr($code, 'descrip');
    $link = GetStr($code, 'link');
    if ($publishlink) {
        $publishlink = str_replace(array('[url]', '[/url]'), '', $publishlink);
        $publish = str_replace(array('[url]', '[/url]'), '', $publish);
        $publish = "<a href=\"{$publishlink}\" target=\"_blank\">{$publish}</a>";
    }
    $links = explode(',', str_replace(array('[url]', '[/url]'), '', $link));
    $link = '';
    foreach ($links as $key => $val) {
        list($name, $url) = explode('|', $val);
        if ($url) {
            $link .= "<a href=\"{$url}\">{$name}</a> ";
        } else {
            $link .= "{$name} ";
        }
    }
    $descrip = str_replace('\\"', '"', $descrip);
    $str = '<br>';
    $str .= "{$lang['size']}{$size}<br>";
    $str .= "{$lang['language']}{$language}<br>";
    $str .= "{$lang['type']}{$type}<br>";
    $str .= "{$lang['os']}{$os}<br>";
    $str .= "{$lang['date']}{$date}<br>";
    $str .= "{$lang['author']}{$author}<br>";
    $str .= "{$lang['level']}<img src=\"{$imgpath}/{$stylepath}/cms/{$level}.gif\"><br>";
    $str .= "{$lang['publish']}{$publish}<br>";
    $str .= "{$lang['preview']}{$preview}<br>";
    $str .= "{$lang['link']}{$link}<br><br>";
    $str .= "{$lang['descrip']}{$descrip}<br>";
    return $str;
}