Skip to content
Browse files

fixed language code, added language code to displaycomic.php for test…

…ing adjusted the search and archive pages to reduce memory / processing

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
1 parent d3edfdf commit 5672eaeb1e420efad215d165ec516f080f6cd595 Philip M. Hofer (Frumph) committed
Showing with 36 additions and 34 deletions.
  1. +2 −17 archive.php
  2. +9 −1 changelog.txt
  3. +17 −11 functions.php
  4. +6 −0 functions/displaycomic.php
  5. +1 −4 search.php
  6. +1 −1 style.css
View
19 archive.php
@@ -10,27 +10,12 @@
if (isset($wp_query->query_vars['cat'])) $theCatID = (int)$wp_query->query_vars['cat'];
}
-$archive_display_order = comicpress_themeinfo('archive_display_order');
-if (empty($archive_display_order)) $archive_display_order = 'DESC';
-
if (!empty($theCatID) && comicpress_in_comic_category($theCatID)) $is_comic = true;
-$order = '&order='.$archive_display_order;
-
-Protect();
-$tmp_search = new WP_Query($query_string.'&showposts=-1&posts_per_page=-1');
-if (isset($tmp_search->post_count)) {
- $count = $tmp_search->post_count;
-} else {
- $count = "No";
-}
-UnProtect();
-
-$args = $query_string . $post_count . $order;
-$posts = &query_posts($args);
+$count = "No";
if (have_posts()) :
-
+ $count = $wp_query->found_posts;
$post = $posts[0]; // Hack. Set $post so that the_date() works
$post_title_type = $title_string = '';
if ($post->post_type !== 'post') $post_title_type = $post->post_type.'-'; // extra space at the end for visual
View
10 changelog.txt
@@ -1,4 +1,12 @@
-2.9.2.30.2
+2.9.3
+Adjusted how the search and archive pages work to reduce memory load & count
+fixed the language textdomain lines
+
+
+2.9.2.30.3
+$archive_comic_folder was missing as a global, fixed thanks Lilana
+
+2.9.2.30.2
Fix for linkpages class not having a clear:both; on it
2.9.2.30.1
View
28 functions.php
@@ -1,13 +1,7 @@
<?php
-/* DEFINES */
-// xili-language plugin check
-if (class_exists('xili_language')) {
- define('THEME_TEXTDOMAIN','comicpress');
- define('THEME_LANGS_FOLDER', get_template_directory() . '/lang');
-} else {
- load_theme_textdomain( 'comicpress', get_template_directory() . '/lang' );
-}
+// Text domain - Languages location
+load_theme_textdomain( 'comicpress', get_template_directory() . '/lang' );
// the_post_thumbnail('thumbnail/medium/full');
add_theme_support( 'post-thumbnails' );
@@ -21,7 +15,7 @@
if (!isset($content_width)) $content_width = 520;
global $comiccat, $blogcat,
-$comic_folder, $rss_comic_folder, $mini_comic_folder,
+$comic_folder, $rss_comic_folder, $mini_comic_folder, $archive_comic_folder,
$archive_comic_width, $rss_comic_width, $mini_comic_width, $blog_postcount;
if (is_multisite()) {
@@ -214,6 +208,18 @@ function comicpress_remove_blogpostcount_filter() {
}
}
+ add_filter('pre_get_posts', 'comicpress_archive_query');
+ // Set the 'order' of the archive and search
+ function comicpress_archive_query($query) {
+ if (is_archive() || is_search()) {
+ $archive_display_order = comicpress_themeinfo('archive_display_order');
+ if (empty($archive_display_order)) $archive_display_order = 'DESC';
+ $order = '&order='.$archive_display_order;
+ $query->set('order', $archive_display_order);
+ return $query;
+ }
+ }
+
if (comicpress_themeinfo('remove_wptexturize')) {
remove_filter('the_content', 'wptexturize');
}
@@ -508,7 +514,7 @@ function comicpress_themeinfo($whichinfo = null) {
global $comicpress_themeinfo;
if (empty($comicpress_themeinfo) || ($whichinfo == 'reset')) {
- global $comiccat, $blogcat, $comic_folder, $rss_comic_folder, $mini_comic_folder,
+ global $comiccat, $blogcat, $comic_folder, $rss_comic_folder, $mini_comic_folder, $archive_comic_folder,
$archive_comic_width, $rss_comic_width, $mini_comic_width, $blog_postcount;
$comicpress_themeinfo = '';
// $comicpress_config = comicpress_load_config();
@@ -516,7 +522,7 @@ function comicpress_themeinfo($whichinfo = null) {
$comicpress_coreinfo = wp_upload_dir();
$comicpress_addinfo = array(
'upload_path' => get_option('upload_path'),
- 'version' => '2.9.2.30.2',
+ 'version' => '2.9.3',
'siteurl' => trailingslashit(get_option('siteurl')),
'home' => trailingslashit(home_url()),
'comiccat' => $comiccat,
View
6 functions/displaycomic.php
@@ -336,6 +336,12 @@ function get_comic_path($folder = 'comic', $override_post = null, $filter = 'def
case "comic": default: $subfolder_to_use = comicpress_themeinfo('comic_folder'); break;
}
+// comic-en comic-esp etc.. language directories
+ if (function_exists('qtrans_getLanguage')) {
+ $language_to_use = qtrans_getLanguage();
+ $subfolder_to_use = $subfolder_to_use . '-' . $language_to_use;
+ }
+
$folder_to_use = comicpress_themeinfo('basedir') . $subfolder_to_use;
// if (!file_exists($folder_to_use . '/' . $comicfile) && $folder !== 'comic')
View
5 search.php
@@ -1,10 +1,8 @@
<?php
get_header();
remove_filter('pre_get_posts','comicpress_members_filter');
-$archive_display_order = comicpress_themeinfo('archive_display_order');
-$tmp_search = new WP_Query($query_string.'&order=ASC&show_posts=-1&posts_per_page=-1');
-$count = $tmp_search->post_count;
+$count = $wp_query->found_posts;
if (!$count) $count = "no";
?>
<h2 class="pagetitle"><?php _e('Search for &lsquo;','comicpress'); the_search_query(); _e('&rsquo;','comicpress'); ?></h2>
@@ -12,7 +10,6 @@
<?php
if (have_posts()) :
- $posts = &query_posts($query_string.'&order='.$archive_display_order);
while (have_posts()) : the_post();
if (is_category() && comicpress_in_comic_category()) { ?>
View
2 style.css
@@ -6,7 +6,7 @@ Description: Publish a comic with WordPress. Visit the ComicPress Website (<a hr
Author: Philip M. Hofer
Author URI: http://frumph.net
Tags: White, Two-Columns, Three-Columns, left-sidebar, right-sidebar, fixed-width, custom-header, theme-options, threaded-comments, sticky-post, translation-ready
-Version: 2.9.2.30.2
+Version: 2.9.3
License: GNU General Public License, v3 (or newer)
License URI: http://www.opensource.org/licenses/gpl-3.0.html
.

0 comments on commit 5672eae

Please sign in to comment.
Something went wrong with that request. Please try again.