Permalink
Browse files

Quote cleanup; fix invalid HTML in one case

More swapping of " for ' on strings that don't need the extra
processing provided by using "double quotes".

Fixed a case in the sidebox settings that would generate invalid
HTML (missing a closing </a>) under certain conditions.

Removed references to deleted variable $shortname from
functions.php (merged in with 'updatehandler' branch).
  • Loading branch information...
1 parent 5279f33 commit 29182a70350b8454fe261d5ca9990f5da76444bc @dgw committed Jan 11, 2011
Showing with 132 additions and 129 deletions.
  1. +8 −8 archives.php
  2. +3 −3 comments.php
  3. +1 −1 footer.php
  4. +94 −94 functions.php
  5. +2 −2 header.php
  6. +5 −5 index.php
  7. +3 −3 page.php
  8. +3 −0 readme.txt
  9. +1 −1 sidebar-child.php
  10. +1 −1 sidebar.php
  11. +6 −6 single-page-template.php
  12. +5 −5 single.php
View
@@ -31,11 +31,11 @@
if ($postresults) {
// The month year title things
$text = sprintf('%s %d', $month[zeroise($monthresult->month,2)], $monthresult->year);
- $text_id = strtolower(str_replace(" ","",$text));
+ $text_id = strtolower(str_replace(' ','',$text));
$postcount = count($postresults);
- if($postcount=="1") $postcount_text = "post"; else $postcount_text = "posts";
- $output .= "<h2 class=\"archive_h2\"><a onclick=\"jQuery('#$text_id').toggle();\">" . $text . "<span> (" . count($postresults) . " ".$postcount_text." )</span></a></h2>";
- $output .= "<ul id='$text_id' class='hide'>\n";
+ if($postcount=='1') $postcount_text = 'post'; else $postcount_text = 'posts';
+ $output .= '<h2 class="archive_h2"><a onclick="jQuery(\'#$text_id\').toggle();">' . $text . '<span> (' . count($postresults) . ' '.$postcount_text.' )</span></a></h2>';
+ $output .= "<ul id=\"$text_id\" class=\"hide\">\n";
foreach ($postresults as $postresult) {
if ($postresult->post_date != '0000-00-00 00:00:00') {
@@ -46,9 +46,9 @@
else
$text = $postresult->ID;
$title_text = esc_html($text, 1);
- $output .= ' <li>' . mysql2date('m/d', $postresult->post_date) . ':&nbsp;' . "<a href='$url' title='$title_text'>$text</a>";
+ $output .= ' <li>' . mysql2date('m/d', $postresult->post_date) . ':&nbsp;' . "<a href=\"$url\" title=\"$title_text\">$text</a>";
$output .= '&nbsp;(' . $postresult->comment_count . ' ';
- if($postresult->comment_count=="1") $output.= "comment"; else $output.= "comments";
+ if($postresult->comment_count=='1') $output.= 'comment'; else $output.= 'comments';
$output .= ")</li>\n";
}
}
@@ -57,7 +57,7 @@
}
update_option('hfy_archives_'.$lastpost,$output);
}else{
- $output = '<strong>'. __('Not Found','lightword') .'</strong> '. __("Sorry, but you are looking for something that isn't here.","lightword") .'';
+ $output = '<strong>'. __('Not Found','lightword') .'</strong> '. __('Sorry, but you are looking for something that isn\'t here.','lightword') .'';
}
}
@@ -68,7 +68,7 @@
<?php endwhile; else: ?>
<h2><?php _e('Not Found','lightword'); ?></h2>
-<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
+<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
<?php endif; ?>
View
@@ -65,7 +65,7 @@
<h2 style="background:transparent;"><?php comment_form_title( __('Leave a comment', 'lightword'), 'Reply' ); ?></h2>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
-<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.','lightword'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?></p>
+<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.','lightword'), get_option('siteurl').'/wp-login.php?redirect_to='.urlencode(get_permalink()));?></p>
<?php else : ?>
<form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform">
@@ -103,8 +103,8 @@
</div>
<div class="tab-content">
-<?php if($trackbacks_nr == "0" && pings_open()) { echo "<p class=\"no\">"; ?><?php _e('No trackbacks yet.','lightword'); ?><?php echo "</p>"; } ?>
-<?php if(!pings_open()) { echo "<p class=\"no\">"; ?><?php _e('Trackbacks are disabled.','lightword'); ?><?php echo "</p>"; } ?>
+<?php if($trackbacks_nr == '0' && pings_open()) { echo '<p class="no">'; ?><?php _e('No trackbacks yet.','lightword'); ?><?php echo '</p>'; } ?>
+<?php if(!pings_open()) { echo '<p class="no">'; ?><?php _e('Trackbacks are disabled.','lightword'); ?><?php echo '</p>'; } ?>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
View
@@ -4,7 +4,7 @@
<span class="text">
<?php
$blog_name = '<a href="'.get_bloginfo('url').'">'.get_bloginfo('name').'</a>';
-printf(__('Copyright %s %s %s &middot; Powered by %s <br/>','lightword'),'&copy;',date('Y'),$blog_name,'<a href="http://www.wordpress.org" title="WordPress" target="_blank">WordPress</a>')
+printf(__('Copyright %s %s %s &middot; Powered by %s <br/>','lightword'),'&copy;',date('Y'),$blog_name,'<a href="http://www.wordpress.org/" title="WordPress" target="_blank">WordPress</a>')
;?>
<?php _e('<a href="http://www.lightworddesign.net/" target="_blank" title="Lightword Theme">Lightword Theme</a> by Andrei Luca','lightword')
;?>
View
Oops, something went wrong.
View
@@ -22,10 +22,10 @@
<div id="top_bar">
<div class="center_menu">
-<ul id="front_menu" <?php global $lw_remove_searchbox, $lw_use_dumb_menu; $lw_menu_width = ""; if($lw_remove_searchbox == "true") $lw_menu_width = " class=\"expand\" "; echo $lw_menu_width; ?>>
+<ul id="front_menu" <?php global $lw_remove_searchbox, $lw_use_dumb_menu; $lw_menu_width = ''; if($lw_remove_searchbox == 'true') $lw_menu_width = ' class="expand" '; echo $lw_menu_width; ?>>
<?php echo lightword_homebtn(__('Home','lightword')); ?>
<?php
-if ( function_exists('wp_nav_menu') && $lw_use_dumb_menu != "true") {
+if ( function_exists('wp_nav_menu') && $lw_use_dumb_menu != 'true') {
$lightword_menu = wp_nav_menu( array( 'menu' => 'lightword_top_menu', 'echo' => false, 'menu_id' => 'front_menu', 'container' => '', 'theme_location' => 'lightword_top_menu', 'link_before' => '<span>', 'link_after' => '</span>' ) );
$lightword_menu = preg_replace( array( '/^<ul id="front_menu" class="menu">/', '/\n<\/ul>$/' ), '', $lightword_menu);
echo $lightword_menu;
View
@@ -4,11 +4,11 @@
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
-<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
+<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
<?php lightword_show_sidebox(); ?>
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php lightword_simple_date(); ?>
-<?php if ($lw_post_author == "Main page" || $lw_post_author == "Both") : ?>
+<?php if ($lw_post_author == 'Main page' || $lw_post_author == 'Both') : ?>
<div class="about_author">
<h4><?php _e('Posted by','lightword'); ?> <a href="<?php the_author_meta('url'); ?>"><?php the_author(); ?></a></h4>
</div>
@@ -19,8 +19,8 @@
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
<div class="cat_tags clear">
-<span class="category"><?php if($lw_disable_tags == "true" || !get_the_tags()) { _e('Filed under:','lightword'); echo " "; the_category(', ');} else if (get_the_tags() && $lw_disable_tags == "false") { _e('Tagged as:','lightword'); echo " "; the_tags(''); } ?></span>
-<span class="continue"><?php $pos = strpos($post->post_content, '<!--more-->'); if($pos==''){ ?><a class="nr_comm_spot" href="<?php the_permalink(); ?>#comments"><?php if(lightword_fb_get_comment_type_count('comment')==1) _e('1 Comment','lightword'); elseif('open' != $post->comment_status) _e('Comments Off','lightword'); elseif(lightword_fb_get_comment_type_count('comment') == 0) _e('No Comments','lightword'); else echo lightword_fb_get_comment_type_count('comment')." ".__('Comments','lightword'); ?></a><?php }else{ ?><a title="<?php _e('Read more about','lightword'); ?> <?php the_title(); ?>" href="<?php the_permalink() ?>#more-<?php echo $id; ?>"><?php _e('Continue reading','lightword'); ?></a><?php } ?></span><div class="clear"></div>
+<span class="category"><?php if($lw_disable_tags == 'true' || !get_the_tags()) { _e('Filed under:','lightword'); echo ' '; the_category(', ');} else if (get_the_tags() && $lw_disable_tags == 'false') { _e('Tagged as:','lightword'); echo ' '; the_tags(''); } ?></span>
+<span class="continue"><?php $pos = strpos($post->post_content, '<!--more-->'); if($pos==''){ ?><a class="nr_comm_spot" href="<?php the_permalink(); ?>#comments"><?php if(lightword_fb_get_comment_type_count('comment')==1) _e('1 Comment','lightword'); elseif('open' != $post->comment_status) _e('Comments Off','lightword'); elseif(lightword_fb_get_comment_type_count('comment') == 0) _e('No Comments','lightword'); else echo lightword_fb_get_comment_type_count('comment').' '.__('Comments','lightword'); ?></a><?php }else{ ?><a title="<?php _e('Read more about','lightword'); ?> <?php the_title(); ?>" href="<?php the_permalink() ?>#more-<?php echo $id; ?>"><?php _e('Continue reading','lightword'); ?></a><?php } ?></span><div class="clear"></div>
</div>
<div class="cat_tags_close"></div>
</div>
@@ -30,7 +30,7 @@
<?php endwhile; else: ?>
<h2><?php _e('Not Found','lightword'); ?></h2>
-<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
+<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
<?php endif; ?>
View
@@ -2,7 +2,7 @@
<div id="content-body">
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
-<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
+<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php edit_post_link(__('Edit this page','lightword'), '', ''); ?>
@@ -11,11 +11,11 @@
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
</div>
-<?php if ( comments_open() && $lw_disable_comments == "false" ) : comments_template(); endif; ?>
+<?php if ( comments_open() && $lw_disable_comments == 'false' ) : comments_template(); endif; ?>
<?php endwhile; else: ?>
<h2><?php _e('Not Found','lightword'); ?></h2>
-<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
+<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
<?php endif; ?>
</div>
View
@@ -103,5 +103,8 @@ CHANGELOG | V2.0.0.6
| Added an option to disable WP3 menus
| Search form should no longer be placed too high when RSS badge is enabled (not removed)
+CHANGELOG | V2.0.0.7
+| No more invalid HTML with "Show only in posts" sidebox option and comments closed
+
Best regards,
Andrei Luca
View
@@ -3,7 +3,7 @@
/* Widgetized sidebar, if you have the plugin installed. */
-if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar Child") ) : ?>
+if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Child') ) : ?>
<h3><?php _e('Pages','lightword'); ?></h3>
View
@@ -4,7 +4,7 @@
/* Widgetized sidebar, if you have the plugin installed. */
-if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar") ) : ?>
+if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>
<h3><?php _e('Pages','lightword'); ?></h3>
@@ -15,7 +15,7 @@
<title><?php wp_title('&laquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
-<?php global $lw_layout_settings; if($lw_layout_settings == "Wider") : ?>
+<?php global $lw_layout_settings; if($lw_layout_settings == 'Wider') : ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/wider.css" type="text/css" />
<?php else: ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/original.css" type="text/css" />
@@ -34,8 +34,8 @@
<?php lightword_header_image(); ?>
<div id="header">
<?php lightword_rss_feed(); ?>
-<?php global $lw_remove_rss; if($lw_remove_rss == "true") { ?>
-<?php echo "<style type=\"text/css\">/*<![CDATA[*/ #header{background:transparent url(".get_template_directory_uri()."/images/single-page-template/content_top_no_rss.png) no-repeat; } #content-body,x:-moz-any-link{float:left;margin-right:28px;}#content-body, x:-moz-any-link, x:default{float:none;margin-right:25px;}/*]]>*/</style>"; } ?>
+<?php global $lw_remove_rss; if($lw_remove_rss == 'true') {
+ echo '<style type="text/css">/*<![CDATA[*/ #header{background:transparent url('.get_template_directory_uri().'/images/single-page-template/content_top_no_rss.png) no-repeat; } #content-body,x:-moz-any-link{float:left;margin-right:28px;}#content-body, x:-moz-any-link, x:default{float:none;margin-right:25px;}/*]]>*/</style>'; } ?>
<div id="top_bar">
<div class="center_menu">
@@ -61,7 +61,7 @@
<div id="content-body">
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
-<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
+<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php edit_post_link(__('Edit this page','lightword'), '', ''); ?>
@@ -70,11 +70,11 @@
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
</div>
-<?php if ( comments_open() && $lw_disable_comments == "false" ) : comments_template(); endif; ?>
+<?php if ( comments_open() && $lw_disable_comments == 'false' ) : comments_template(); endif; ?>
<?php endwhile; else: ?>
<h2><?php _e('Not Found','lightword'); ?></h2>
-<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
+<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
<?php endif; ?>
</div>
View
@@ -2,7 +2,7 @@
<div id="content-body">
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
-<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
+<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
<?php lightword_show_sidebox(); ?>
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php edit_post_link(__('Edit this post','lightword'), '<span class="edit_content">', '</span>'); ?>
@@ -13,21 +13,21 @@
<?php if(function_exists('wp_print')) { print_link(); } ?>
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
-<?php if ($lw_enjoy_post == "true" && is_attachment() != TRUE) : ?>
+<?php if ($lw_enjoy_post == 'true' && is_attachment() != TRUE) : ?>
<div class="promote clear">
<h3><?php _e('Enjoy this article?','lightword'); ?></h3>
<p><a href="<?php bloginfo('rss2_url'); ?>"><?php _e('Consider subscribing to our rss feed!','lightword'); ?></a></p>
</div>
<?php endif; ?>
-<?php if ($lw_post_author == "Single page" || $lw_post_author == "Both" && is_attachment() != TRUE) : ?>
+<?php if ($lw_post_author == 'Single page' || $lw_post_author == 'Both' && is_attachment() != TRUE) : ?>
<div class="about_author">
<h4><?php _e('Posted by','lightword'); ?> <a href="<?php the_author_meta('url'); ?> "><?php the_author(); ?></a></h4>
</div>
<?php endif; ?>
<div class="cat_tags clear">
-<span class="category"><?php if($lw_disable_tags == "true" || !get_the_tags()) { _e('Filed under:','lightword'); echo " "; the_category(', ');} else if (get_the_tags() && $lw_disable_tags == "false") { _e('Tagged as:','lightword'); echo " "; the_tags(''); } ?></span>
+<span class="category"><?php if($lw_disable_tags == 'true' || !get_the_tags()) { _e('Filed under:','lightword'); echo ' '; the_category(', ');} else if (get_the_tags() && $lw_disable_tags == 'false') { _e('Tagged as:','lightword'); echo ' '; the_tags(''); } ?></span>
<span class="continue"><a class="nr_comm_spot" href="<?php the_permalink(); ?>#respond"><?php if('open' != $post->comment_status) _e('Comments Off','lightword'); else _e('Leave a comment','lightword'); ?></a></span><div class="clear"></div>
</div>
<div class="cat_tags_close"></div>
@@ -46,7 +46,7 @@
<?php endwhile; else: ?>
<h2><?php _e('Not Found','lightword'); ?></h2>
-<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
+<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
<?php endif; ?>
</div>

0 comments on commit 29182a7

Please sign in to comment.