Example #1
0
 $post = find_post($year, $month, $name);
 $current = $post['current'];
 if (!$current) {
     not_found();
 }
 if (config("views.counter") == "true") {
     add_view($current->file);
     if (!login()) {
         file_cache($_SERVER['REQUEST_URI']);
     }
 }
 $author = get_author($current->author);
 if (isset($author[0])) {
     $author = $author[0];
 } else {
     $author = default_profile($current->author);
 }
 if (array_key_exists('prev', $post)) {
     $prev = $post['prev'];
 } else {
     $prev = array();
 }
 if (array_key_exists('next', $post)) {
     $next = $post['next'];
 } else {
     $next = array();
 }
 if (isset($current->image)) {
     $var = 'imagePost';
 } elseif (isset($current->link)) {
     $var = 'linkPost';
    var_dump($rules_array);
    foreach ($rules_groups as $group) {
        $operation = 0;
        if ($group[1] == '!=') {
            $operation = 1;
        }
        $condition = 0;
        if ($group[3] == 'OR') {
            $condition = 1;
        }
        $and_or = $group[1];
        $grouped[$group[0]] = array($operation, $group[2], $condition);
    }
}
if ($p['profile_parameter_arr']['profile_name'] == '') {
    $profile = default_profile();
    $profile_name = 'default';
} else {
    $profile = $p['profile_parameter_arr'];
}
if (isset($_POST['preview'])) {
    generate_bill($_POST['example_order_id']);
}
$languages_arr = get_languages();
//echo "<pre>"; print_r($languages_arr); echo "</pre>";
foreach ($languages_arr as $lang) {
    if ($lang['default'] == 1) {
        $default_language = $lang;
    }
}
require DIR_WS_INCLUDES . 'head.php';
Example #3
0
});
// The author page
get('/admin/mine', function () {
    if (login()) {
        config('views.root', 'system/admin/views');
        $profile = $_SESSION[config("site.url")]['user'];
        $page = from($_GET, 'page');
        $page = $page ? (int) $page : 1;
        $perpage = config('profile.perpage');
        $posts = get_profile($profile, $page, $perpage);
        $total = get_count($profile, 'dirname');
        $bio = get_bio($profile);
        if (isset($bio[0])) {
            $bio = $bio[0];
        } else {
            $bio = default_profile($profile);
        }
        if (empty($posts) || $page < 1) {
            render('user-posts', array('head_contents' => head_contents('My blog posts - ' . blog_title(), blog_description(), site_url()), 'page' => $page, 'heading' => 'My posts', 'posts' => null, 'bio' => $bio->body, 'name' => $bio->title, 'bodyclass' => 'userposts', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $bio->title, 'pagination' => has_pagination($total, $perpage, $page)));
            die;
        }
        render('user-posts', array('head_contents' => head_contents('My blog posts - ' . blog_title(), blog_description(), site_url()), 'heading' => 'My posts', 'page' => $page, 'posts' => $posts, 'bio' => $bio->body, 'name' => $bio->title, 'bodyclass' => 'userposts', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $bio->title, 'pagination' => has_pagination($total, $perpage, $page)));
    } else {
        $login = site_url() . 'login';
        header("location: {$login}");
    }
});
// The static page
get('/:static', function ($static) {
    if ($static === 'sitemap.xml' || $static === 'sitemap.base.xml' || $static === 'sitemap.post.xml' || $static === 'sitemap.static.xml' || $static === 'sitemap.tag.xml' || $static === 'sitemap.archive.xml' || $static === 'sitemap.author.xml') {
        header('Content-Type: text/xml');