Skip to content

Commit 29182a7

Browse files
committed
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).
1 parent 5279f33 commit 29182a7

12 files changed

+132
-129
lines changed

archives.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
if ($postresults) {
3232
// The month year title things
3333
$text = sprintf('%s %d', $month[zeroise($monthresult->month,2)], $monthresult->year);
34-
$text_id = strtolower(str_replace(" ","",$text));
34+
$text_id = strtolower(str_replace(' ','',$text));
3535
$postcount = count($postresults);
36-
if($postcount=="1") $postcount_text = "post"; else $postcount_text = "posts";
37-
$output .= "<h2 class=\"archive_h2\"><a onclick=\"jQuery('#$text_id').toggle();\">" . $text . "<span> (" . count($postresults) . " ".$postcount_text." )</span></a></h2>";
38-
$output .= "<ul id='$text_id' class='hide'>\n";
36+
if($postcount=='1') $postcount_text = 'post'; else $postcount_text = 'posts';
37+
$output .= '<h2 class="archive_h2"><a onclick="jQuery(\'#$text_id\').toggle();">' . $text . '<span> (' . count($postresults) . ' '.$postcount_text.' )</span></a></h2>';
38+
$output .= "<ul id=\"$text_id\" class=\"hide\">\n";
3939

4040
foreach ($postresults as $postresult) {
4141
if ($postresult->post_date != '0000-00-00 00:00:00') {
@@ -46,9 +46,9 @@
4646
else
4747
$text = $postresult->ID;
4848
$title_text = esc_html($text, 1);
49-
$output .= ' <li>' . mysql2date('m/d', $postresult->post_date) . ':&nbsp;' . "<a href='$url' title='$title_text'>$text</a>";
49+
$output .= ' <li>' . mysql2date('m/d', $postresult->post_date) . ':&nbsp;' . "<a href=\"$url\" title=\"$title_text\">$text</a>";
5050
$output .= '&nbsp;(' . $postresult->comment_count . ' ';
51-
if($postresult->comment_count=="1") $output.= "comment"; else $output.= "comments";
51+
if($postresult->comment_count=='1') $output.= 'comment'; else $output.= 'comments';
5252
$output .= ")</li>\n";
5353
}
5454
}
@@ -57,7 +57,7 @@
5757
}
5858
update_option('hfy_archives_'.$lastpost,$output);
5959
}else{
60-
$output = '<strong>'. __('Not Found','lightword') .'</strong> '. __("Sorry, but you are looking for something that isn't here.","lightword") .'';
60+
$output = '<strong>'. __('Not Found','lightword') .'</strong> '. __('Sorry, but you are looking for something that isn\'t here.','lightword') .'';
6161
}
6262

6363
}
@@ -68,7 +68,7 @@
6868
<?php endwhile; else: ?>
6969

7070
<h2><?php _e('Not Found','lightword'); ?></h2>
71-
<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
71+
<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
7272

7373
<?php endif; ?>
7474

comments.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<h2 style="background:transparent;"><?php comment_form_title( __('Leave a comment', 'lightword'), 'Reply' ); ?></h2>
6666

6767
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
68-
<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>
68+
<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>
6969
<?php else : ?>
7070

7171
<form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform">
@@ -103,8 +103,8 @@
103103
</div>
104104

