Beispiel #1
0
function getuseravatar(&$template, &$params, $data, $processed = false)
{
    if ($processed) {
        return $data;
    }
    if ($data['image'] == 'n') {
        $params['excludes'][] = "_imageyes";
    } else {
        $params['excludes'][] = "_imageno";
        $data['image'] = CONS_PATH_PAGES . $_SESSION['CODE'] . "/files/users/t/image_" . $data['id_author'] . "_2";
        $ext = "";
        locateFile($data['image'], $ext);
    }
    if (isset($params['mainpost']) && $data['includehtml'] != '') {
        $file = "";
        if (is_file(CONS_PATH_PAGES . $_SESSION['CODE'] . "/template/" . $data['includehtml'])) {
            $file = CONS_PATH_PAGES . $_SESSION['CODE'] . "/template/" . $data['includehtml'];
        } else {
            if (is_file(CONS_PATH_PAGES . $_SESSION['CODE'] . "/template/" . $data['includehtml'] . ".html")) {
                $file = CONS_PATH_PAGES . $_SESSION['CODE'] . "/template/" . $data['includehtml'] . ".html";
            }
        }
        if ($file != '') {
            $tmpTP = new CKTemplate($params['core']->template);
            $tmpInner = new CKTemplate($params['core']->template);
            $tmpTP->append($data['content']);
            $tmpInner->fetch($file);
            $tmpTP->append($tmpInner);
            $params['core']->removeAutoTags($tmpTP);
            $data['content'] = $tmpTP;
        } else {
            $data['content'] .= "<br/><small>File not found: " . $data['includehtml'] . "</small>";
        }
    }
    return $data;
}