From 3298c7526c291991a114cf6ce1f7b13f8b811532 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Thu, 28 Jul 2016 09:35:13 -0400 Subject: [PATCH] templates are out of the partial folder and inside the index.php --- root/index.php | 192 +++++++++++++++++++-- root/parts/archive.php | 5 - root/parts/front-view.php | 19 -- root/parts/home.php | 11 -- root/parts/{search.php => search-form.php} | 0 root/parts/search-result.php | 111 ------------ root/parts/single.php | 36 ---- 7 files changed, 182 insertions(+), 192 deletions(-) delete mode 100644 root/parts/archive.php delete mode 100644 root/parts/front-view.php delete mode 100644 root/parts/home.php rename root/parts/{search.php => search-form.php} (100%) delete mode 100644 root/parts/search-result.php delete mode 100644 root/parts/single.php diff --git a/root/index.php b/root/index.php index 36a52be..91e0f97 100644 --- a/root/index.php +++ b/root/index.php @@ -25,20 +25,192 @@ - - +
+
+ +
+
+
+ +
+
+ + +
+ +
+ +
+
+ - - +
+ +
+ + +
+ - - +
+
+ + +
+ - - +
+
+
+ +
+
+
+
+
> +
+

+ + + + + + Posted on +
+ +
+ +
+
+
+
+ + +
+

+
+ +
+ +
+ - - +
+
+ +

Please enter a query in the search box.

+ +

Search Results for ""

+
+ +
+
+ + post_type=='page')) continue; ?> +
+
+
> +
+

+ Posted on +
+ + + + @'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); + + // Search content for terms + $terms = $wp_query->query_vars['search_terms']; + if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) { + $padding = max($min_padding, $max_length / (2*count($matches[0]))); + + // Construct extract containing context for each term + $output = ''; + $last_offset = 0; + foreach ( $matches[0] as $match ) { + list($string, $offset) = $match; + $start = $offset-$padding; + $end = $offset+strlen($string)+$padding; + // Preserve whole words + while ( $start > 1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$start-1}) ) $start--; + while ( $end < strlen($content)-1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$end}) ) $end++; + $start = max($start, $last_offset); + $context = substr($content, $start, $end-$start); + if ( $start > $last_offset ) $context = '...'.$context; + $output .= $context; + $last_offset = $end; + } + + if ( $last_offset != strlen($content)-1 ) $output .= '...'; + } else { + $output = $content; + } + + if ( strlen($output) > $max_length ) { + $end = $max_length-3; + while ( $end > 1 && preg_match('/[A-Za-z0-9\'"-]/', $output{$end-1}) ) $end--; + $output = substr($output, 0, $end) . '...'; + } + + // Highlight matches + $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); + ?> + +

+ +

+

+ Read this entry +

+ + + +
+ $cat->name, 'slug' => $cat->slug ); + echo ', '. $cat->name .''; + } + echo '.'; + } + ?> +
+
+
+
+ + + +
+

+
+ +
+ + +
+
diff --git a/root/parts/archive.php b/root/parts/archive.php deleted file mode 100644 index ef2c76b..0000000 --- a/root/parts/archive.php +++ /dev/null @@ -1,5 +0,0 @@ -
-
- - -
diff --git a/root/parts/front-view.php b/root/parts/front-view.php deleted file mode 100644 index c732b9f..0000000 --- a/root/parts/front-view.php +++ /dev/null @@ -1,19 +0,0 @@ -
-
- -
-
-
- -
-
- - -
- -
- -
-
\ No newline at end of file diff --git a/root/parts/home.php b/root/parts/home.php deleted file mode 100644 index 3dccb05..0000000 --- a/root/parts/home.php +++ /dev/null @@ -1,11 +0,0 @@ -
- -
- - -
- - - diff --git a/root/parts/search.php b/root/parts/search-form.php similarity index 100% rename from root/parts/search.php rename to root/parts/search-form.php diff --git a/root/parts/search-result.php b/root/parts/search-result.php deleted file mode 100644 index 9faa65f..0000000 --- a/root/parts/search-result.php +++ /dev/null @@ -1,111 +0,0 @@ - -
-
- -

Please enter a query in the search box.

- -

Search Results for ""

-
- -
-
- - post_type=='page')) continue; ?> -
-
-
> -
-

- Posted on -
- - - - @'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); - - // Search content for terms - $terms = $wp_query->query_vars['search_terms']; - if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) { - $padding = max($min_padding, $max_length / (2*count($matches[0]))); - - // Construct extract containing context for each term - $output = ''; - $last_offset = 0; - foreach ( $matches[0] as $match ) { - list($string, $offset) = $match; - $start = $offset-$padding; - $end = $offset+strlen($string)+$padding; - // Preserve whole words - while ( $start > 1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$start-1}) ) $start--; - while ( $end < strlen($content)-1 && preg_match('/[A-Za-z0-9\'"-]/', $content{$end}) ) $end++; - $start = max($start, $last_offset); - $context = substr($content, $start, $end-$start); - if ( $start > $last_offset ) $context = '...'.$context; - $output .= $context; - $last_offset = $end; - } - - if ( $last_offset != strlen($content)-1 ) $output .= '...'; - } else { - $output = $content; - } - - if ( strlen($output) > $max_length ) { - $end = $max_length-3; - while ( $end > 1 && preg_match('/[A-Za-z0-9\'"-]/', $output{$end-1}) ) $end--; - $output = substr($output, 0, $end) . '...'; - } - - // Highlight matches - $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); - ?> - -

- -

-

- Read this entry -

- - - -
- $cat->name, 'slug' => $cat->slug ); - echo ', '. $cat->name .''; - } - echo '.'; - } - ?> -
-
-
-
- - - -
-

-
- -
- - -
- diff --git a/root/parts/single.php b/root/parts/single.php deleted file mode 100644 index cd85b7d..0000000 --- a/root/parts/single.php +++ /dev/null @@ -1,36 +0,0 @@ -
-
-
- -
-
-
-
-
> -
-

- - - - - - Posted on -
- -
- -
-
-
-
- - -
-

-
- -
- -
-- 2.17.1