Ejemplo n.º 1
0
// 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
$aside_content = '<h4>Filter articles</h4>';
$aside_content .= '<p><a href="' . $_SERVER["PHP_SELF"] . '?page_name=articles">show all articles</a></p>';
$aside_content .= build_snippet('Status', $status_list);
$aside_content .= build_snippet('Authors', $author_list);
$aside_content .= build_snippet('Categories', $category_list);
$aside_content .= build_snippet('Tags', $tags_list);
Ejemplo n.º 2
0
		</p>
		</form>
	';
// output aside content
$aside_content = build_snippet('Files for ' . $edit_theme, $list_files);
$aside_content .= build_snippet('Create new file', $create_file);
$aside_content .= build_snippet('Themes', $list_themes);
$aside_content .= '
		<h4>Suggestions</h4>
		<p>You can also create the following page and category specific stylesheets:</p>';
// get a list of page names
$page_names = array('feed', 'front', '404', 'article', 'listing');
$page_name_css = array();
foreach ($page_names as $page_name) {
    if (!file_exists(WW_ROOT . '/ww_view/themes/' . $edit_theme . '/' . $page_name . '.css')) {
        $new_link = $_SERVER["PHP_SELF"] . '?page_name=editor&amp;theme=' . $edit_theme . '&amp;create_file=';
        $page_name_css[] = array('title' => $page_name . '.css', 'link' => $new_link . $page_name . '.css');
    }
}
$aside_content .= build_snippet('', $page_name_css);
// get a list of categories
$categories_list = get_categories_basic();
$category_css = array();
foreach ($categories_list as $category) {
    if (!file_exists(WW_ROOT . '/ww_view/themes/' . $edit_theme . '/' . $category . '.css')) {
        $new_link = $_SERVER["PHP_SELF"] . '?page_name=editor&amp;theme=' . $edit_theme . '&amp;create_file=';
        $category_css[] = array('title' => $category . '.css', 'link' => $new_link . $category . '.css');
    }
}
$aside_content .= build_snippet('', $category_css);
Ejemplo n.º 3
0
<?php

$custom_list = array();
$child_list = array();
$child_list[] = array('title' => 'child item', 'link' => '#');
$custom_list[] = array('title' => 'first item', 'link' => '#');
$custom_list[] = array('title' => 'second item', 'link' => '#', 'total' => '2');
$custom_list[] = array('title' => 'third item', 'link' => '#', 'child' => $child_list);
echo build_snippet('List Test', $custom_list);
Ejemplo n.º 4
0
					<input type="hidden" name="page_name" value="attachments"/>
					<input type="hidden" name="attachment_id" value="' . $attachment['id'] . '"/>
					<input name="action" type="submit" value="delete"/>
					</span>
				</p>
			</form>
			';
}
// output aside content - into $aside_content variable
$quicklinks = '
			<ul>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=files">Files</a></li>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=images">Images</a></li>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=attachments">Attachments</a></li>
			</ul>';
