Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Initial commit (launch)
Browse files Browse the repository at this point in the history
Initial commit to GDS repository of WordPress theme and plugin files
  • Loading branch information
Steph Gray committed Jul 12, 2012
0 parents commit cbf9b10
Show file tree
Hide file tree
Showing 67 changed files with 5,364 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.DS_Store
98 changes: 98 additions & 0 deletions plugin/prs-fragment-importer/index.php
@@ -0,0 +1,98 @@
<?php
/*
Plugin Name: Public Reading Stage Fragment Importer
Plugin URI: http://www.helpfultechnology.com
Description: Imports document 'fragments' into a site from a specially-formatted CSV file
Author: Steph Gray
Version: 0.1
Author URI: http://www.helpfultechnology.com
*/

if(!function_exists('str_getcsv')) {
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") {
$fp = fopen("php://memory", 'r+');
fputs($fp, $input);
rewind($fp);
$data = fgetcsv($fp, null, $delimiter, $enclosure); // $escape only got added in 5.3.0
fclose($fp);
return $data;
}
}

add_action('admin_menu', 'ht_prsimporter_menu');

function ht_prsimporter_menu() {
add_submenu_page('tools.php','PRS Fragment Importer', 'PRS Fragment Importer', 'manage_options', 'prs-fragment-importer', 'ht_prsimporter_options');
}

function ht_prsimporter_options() {

if (!current_user_can('manage_options')) {
wp_die( __('You do not have sufficient permissions to access this page.') );
}

ob_start();

echo "<div class='wrap'>";
screen_icon();
echo "<h2>" . __( ' Public Reading Stage Fragment Importer' ) . "</h2>";

if ($_REQUEST['action'] == "processimport") {

$fragarray = explode("\n",$_REQUEST['rawfragments']);

foreach((array)$fragarray as $f) {
$fragments[] = str_getcsv(stripslashes($f));
}

foreach((array)$fragments as $parsedf) {

if (is_numeric($parsedf[4])) {
$parent = get_page_by_title($parsedf[4], OBJECT, 'fragment' );
$parentid = ($parent->ID) ? $parent->ID : null;
} else {
$parentid = null;
}

$fragment = array(
'menu_order' => trim($parsedf[0]),
'ping_status' => 'closed',
'post_title' => trim($parsedf[1]),
'post_content' => trim($parsedf[2]),
'post_status' => 'publish',
'post_parent' => trim($parentid),
'post_type' => 'fragment',
);

$insertid = wp_insert_post($fragment);
add_post_meta($insertid, '_notes', $parsedf[3]);

$counter[] = $parsedf[1];
sleep(0.5); // small 1/2 sec delay to let things catch up
}

echo "<p>Successfully created " . count($counter) . " fragments:</p><p>" . implode("<br />",$counter) . "</p>";

} elseif ($_REQUEST['action'] == "showinfo") {

} else {

echo "
<p></p>
<form method='post'>
<p><label for='rawfragments'>Paste CSV fragment file contents here:</label></p>
<p><textarea class='widefat' rows='20' cols='50' name='rawfragments' id='rawfragments'></textarea></p>
<p><input type='submit' value='Import fragments' class='button-primary' /></p>
<input type='hidden' name='page' value='prs-fragment-importer' />
<input type='hidden' name='action' value='processimport' />
</form><br />
";

}

echo "</div>";

ob_end_flush();
}

?>
30 changes: 30 additions & 0 deletions theme/publicreadingstage/404.php
@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 3.0
*/

get_header(); ?>


<div class="row">
<div class="twelvecol last" id="content">

<h1><?php _e( 'Not Found', 'twentyten' ); ?></h1>

<p><?php _e( 'Apologies, but the page you requested could not be found. Perhaps searching will help.', 'twentyten' ); ?></p>
<p class='aligncenter'><?php get_search_form(); ?></p>

<script type="text/javascript">
// focus on search field after it has loaded
document.getElementById('s') && document.getElementById('s').focus();
</script>

</div>

</div>

<?php get_footer(); ?>
85 changes: 85 additions & 0 deletions theme/publicreadingstage/_READ_ME.txt
@@ -0,0 +1,85 @@

STARKERS

- - - - - - - - - - - - - - - - - - - - - - -

Starkers is a bare-bones WordPress theme created
to act as a starting point for the theme designer.

