function cache_delete($key)
{
    $memcache = cache_memcache();
    if (is_error($memcache)) {
        return $memcache;
    }
    return $memcache->delete(cache_prefix($key));
}
    if (empty($bday[2])) {
        $bday[2] = '00';
    }
    $year = gmdate('Y');
    $maxy = $year - 6;
    $miny = $year - 100;
    $mymodules->load('editprofile_profile_top');
    echo $tpl->parse("editprofile/profile");
} elseif ($_GET['action'] == "mylast") {
    $breadcrumb->Add($lang->phrase('editprofile_mylast'));
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    $cache = array();
    $result = $db->query("SELECT t.last, t.posts, t.id, t.board, r.topic, r.date, r.name, t.prefix, r.id AS pid FROM {$db->pre}replies AS r LEFT JOIN {$db->pre}topics AS t ON t.id = r.topic_id WHERE r.name = '{$my->id}' GROUP BY r.topic_id ORDER BY r.date DESC LIMIT 0, " . $config['mylastzahl'], __LINE__, __FILE__);
    $anz = $db->num_rows($result);
    $prefix = cache_prefix();
    while ($row = $db->fetch_assoc($result)) {
        $row['topic'] = $gpc->prepare($row['topic']);
        $row['name'] = $gpc->prepare($row['name']);
        if (isset($my->mark['t'][$row['id']]) && $my->mark['t'][$row['id']] > $row['last'] || $row['last'] < $my->clv) {
            $row['firstnew'] = 0;
            $row['alt'] = $lang->phrase('forum_icon_old');
            $row['src'] = $tpl->img('dir_open');
        } else {
            $row['firstnew'] = 1;
            $row['alt'] = $lang->phrase('forum_icon_new');
            $row['src'] = $tpl->img('dir_open2');
        }
        if (isset($prefix[$row['board']][$row['prefix']]) && $row['prefix'] > 0) {
            $row['pre'] = '[' . $prefix[$row['board']][$row['prefix']] . ']';
        } else {
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
$result = $db->query('
SELECT r.topic, r.board, r.name, r.comment, r.topic_id, r.dosmileys, r.dowords, t.posts, r.topic_id, r.date, t.prefix, r.id, r.edit, t.vquestion, r.tstart, t.status
FROM ' . $db->pre . 'replies AS r LEFT JOIN ' . $db->pre . 'topics AS t ON r.topic_id = t.id WHERE r.id = "' . $_GET['id'] . '" LIMIT 1', __LINE__, __FILE__);
if ($db->num_rows($result) != 1) {
    error(array($lang->phrase('query_string_error')));
}
$info = $gpc->prepare($db->fetch_assoc($result));
$my->p = $slog->Permissions($info['board']);
$my->mp = $slog->ModPermissions($info['board']);
$fc = cache_cat_bid();
$last = $fc[$info['board']];
forum_opt($last['opt'], $last['optvalue'], $last['id']);
$prefix = cache_prefix($info['board']);
$pre = '';
if ($info['prefix'] > 0) {
    if (isset($prefix[$info['prefix']])) {
        $pre = $prefix[$info['prefix']];
        $pre = $lang->phrase('showtopic_prefix_title');
    }
}
get_headboards($fc, $last);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($pre . $info['topic'], 'showtopic.php?id=' . $info['topic_id'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('edit'));
echo $tpl->parse("header");
if ($info['status'] != 0) {
    error($lang->phrase('topic_closed'), 'showtopic.php?action=jumpto&id=' . $info['topic_id'] . '&topic_id=' . $info['id']);
}
<?php

global $slog;
global $gpc;
$result = $db->query("\nSELECT r.dowords, r.dosmileys, t.posts, t.prefix, t.status, t.sticky, t.id, t.board, t.topic, r.comment, r.date, IF(r.email = '', u.name, r.name) AS name \nFROM {$db->pre}topics AS t LEFT JOIN {$db->pre}replies AS r ON t.id = r.topic_id LEFT JOIN {$db->pre}user AS u ON r.name=u.id \nWHERE t.mark = 'n' AND t.status != 2 " . $slog->sqlinboards('r.board') . " AND r.tstart = '1' \nORDER BY r.date DESC\nLIMIT " . $ini['params']['num'], __LINE__, __FILE__);
while ($row = $gpc->prepare($db->fetch_assoc($result))) {
    $row['pre'] = '';
    if ($row['prefix'] > 0) {
        $prefix = cache_prefix($row['board']);
        if (isset($prefix[$row['prefix']])) {
            $row['pre'] = $prefix[$row['prefix']];
            $lang->assign('pre', $row['pre']);
            $row['pre'] = $lang->phrase('showtopic_prefix_title');
        }
    }
    $bbcode->setSmileys($row['dosmileys']);
    if ($config['wordstatus'] == 0) {
        $row['dowords'] = 0;
    }
    $bbcode->setReplace($row['dowords']);
    $row['comment'] = $bbcode->parse($row['comment']);
    $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
    if (strlen($row['comment']) > $ini['params']['len'] && strpos($row['comment'], '. ', $ini['params']['len']) !== FALSE) {
        $row['comment'] = substr($row['comment'], 0, strpos($row['comment'], '. ', $ini['params']['len'])) . '.';
    } else {
        $complete = 1;
    }
    $row['posts'] = numbers($row['posts']);
    $tpl->globalvars(compact("row", "complete"));
    $lang->assign('posts', $row['posts']);
    echo $tpl->parse($dir . "news");
        $db->query("UPDATE {$db->pre}cat SET topics = topics+1, last_topic = '{$tredirect}' WHERE id = '{$board}'");
        $scache = new scache('cat_bid');
        $scache->deletedata();
        if ($_POST['opt_2'] == '1') {
            ok($lang->phrase('new_thread_vote_success'), "newtopic.php?action=startvote&amp;id={$board}&amp;topic_id={$tredirect}&amp;temp={$_POST['temp']}");
        } else {
            ok($lang->phrase('data_success'), "showtopic.php?id={$tredirect}");
        }
    }
} else {
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    $bbcode = initBBCodes();
    $inner['smileys'] = $bbcode->getsmileyhtml($config['smileysperrow']);
    $inner['bbhtml'] = $bbcode->getbbhtml();
    $prefix = cache_prefix($board);
    if (strlen($_GET['fid']) == 32) {
        $data = $gpc->prepare(import_error_data($_GET['fid']));
        $info = array($data['topic']);
        if ($_GET['action'] == 'preview') {
            $bbcode->setSmileys($data['dosmileys']);
            if ($config['wordstatus'] == 0) {
                $dowords = 0;
            } else {
                $dowords = $data['dowords'];
            }
            $bbcode->setReplace($dowords);
            $data['formatted_comment'] = $bbcode->parse($data['comment']);
            $data['formatted_prefix'] = '';
            if (isset($prefix[$data['prefix']])) {
                $data['formatted_prefix'] = $prefix[$data['prefix']];