Exemplo n.º 1
0
$settings_data = admin_get_settings();
// intro text for each tab
$intro = array();
$intro['admin'] = 'Set the sitewide contact email, alter the timezone, add account details for Twitter, Google Analytics, specify a alternative url.';
$intro['connections'] = 'If you have any analytics accounts add the ids here to automatically switch on tracking for those accounts. You can also add usernames for selected social media sites here.';
$intro['cache'] = 'If your site experiences heavy traffic you can switch on caching here.';
$intro['comments'] = 'The below settings allow you to control comments, including hiding existing comments or completely disabling posting of comments.';
$intro['design'] = 'The below settings only take effect if dynamic css is used. If you prefer to use your own structure.css file then changing these settings will have no effect.';
$intro['files'] = 'Here you can set the maximum size of images and attachments uploaded to your site.';
$intro['front'] = 'These settings control how the default front page of your site appears.';
$intro['layout'] = 'The below settings affect how elements are arranged on your page, specifically: the position of the main menu (if used), the layout of results/listings pages, and the number of results to show per page.';
$intro['meta'] = 'This allows you to select an alternative theme for your site, if multiple themes are available.';
$intro['site'] = 'The settings on this page largely affect the <head> section of your site.';
$left_text = 'settings';
$right_text = 'yep... still settings';
$page_header = show_page_header($left_text, $right_text);
// get aside content
// any functions
// any content generation
// output main content - into $main_content variable
$main_content = $page_header;
// start tabs
$main_content .= '
		<div id="settings_tabs">
			<ul>';