Free of all presentational elements and non-semantic
markup, Starkers is the perfect 'blank slate' for
your WordPress projects, as it's a stripped-back
version of the 'Twenty Ten' theme (versions prior to
3.0 were based on the now-retired 'Default' theme).

Best of all: it's free and fully GPL-licensed,
so you can use it for whatever you like — even
your commercial projects.

For full details, and for instructions, please see:
http://starkerstheme.com/

- - - - - - - - - - - - - - - - - - - - - - -

Version 3.0, updated 21.06.2010

Re-built entirely from the ground up, using
the new 'Twenty Ten' theme as its base

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.8.5, updated 11.11.2009

Changed brand-wide typeface to FS Clerkenwell

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.8.2, revision 1, updated 23.07.2009

Corrected: closing </div> tag in comments.php on line 87

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.8.2 for WP2.8.2, updated 21.07.2009

Removed: Extra '>' in comments.php on line 50
Changed: Commented out 'div, ul, li { position:relative }' in layout.css
Added: GPL License included as '_LICENSE.txt'
Renamed: 'READ_ME.txt' becomes '_READ_ME.txt'

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.8.1 for WP2.8.1, updated 12.07.2009

Re-written from scratch, using the 'Default'
theme included with WordPress 2.8 as a basis.

- - - - - - - - - - - - - - - - - - - - - - -

Versions 2.3 - 2.7

Non-existent. Starkers is now named according to
the version of WordPress with which it is compatible.

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.2 for WP2.6.2, updated 02.11.2008

Fixed: prev / next links typo in archive.php & index.php
Fixed: closing </p> tag in comments.php

- - - - - - - - - - - - - - - - - - - - - - -

Version 2.1 for WP2.6.2, updated 29.09.2008

Added: WP image-alignment and caption CSS
Added: Page listing
Removed: _comments-popup.php
Fixed: prev / next links typo
Fixed: duplicate 'h5' typo in reset.css

- - - - - - - - - - - - - - - - - - - - - - -

Enjoy!

~ Elliot Jay Stocks
69 changes: 69 additions & 0 deletions theme/publicreadingstage/archive.php
@@ -0,0 +1,69 @@
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 3.0
*/

get_header(); ?>



<?php
/* Queue the first post, that way we know
* what date we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
if ( have_posts() )
the_post();
?>

<div class="row">
<div class="eightcol" id="content">

<h1>
<?php if ( is_day() ) : ?>
<?php printf( __( 'Daily Archives: %s', 'twentyten' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( 'Monthly Archives: %s', 'twentyten' ), get_the_date('F Y') ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __( 'Yearly Archives: %s', 'twentyten' ), get_the_date('Y') ); ?>
<?php else : ?>
<?php _e( 'Blog Archives', 'twentyten' ); ?>
<?php endif; ?>
</h1>

<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();

/* Run the loop for the archives page to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-archives.php and that will be used instead.
*/
get_template_part( 'loop', 'archive' );
?>

</div>

<div class="fourcol last" id="sidebar">
<ul class="xoxo">
<?php dynamic_sidebar( 'inside-sidebar-widget-area' ); ?>
</ul>
</div>

</div>

<?php get_footer(); ?>
63 changes: 63 additions & 0 deletions theme/publicreadingstage/attachment.php
@@ -0,0 +1,63 @@
<?php
/**
* The template for displaying attachments.
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 3.0
*/

get_header(); ?>

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<div class="row">
<div class="twelvecol last">

<p><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
/* translators: %s - title of parent post */
printf( __( '<span>&larr;</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
?></a></p>

<h2><?php the_title(); ?></h2>

<?php if ( wp_attachment_is_image() ) :
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
foreach ( $attachments as $k => $attachment ) {
if ( $attachment->ID == $post->ID )
break;
}
$k++;
// If there is more than 1 image attachment in a gallery
if ( count( $attachments ) > 1 ) {
if ( isset( $attachments[ $k ] ) )
// get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
else
// or get the URL of the first image attachment
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
} else {
// or, if there's only 1 image attachment, get the URL of the image
$next_attachment_url = wp_get_attachment_url();
}
?>
<p><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
$attachment_size = apply_filters( 'twentyten_attachment_size', 900 );
echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
?></a></p>

<?php else : ?>
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
<?php endif; ?>
<?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>

<?php the_content( __( 'Continue reading &rarr;', 'twentyten' ) ); ?>


</div>

</div>

<?php endwhile; ?>

<?php get_footer(); ?>

0 comments on commit cbf9b10

Please sign in to comment.