105105
<div class="tab-content">
106-
<?php if($trackbacks_nr == "0" && pings_open()) { echo "<p class=\"no\">"; ?><?php _e('No trackbacks yet.','lightword'); ?><?php echo "</p>"; } ?>
107-
<?php if(!pings_open()) { echo "<p class=\"no\">"; ?><?php _e('Trackbacks are disabled.','lightword'); ?><?php echo "</p>"; } ?>
106+
<?php if($trackbacks_nr == '0' && pings_open()) { echo '<p class="no">'; ?><?php _e('No trackbacks yet.','lightword'); ?><?php echo '</p>'; } ?>
107+
<?php if(!pings_open()) { echo '<p class="no">'; ?><?php _e('Trackbacks are disabled.','lightword'); ?><?php echo '</p>'; } ?>
108108
<?php foreach ($comments as $comment) : ?>
109109
<?php $comment_type = get_comment_type(); ?>
110110
<?php if($comment_type != 'comment') { ?>

footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<span class="text">
55
<?php
66
$blog_name = '<a href="'.get_bloginfo('url').'">'.get_bloginfo('name').'</a>';
7-
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>')
7+
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>')
88
;?>
99
<?php _e('<a href="http://www.lightworddesign.net/" target="_blank" title="Lightword Theme">Lightword Theme</a> by Andrei Luca','lightword')
1010
;?>

functions.php

+94-94
Large diffs are not rendered by default.

header.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
<div id="top_bar">
2424
<div class="center_menu">
25-
<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; ?>>
25+
<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; ?>>
2626
<?php echo lightword_homebtn(__('Home','lightword')); ?>
2727
<?php
28-
if ( function_exists('wp_nav_menu') && $lw_use_dumb_menu != "true") {
28+
if ( function_exists('wp_nav_menu') && $lw_use_dumb_menu != 'true') {
2929
$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>' ) );
3030
$lightword_menu = preg_replace( array( '/^<ul id="front_menu" class="menu">/', '/\n<\/ul>$/' ), '', $lightword_menu);
3131
echo $lightword_menu;

index.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
66
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
7-
<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
7+
<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
88
<?php lightword_show_sidebox(); ?>
99
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
1010
<?php lightword_simple_date(); ?>
11-
<?php if ($lw_post_author == "Main page" || $lw_post_author == "Both") : ?>
11+
<?php if ($lw_post_author == 'Main page' || $lw_post_author == 'Both') : ?>
1212
<div class="about_author">
1313
<h4><?php _e('Posted by','lightword'); ?> <a href="<?php the_author_meta('url'); ?>"><?php the_author(); ?></a></h4>
1414
</div>
@@ -19,8 +19,8 @@
1919
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
2020

2121
<div class="cat_tags clear">
22-
<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>
23-
<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>
22+
<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>
23+
<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>
2424
</div>
2525
<div class="cat_tags_close"></div>
2626
</div>
@@ -30,7 +30,7 @@
3030
<?php endwhile; else: ?>
3131

3232
<h2><?php _e('Not Found','lightword'); ?></h2>
33-
<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
33+
<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
3434

3535
<?php endif; ?>
3636

page.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div id="content-body">
33
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
44
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
5-
<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
5+
<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
66
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
77
<?php edit_post_link(__('Edit this page','lightword'), '', ''); ?>
88

@@ -11,11 +11,11 @@
1111
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
1212

1313
</div>
14-
<?php if ( comments_open() && $lw_disable_comments == "false" ) : comments_template(); endif; ?>
14+
<?php if ( comments_open() && $lw_disable_comments == 'false' ) : comments_template(); endif; ?>
1515
<?php endwhile; else: ?>
1616

1717
<h2><?php _e('Not Found','lightword'); ?></h2>
18-
<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
18+
<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
1919

2020
<?php endif; ?>
2121
</div>

readme.txt

+3
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,8 @@ CHANGELOG | V2.0.0.6
103103
| Added an option to disable WP3 menus
104104
| Search form should no longer be placed too high when RSS badge is enabled (not removed)
105105

106+
CHANGELOG | V2.0.0.7
107+
| No more invalid HTML with "Show only in posts" sidebox option and comments closed
108+
106109
Best regards,
107110
Andrei Luca

sidebar-child.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* Widgetized sidebar, if you have the plugin installed. */
55

6-
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar Child") ) : ?>
6+
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Child') ) : ?>
77

88

99
<h3><?php _e('Pages','lightword'); ?></h3>

sidebar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/* Widgetized sidebar, if you have the plugin installed. */
66

7-
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar") ) : ?>
7+
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>
88

99

1010
<h3><?php _e('Pages','lightword'); ?></h3>

single-page-template.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<title><?php wp_title('&laquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
1616
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
1717
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
18-
<?php global $lw_layout_settings; if($lw_layout_settings == "Wider") : ?>
18+
<?php global $lw_layout_settings; if($lw_layout_settings == 'Wider') : ?>
1919
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/wider.css" type="text/css" />
2020
<?php else: ?>
2121
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/original.css" type="text/css" />
@@ -34,8 +34,8 @@
3434
<?php lightword_header_image(); ?>
3535
<div id="header">
3636
<?php lightword_rss_feed(); ?>
37-
<?php global $lw_remove_rss; if($lw_remove_rss == "true") { ?>
38-
<?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>"; } ?>
37+
<?php global $lw_remove_rss; if($lw_remove_rss == 'true') {
38+
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>'; } ?>
3939

4040
<div id="top_bar">
4141
<div class="center_menu">
@@ -61,7 +61,7 @@
6161
<div id="content-body">
6262
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
6363
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
64-
<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
64+
<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
6565
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
6666
<?php edit_post_link(__('Edit this page','lightword'), '', ''); ?>
6767

@@ -70,11 +70,11 @@
7070
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
7171

7272
</div>
73-
<?php if ( comments_open() && $lw_disable_comments == "false" ) : comments_template(); endif; ?>
73+
<?php if ( comments_open() && $lw_disable_comments == 'false' ) : comments_template(); endif; ?>
7474
<?php endwhile; else: ?>
7575

7676
<h2><?php _e('Not Found','lightword'); ?></h2>
77-
<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
77+
<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
7878

7979
<?php endif; ?>
8080
</div>

single.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div id="content-body">
33
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
44
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
5-
<div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
5+
<div <?php if (function_exists('post_class')) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
66
<?php lightword_show_sidebox(); ?>
77
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
88
<?php edit_post_link(__('Edit this post','lightword'), '<span class="edit_content">', '</span>'); ?>
@@ -13,21 +13,21 @@
1313
<?php if(function_exists('wp_print')) { print_link(); } ?>
1414
<?php wp_link_pages('before=<div class="nav_link">'.__('PAGES','lightword').': &after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
1515

16-
<?php if ($lw_enjoy_post == "true" && is_attachment() != TRUE) : ?>
16+
<?php if ($lw_enjoy_post == 'true' && is_attachment() != TRUE) : ?>
1717
<div class="promote clear">
1818
<h3><?php _e('Enjoy this article?','lightword'); ?></h3>
1919
<p><a href="<?php bloginfo('rss2_url'); ?>"><?php _e('Consider subscribing to our rss feed!','lightword'); ?></a></p>
2020
</div>
2121
<?php endif; ?>
2222

23-
<?php if ($lw_post_author == "Single page" || $lw_post_author == "Both" && is_attachment() != TRUE) : ?>
23+
<?php if ($lw_post_author == 'Single page' || $lw_post_author == 'Both' && is_attachment() != TRUE) : ?>
2424
<div class="about_author">
2525
<h4><?php _e('Posted by','lightword'); ?> <a href="<?php the_author_meta('url'); ?> "><?php the_author(); ?></a></h4>
2626
</div>
2727
<?php endif; ?>
2828

2929
<div class="cat_tags clear">
30-
<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>
30+
<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>
3131
<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>
3232
</div>
3333
<div class="cat_tags_close"></div>
@@ -46,7 +46,7 @@
4646
<?php endwhile; else: ?>
4747

4848
<h2><?php _e('Not Found','lightword'); ?></h2>
49-
<p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>
49+
<p><?php _e('Sorry, but you are looking for something that isn\'t here.','lightword'); ?></p>
5050

5151
<?php endif; ?>
5252
</div>

0 commit comments

Comments
 (0)