Beispiel #1
0
function bb_highlight($match)
{
    if (in_array(strtolower($match[1]), ['php', 'css', 'mysql', 'sql', 'abap', 'diff', 'html', 'perl', 'ruby', 'vbscript', 'avrc', 'dtd', 'java', 'xml', 'cpp', 'python', 'javascript', 'js', 'json', 'sh'])) {
        return text_highlight($match[2], strtolower($match[1]));
    }
    return $match[0];
}
Beispiel #2
0
            $userinfo[$res['userid']] = $res;
        }
    }
}
//Postings auflisten
if (count($data)) {
    $i = 0;
    foreach ($data as $res) {
        ++$i;
        $userdat =& $userinfo[$res['userid']];
        //Text + Titel
        $title = replace($res['title']);
        $text = forum_replace($res['text'], $res['allowcodes'], $res['allowsmilies']);
        if ($_REQUEST['highlight']) {
            $title = text_highlight($title);
            $text = text_highlight($text);
        }
        //Benutzerkennzeichen
        $signature = $avatar = $avatar_title = '';
        if ($res['userid']) {
            if ($res['allowsig']) {
                $signature = $user->mksig($userdat);
            }
            if ($userdat['avatar']) {
                $avatar = $user->mkavatar($userdat);
                $avatar_title = $user->mkavtitle($userdat);
            }
        }
        //Rang
        $rankinfo = get_rank($userdat);
        $postdata[$i]['ID'] = $res['postid'];