$aside_content = build_snippet('Quick Links', $quicklinks);
// attachment subfolders
$attachment_folders = get_folders(WW_ROOT . "/ww_files/attachments");
if (!empty($attachment_folders)) {
    $aside_content .= '
		<div class="snippet">
		<h6>Attachment folders</h6>
		<ul>';
    foreach ($attachment_folders as $folder) {
        $aside_content .= '
			<li>
				<a href="' . $_SERVER["PHP_SELF"] . '?page_name=attachments&amp;ext=' . $folder . '">' . $folder . '</a>
			</li>';
    }
    $aside_content .= '
		</ul>
Ejemplo n.º 5
0
			</div>';
}
if (!empty($user_comment_stats)) {
    $aside_content .= build_snippet('Your comments statistics', $user_comment_stats);
}
if (!empty($user_new_comments)) {
    $c_text = count($user_new_comments) > 1 ? ' new comments</a> have ' : ' new comment</a> has ';
    $aside_content .= '
			<div class="snippet">
			<p><a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments">' . count($user_new_comments) . $c_text . 'been posted to your articles since your last login.</div>';
}
// sitewide stats
if (!empty($all_article_stats)) {
    $aside_content .= '<h4>All articles</h4>' . build_snippet('Sitewide article statistics', $all_article_stats) . '
		<div class="snippet">
			<p>The last article was published on:</p>
			<p class="indent"><em>' . from_mysql_date($last_site_post, 'l, j F Y') . '</em></p>
			<p>Total published:</p>
			<p class="indent"><strong><em>' . $total_site_post . ' articles</strong> since 
			' . from_mysql_date($first_site_post, 'j M Y') . '</em></p>
		</div>';
}
if (!empty($all_comment_stats)) {
    $aside_content .= build_snippet('Sitewide comment statistics', $all_comment_stats);
}
if (!empty($all_new_comments)) {
    $c_text = count($all_new_comments) > 1 ? ' new comments</a> have ' : ' new comment</a> has ';
    $aside_content .= '
			<div class="snippet">
			<p><a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments&amp;new">' . count($all_new_comments) . $c_text . 'been posted to the site since your last login.</div>';
}
Ejemplo n.º 6
0
$add_category_form .= '
				<form action="' . $_SERVER["PHP_SELF"] . '?page_name=categories" method="post" id="add_category_form">
				<p>
					<label for="title">Category title</label>
					<input name="title" type="text" size="20"/>
				</p>
				<p>
					<label for="category_id">Parent category</label>
					<select name="category_id">
						<option value="">(no parent)</option>';
foreach ($parent_select as $option_id => $option) {
    $add_category_form .= '
						<option value="' . $option_id . '">' . $option . '</option>
					';
}
$add_category_form .= '
					</select>
				</p>
				<p>
					<label for="summary">Category summary (optional)</label>
					<textarea name="summary" cols="21" rows="3"></textarea>
				</p>
				<p>
					<input name="add_category" value="add" type="submit"/>
				</p>
				</form>
	';
// output aside content - into $aside_content variable
$aside_content = build_snippet('Categories', $categories_list);
$aside_content .= build_snippet('Add a Category', $add_category_form);
Ejemplo n.º 7
0
<?php

// get the content for our new snippet
$news = '
<script src="http://www.gmodules.com/ig/ifr?url=http://shazingo.com/lig/lg/142002.xml&amp;up_extrafeed=http%3A%2F%2Fnewsrss.bbc.co.uk%2Frss%2Fnewsonline_uk_edition%2Fhealth%2Frss.xml&amp;up_extratitle=Health&amp;up_subject=BBC%20News&amp;up_entries=4&amp;up_summaries=100&amp;up_selectedTab=&amp;synd=open&amp;w=200&amp;h=360&amp;title=news&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>';
// use the build_snippet() function to build the actual snippet
$aside_snippet['news'] = build_snippet('BBC News', $news);
// just to be difficult we'll put this at the top of the aside inner section
// first we capture the existing $aside_content['inner'] array into a variable
$inner_asides = $aside_content['inner'];
// then we initialize (reset) the array
$aside_content['inner'] = array();
// add in our new snippet first
$aside_content['inner'] = array($aside_snippet['news']);
// then put the rest of the entries back in
foreach ($inner_asides as $inner) {
    $aside_content['inner'][] = $inner;
}
// clear our variables just in case
unset($inner);
unset($inner_asides);
Ejemplo n.º 8
0
					<span class="note">
					<input type="hidden" name="page_name" value="tags"/>
					<input type="hidden" name="tag_id" value="' . $tag_id . '"/>
					<input name="action" type="submit" value="delete"/>
					</span>
				</p>
			</form>
			';
}
// get aside content
$tags_list = get_tags_admin();
$add_tag_form = isset($insert_error) && !empty($insert_error) ? '<p><strong>' . $insert_error . '</strong></p>' : '';
$add_tag_form .= '
				<form action="' . $action_url . '" method="post" id="add_tag_form">
				<p>
					<label for="title">Tag title</label>
					<input name="title" type="text" size="20"/>
				</p>
				<p>
					<label for="summary">Tag summary (optional)</label>
					<textarea name="summary" cols="21" rows="3"></textarea>
				</p>
				<p>
					<input name="insert_tag" value="add" type="submit"/>
				</p>
				</form>
	';