foreach ($settings_data as $section => $junk) {
    if ($section == 'custom') {
        continue;
    }
    $main_content .= '
				<li><a href="#tab_' . $section . '">' . $section . '</a></li>';
Exemplo n.º 2
0
<?php

if (!defined('WW_SESS')) {
    exit;
}
// page title
$page_title = 'Home Page';
// list of author's recent articles
$_GET['author_id'] = $_SESSION[WW_SESS]['user_id'];
$recent_articles = get_articles_admin();
// output main content
$left_header = 'Welcome back, ' . $_SESSION[WW_SESS]['name'];
$right_header = '<a href="' . $_SERVER["PHP_SELF"] . '?page_name=write">/Write a new article</a>';
$main_content = show_page_header($left_header, $right_header);
$main_content .= "\n\t\t<h4>Your most recent articles are listed below.</h4>\n\t\t<p>To view all articles posted to the site click on the <strong><a href=\"" . $_SERVER["PHP_SELF"] . "?page_name=articles\">Articles</a></strong> item in the menu.</p>";
// output articles list
$main_content .= build_admin_article_listing($recent_articles);
// get stats for this author
$user_article_stats = get_articles_stats(1);
$user_comment_stats = get_comments_stats($_SESSION[WW_SESS]['user_id']);
$user_new_comments = get_new_comments($_SESSION[WW_SESS]['user_id']);
if (!empty($user_article_stats)) {
    $first_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['first_post'] : '';
    $last_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['last_post'] : '';
    $total_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['total'] : '0';
}
unset($_GET['author_id']);
// now get sitewide stats (if author rights allow)
$all_article_stats = '';
$all_comment_stats = '';
if (empty($_SESSION[WW_SESS]['guest'])) {
Exemplo n.º 3
0
    $title_text[] = " tagged " . get_tag_title($_GET['tag_id']);
    $sub_header_text[] = 'tag: ' . get_tag_title($_GET['tag_id']);
}
// postdated
if (isset($_GET['postdated'])) {
    $status = ' postdated';
}
// other statuses
if (isset($_GET['status'])) {
    $status_list = define_article_status();
    $status = ' ' . $status_list[$_GET['status']];
}
// any content generation
$left_header = $total_articles . ' articles found';
$right_header = '<a href="' . $_SERVER["PHP_SELF"] . '?page_name=write">/Write a new article</a>';
$page_header = show_page_header($left_header, $right_header);
// get aside content
// any functions
$status_list = get_articles_stats(1);
$author_list = get_authors_admin(1);
$category_list = get_categories_admin(1);
$tags_list = get_tags_admin(1);
// any content generation
// output main content - into $main_content variable
$main_content = $page_header;
$main_content .= '<h4>Showing all' . $status . ' articles' . implode(', ', $title_text) . '</h4>';
$main_content .= build_admin_article_listing($articles);
if ($total_articles > $per_page) {
    $main_content .= show_admin_listing_nav($total_pages, $per_page);
}
// output aside content - into $aside_content variable
Exemplo n.º 4
0
<?php

// meta tags for head section
$config['site']['meta_title'] = $config['site']['title'] . " - Home Page";
// output content
// $page_title = "front page: ".$config['site']['title'];
if (isset($article)) {
    echo show_article($article, $config);
} elseif (isset($articles)) {
    echo show_page_header('Home Page', $config['site']['title']);
    echo show_listing($articles);
    // show navigation
    if ($config['front']['page_style'] == 'latest_month') {
        echo show_month_nav($months_list);
    } else {
        $total = !empty($articles[0]['total_found']) ? $articles[0]['total_found'] : '0';
        if ($total > $config['layout']['per_page']) {
            echo show_front_nav($articles[0]['total_pages']);
        }
    }
} elseif ($config['front']['page_style'] == 'custom') {
    echo 'custom front page';
}
Exemplo n.º 5
0
function create_sliver_success($link, $full_link)
{
    global $background;
    if ($background) {
        show_page_header();
        $string = "<p class='instruction'>Resource request submitted. If you are ";
        $string .= "not automatically redirected, <a href='{$full_link}'>click here</a> ";
        $string .= "to view request progress and results.</p>";
        echo $string;
        include "footer.php";
        ob_end_clean();
        print_r($link);
    } else {
        // FIXME: We probably want to redirect the user as
        // quickly as possible, but
        // is this the best way of doing it?
        relative_redirect($link);
        exit;
    }
}
Exemplo n.º 6
0
    $meta_title_text = implode(', ', $page_title_text);
    $config['site']['meta_title'] = 'Articles ' . strip_tags($meta_title_text) . ' - ' . $config['site']['title'];
}
// total results string
$page_header = implode(', ', $page_header_text);
$page_title = 'Showing articles ' . implode(', ', $page_title_text);
$total = !empty($articles[0]['total_found']) ? $articles[0]['total_found'] : '0';
$total_articles = $total == 1 ? $total . ' article found' : $total . ' articles found';
// feed listing
if (isset($_GET['feed_listing'])) {
    $config['site']['meta_title'] = 'RSS Feeds for ' . $config['site']['title'];
    $page_title = 'RSS Feeds';
    $sub_header = "RSS";
    $total_articles = '';
}
echo show_page_header($page_header, $total_articles);
// any sub categories to list
if (!empty($show_subcategories)) {
    if (isset($category_details['child'])) {
        echo '
			<ul class="filter_list">
				<li class="filter_heading">Sub-categories:</li> ';
        foreach ($category_details['child'] as $child) {
            echo '
				<li><a href="' . WW_WEB_ROOT . '/' . $child['url'] . '">' . $child['title'] . '</a></li>';
        }
        echo '</ul>';
    }
}
// any filters to show
if (!empty($show_filters)) {
Exemplo n.º 7
0
    } else {
        $initial_content = '<h4>Showing all comments</h4>';
    }
}
// grab whichever comments we need to list
$comments = empty($is_contributor) ? get_comments() : get_comments($_SESSION[WW_SESS]['user_id']);
$total_found = !empty($comments) ? $comments[0]['total_found'] : 0;
$total_pages = !empty($comments) ? $comments[0]['total_pages'] : 0;
// per page - same definition as get_comments()
$per_page = !isset($_GET['per_page']) || empty($_GET['per_page']) ? 15 : (int) $_GET['per_page'];
// get aside content
// get list of comment stats and articles
$comment_stats = empty($is_contributor) ? get_comments_stats() : get_comments_stats($_SESSION[WW_SESS]['user_id']);
$new_comments = empty($is_contributor) ? get_new_comments() : get_new_comments($_SESSION[WW_SESS]['user_id']);
// output main content - into $main_content variable
$main_content = show_page_header('Comments', $right_text);
$main_content .= isset($initial_content) ? $initial_content : '';
$main_content .= build_admin_comment_listing($comments);
if ($total_found > $per_page) {
    $main_content .= show_admin_listing_nav($total_pages, $per_page);
}
// output aside content - into $aside_content variable
$aside_content = '
			
			<h4><a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments&amp;action=post">post a comment</a></h4>
			<h4>Filter comments</h4>
			<div class="snippet">
			<ul>
			<li>
				<span class="list_item">
					<a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments">show all comments</a>
