Пример #1
0
function pageText($id = "")
{
    global $clerk;
    $id = empty($id) ? PAGE : $id;
    if (!empty($id)) {
        $page = $clerk->query_fetchArray($clerk->query_select("pages", "", "WHERE id='{$id}' OR slug='{$id}' LIMIT 1"));
        $text = call_anchor("pageTextModify", array('original' => $page['text'], 'modified' => textOutput($page['text'])));
        return $text['modified'];
    }
}
Пример #2
0
function projectContent($proj = "")
{
    global $clerk, $project;
    $id = determineProjectId($proj);
    if (empty($id)) {
        return;
    }
    $project = $clerk->query_fetchArray($clerk->query_select("projects", "", "WHERE id= '{$id}' OR slug= '{$id}'"));
    $flow = explode(",", $project['flow']);
    $id = $project['id'];
    $files = $clerk->query_select("project_files", "", "WHERE project_id= '{$id}' ORDER BY pos ASC");
    while ($file = $clerk->query_fetchArray($files)) {
        $thefiles[$file['id']] = $file;
    }
    foreach ($flow as $part) {
        if (strstr($part, "textblock")) {
            $textBlockID = str_replace("textblock", "", $part);
            $textblock = call_anchor("textblockModify", array('original' => $thefiles[$textBlockID]['caption'], 'modified' => textOutput($thefiles[$textBlockID]['caption'])));
            $print_block = '<div class="textblock">' . $textblock['modified'] . '</div>';
            $print_block = call_anchor("textblock_modify_html", $print_block);
            echo $print_block;
        } elseif (strstr($part, "group")) {
            $group = getGroupInfo($part);
            $typeFunc = str_replace("-", "_", $group['type']);
            echo '<div class="fileGroup ' . $group['type'] . '" id="' . $project['slug'] . '-' . $group['num'] . '">';
            if (is_callable($typeFunc)) {
                echo call_user_func_array($typeFunc, array($project, $thefiles, $group));
            }
            echo '</div>';
        } else {
            call_anchor("project_content_flow", array("part" => $part));
        }
    }
}
Пример #3
0
function post_excerpt()
{
    global $blog;
    if (selectedPost() == postSlug() || selectedPost() == postId()) {
        return post_text();
    } else {
        $post = call_anchor("blogPostModify", array('original' => $blog['post'], 'modified' => textOutput($blog['post'])));
        $pieces = explode("{more}", $post['modified']);
        return $pieces[0];
    }
}