// output aside content
$aside_content = build_snippet('Tags', $tags_list);
$aside_content .= build_snippet('Add a Tag', $add_tag_form);
Ejemplo n.º 9
0
<?php

$date = date('d M Y');
$title = "Today's Date";
$content = "<p>the date today is " . $date . '</p>';
echo build_snippet($title, $content);
Ejemplo n.º 10
0
					<input name="add_author" value="add" type="submit"/>
				</p>
			</form>
			';
$author_levels_text = '
			<ul>
				<li>
					<strong>Author</strong><br />
					access to all areas
				</li>
				<li>
					<strong>Editor</strong><br />
					access to write/edit all articles, manage authors, categories, tags, images and attachments
					<br /><em>no access to files, links or settings</em>
				</li>
				<li>
					<strong>Contributor</strong><br />
					access to write/edit own articles, images and attachments only
					<br /><em>no access to authors (excepting own details), categories, tags, files, links or settings</em>
				</li>
			</ul>
		';
// output aside content - into $aside_content variable
if (empty($_SESSION[WW_SESS]['guest'])) {
    $aside_content = build_snippet('Authors', $author_list);
    $aside_content .= build_snippet('Add an author', $add_author_form);
} elseif ($_SESSION[WW_SESS]['level'] == 'editor') {
    $aside_content = build_snippet('Authors', $author_list);
}
$aside_content .= build_snippet('Access levels', $author_levels_text);
Ejemplo n.º 11
0
			<div class="snippet">
			<ul>
			<li>
				<span class="list_item">
					<a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments">show all comments</a>
				</span>
				<span class="list_total">
					' . $total_comments . '
			</li>
			';
if (!empty($new_comments)) {
    $aside_content .= '
			<li>
				<span class="list_item">
					<a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments&amp;new">show new comments</a>
				</span>
				<span class="list_total">
					' . count($new_comments) . '
				</span>
			</li>
			';
}
$aside_content .= '
			</ul>
			</div>';
// don't show status if all comments are approved or all comments are not approved
if (!empty($comment_stats['approved']['total']) && !empty($comment_stats['not approved']['total'])) {
    $aside_content .= build_snippet('By status', $comment_stats);
}
$aside_content .= build_snippet('By article', $articles_list);
Ejemplo n.º 12
0
				</form>
				';
        }
    }
}
// output aside content - into $aside_content variable
$quicklinks = '
			<ul>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=files">Files</a></li>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=images">Images</a></li>
				<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=attachments">Attachments</a></li>
			</ul>';