Exemplo n.º 8
0
    $config['site']['meta_title'] = 'Articles ' . implode(', ', $title_text) . ' - ' . $config['site']['title'];
}
// now we compile the page title text and grab the total articles variable
$header_text = implode(' &#124; ', $title_text);
$page_title = 'Params - ' . implode(' &#124; ', $title_text);
$total = !empty($articles[0]['total_found']) ? $articles[0]['total_found'] : '0';
$total_articles = 'found: ' . $total;
// header text and relevant code for rss feed listing
if (isset($_GET['feed_listing'])) {
    $config['site']['meta_title'] = 'RSS Feeds for ' . $config['site']['title'];
    $page_title = 'RSS Feeds';
    $sub_header = "RSS";
    $total_articles = '';
}
// use the inbuilt function to generate the page header
echo show_page_header($header_text, $total_articles);
// add our own h1 tag
echo '<h1>Custom listing page</h1>';
// add page navigation at the top of the page as well as the bottom
if ($total > $config['layout']['per_page']) {
    echo show_listing_nav($articles[0]['total_pages'], $config['layout']['per_page']);
}
// create our own listing
if (empty($articles)) {
    echo '<h2>No results...</h2>';
} else {
    echo '
		<div id="listing_wrapper">';
    foreach ($articles as $list) {
        echo '
			<div class="listing">
/**
 * show_article
 * 
 * 
 * 
 * 
 * 
 * 
 */
function show_article($article, $config)
{
    if (empty($article)) {
        return false;
    }
    update_counters($article['id']);
    $article_pre_url = $config['layout']['url_style'] == 'cms' ? $article['category_url'] : date('Y/m/d', $article['date_ts']);
    $article['link'] = WW_WEB_ROOT . "/" . $article_pre_url . "/" . $article['url'] . "/";
    $article['current_page'] = !empty($_GET['p']) ? (int) $_GET['p'] : 0;
    // generate bookmarks
    $sharing_bookmarks = '';
    if (!empty($config['connections']['sharing_bookmarks'])) {
        if (empty($config['connections']['sharing_custom'])) {
            $sharing_bookmarks = insert_bookmarks($article['title'], $article['link']);
        } else {
            $sharing_bookmarks = $config['connections']['sharing_custom'];
        }
    }
    // echo insert_page_header();
    echo show_page_header($article['category_title'], date('d M Y', $article['date_ts']));
    echo '
		<div class="article_wrapper">';
    echo show_article_title($article);
    echo show_article_byline($article);
    if ($config['connections']['sharing_position'] == 'article_top') {
        echo $sharing_bookmarks;
    }
    echo show_article_summary($article);
    echo show_article_body($article);
    echo show_article_attachments($article['attachments']);
    echo show_article_tags($article['tags']);
    if ($config['connections']['sharing_position'] == 'article_footer') {
        echo $sharing_bookmarks;
    }
    echo '
		</div> <!-- close article wrapper -->
		';
}
Exemplo n.º 10
0
        $initial_content = '<h4>Showing all comments</h4>';
    }
}
// grab whichever comments we need to list
$comments = empty($is_contributor) ? get_comments() : get_comments($_SESSION[WW_SESS]['user_id']);
$total_found = !empty($comments) ? $comments[0]['total_found'] : 0;
$total_pages = !empty($comments) ? $comments[0]['total_pages'] : 0;
// per page - same definition as get_comments()
$per_page = !isset($_GET['per_page']) || empty($_GET['per_page']) ? 15 : (int) $_GET['per_page'];
// get aside content
// get list of comment stats and articles
$comment_stats = empty($is_contributor) ? get_comments_stats() : get_comments_stats($_SESSION[WW_SESS]['user_id']);
$new_comments = empty($is_contributor) ? get_new_comments() : get_new_comments($_SESSION[WW_SESS]['user_id']);
// output main content - into $main_content variable
$left_text = isset($_GET['comment_id']) ? '<a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments">Comments</a>' : 'Comments';
$main_content = show_page_header($left_text, $right_text);
$main_content .= isset($initial_content) ? $initial_content : '';
$main_content .= build_admin_comment_listing($comments);
if ($total_found > $per_page) {
    $main_content .= show_admin_listing_nav($total_pages, $per_page);
}
// output aside content - into $aside_content variable
$aside_content = '
			
			<h4><a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments&amp;action=post">post a comment</a></h4>
			<h4>Filter comments</h4>
			<div class="snippet">
			<ul>
			<li>
				<span class="list_item">
					<a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments">show all comments</a>