// show other folders
$aside_content = build_snippet('Quick Links', $quicklinks);
if (!empty($custom_folders)) {
    $aside_content .= build_snippet('Custom folders', $custom_folders);
}
// upload a file to selected folder
if (isset($_GET['folder'])) {
    $folder_title = $_GET['folder'];
    $folder_select = '<input type="hidden" name="folder" value="' . $_GET['folder'] . '">';
} else {
    $folder_title = 'custom';
    $folder_select = '
		<p>
		<label for="folder">Select folder:</label>
		<select name="folder">
			<option value="">select...</option>';
    foreach ($custom_folders as $cf_select) {
        $folder_select .= '
			<option value="' . $cf_select['title'] . '">' . $cf_select['title'] . '</option>';
Ejemplo n.º 13
0
<?php

/*
	refer to ww_view/_content/aside.php to see all default snippets 
*/
include_once WW_ROOT . '/ww_view/_content/_aside.php';
/* custom asides for this theme are automatically imported */
// add a new custom aside, using the build_snippet function for easy formatting
$custom_html = "<p>This is a custom aside I've just added now</p>";
$aside_snippet['custom_aside'] = build_snippet('Custom Sample', $custom_html);
// recreate $aside_content array - remove some defaults, add our custom ones
$aside_content['upper'] = array($aside_snippet['search'], $aside_snippet['list_test'], $aside_snippet['date_today'], $aside_snippet['custom_aside']);
$aside_content['inner'] = array($aside_snippet['latest_articles'], $aside_snippet['popular_articles'], $aside_snippet['authors_list'], $aside_snippet['categories_list'], $aside_snippet['tags_list'], $aside_snippet['months_list'], $aside_snippet['feeds']);
$aside_content['outer'] = array();
$aside_content['lower'] = array();
// finally use the insert_aside function to put our $aside_content array into the correct html structure
echo insert_aside($aside_content);
// to define additional snippets:-
/*
	$aside_snippet['custom_aside'] = build_snippet('Custom Sample',$custom_html);
	
		'custom_aside'		this is the unique name for your snippet
		'Custom Sample'		this is the snippet title that will appear on the page
		$custom_html		this is the snippet data - can be html or an array (which would be rendered as a list)
	
		you don't have to use the build snippet function - this just provides a wrapper
		for your snippet and converts arrays to lists - you can manually code the html
		if you prefer
*/
// to add your new snippet to an existing aside_content array:-
/*
Ejemplo n.º 14
0
    // nothing to go in the aside_outer div
    $aside_content['lower'] = array();
    // nothing to go in the aside_lower div
} else {
    // we can show a more comprehensive range of snippets if the user is not on a phone
    $aside_snippet['authors_list'] = build_snippet('Authors', $authors_list);
    $aside_snippet['authors_select'] = build_snippet('Authors', $authors_select_form);
    $aside_snippet['pages_list'] = build_snippet('About this site', $pages_list);
    $aside_snippet['categories_list'] = build_snippet('Categories', $categories_list);
    $aside_snippet['categories_select'] = build_snippet('Categories', $categories_select_form);
    $aside_snippet['tags_list'] = build_snippet('Tags', $tags_list);
    $aside_snippet['tags_select'] = build_snippet('Tags', $tags_select_form);
    $aside_snippet['months_list'] = build_snippet('Archives', $months_list);
    $aside_snippet['months_select'] = build_snippet('Months', $months_select_form);
    $aside_snippet['search'] = build_snippet('Search', $search_form);
    $aside_snippet['latest_articles'] = build_snippet('Latest Articles', $latest_articles);
    $aside_snippet['popular_articles'] = build_snippet('Most Popular', $popular_articles);
    $aside_snippet['feeds'] = build_snippet('Feeds', $feeds_list);
    $aside_snippet['twitter'] = '';
    // default layout here
    $aside_content['upper'] = array($aside_snippet['search']);
    $aside_content['inner'] = array($aside_snippet['main_menu'], $aside_snippet['authors_select'], $aside_snippet['categories_select'], $aside_snippet['tags_select'], $aside_snippet['months_select'], $aside_snippet['pages_list'], $aside_snippet['latest_articles'], $aside_snippet['popular_articles'], $aside_snippet['authors_list'], $aside_snippet['categories_list'], $aside_snippet['tags_list'], $aside_snippet['months_list'], $aside_snippet['feeds'], $aside_snippet['twitter_feed'], $aside_snippet['blogroll']);
    $aside_content['outer'] = array();
    $aside_content['lower'] = array();
}
// any aside files to import?
/*
	what happens next?
	ww_view/index.php uses the insert_aside() function to place everything stored within the
	$aside_content array (created above) into $body_content['aside']
*/