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

Commit

Permalink
STUDIO-9: Move the 'tag summary' code into functions.php; clean up wh…
Browse files Browse the repository at this point in the history
…itespace.
  • Loading branch information
acheetham committed Dec 8, 2011
1 parent 76232c7 commit 7b74d21
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 69 deletions.
4 changes: 2 additions & 2 deletions wp-content/themes/fluid-studios/archive.php
Expand Up @@ -63,9 +63,9 @@

<?php endif; ?>

<?php get_footer(); ?>
<?php get_footer(); ?>

</section><!-- /#nav:content -->

</div><!-- /#content-container -->
</div><!-- /#content-container -->

38 changes: 31 additions & 7 deletions wp-content/themes/fluid-studios/functions.php
Expand Up @@ -151,13 +151,37 @@ function enable_threaded_comments(){


// build an HTML string for a tag
function Studios_build_html($aTag) {
$tag_link = get_tag_link($aTag->term_id);
$html .= "<a href='{$tag_link}' title='{$aTag->name} Tag' class='{$aTag->slug}'>";
$html .= "{$aTag->name}</a>";
return $html;
}

function Studios_build_html($aTag) {
$tag_link = get_tag_link($aTag->term_id);
$html .= "<a href='{$tag_link}' title='{$aTag->name} Tag' class='{$aTag->slug}'>";
$html .= "{$aTag->name}</a>";
return $html;
}

// Build a list of post tags limited to a maximum character length
function get_tags_summary($tagList) {
$html = '';
if ($tagList) {
$html = '<div class="fs-tags post_tags">';
// always display at least the first tag
$firsttag = array_shift($tagList);
$html .= Studios_build_html($firsttag);
$display = "{$firsttag->name}";
foreach($tagList as $tag) {
$newlen = strlen($display) + strlen($tag->name);
// only add next tag if it fits within the limit
if ($newlen < MAX_CHARS_IN_SUMMARY_TAG_LIST) {
$display .= ", {$tag->name}";
$html .= ", ".Studios_build_html($tag);
} else {
// if there are undisplay tags, show ellipses
$html .= "...";
break;
}
}
$html .= '</div>';
}
return $html;
}

?>
52 changes: 26 additions & 26 deletions wp-content/themes/fluid-studios/header.php
Expand Up @@ -61,10 +61,10 @@
<body id="nav:page-top" <?php body_class('fl-fix'); ?>>

<div class="flc-uiOptions-fatPanel fl-uiOptions-fatPanel">
<!-- This is the div that will contain the UI Options component -->
<div id="myUIOptions" class="flc-slidingPanel-panel flc-uiOptions-iframe fs-uiOptions-panel"></div>
<!-- This is the div that will contain the UI Options component -->
<div id="myUIOptions" class="flc-slidingPanel-panel flc-uiOptions-iframe fs-uiOptions-panel"></div>

<!-- This div is for the sliding panel that shows and hides the UI Options controls -->
<!-- This div is for the sliding panel that shows and hides the UI Options controls -->
<div class="fl-panelBar">
<button class="flc-slidingPanel-toggleButton fl-toggleButton">Show display preferences</button>
</div>
Expand All @@ -74,30 +74,30 @@
<div class="flc-toc-tocContainer toc"> </div>

<script type="text/javascript">
// Instantiate the UI Enhancer component, specifying the table of contents' template URL
fluid.pageEnhancer({
tocTemplate: "<?php bloginfo('template_url'); ?>/infusion/components/tableOfContents/html/TableOfContents.html",
classnameMap: {
theme: {
"default": "fluid-studios-theme"
}
}
});
// Start up UI Options
fluid.uiOptions.fatPanel(".flc-uiOptions-fatPanel", {
prefix: "<?php bloginfo('template_url'); ?>/infusion/components/uiOptions/html/",
slidingPanel: {
options: {
strings: {
showText: "Show Display Preferences",
hideText: "Hide Display Preferences"
}
}
}
});
// Instantiate the UI Enhancer component, specifying the table of contents' template URL
fluid.pageEnhancer({
tocTemplate: "<?php bloginfo('template_url'); ?>/infusion/components/tableOfContents/html/TableOfContents.html",
classnameMap: {
theme: {
"default": "fluid-studios-theme"
}
}
});
// Start up UI Options
fluid.uiOptions.fatPanel(".flc-uiOptions-fatPanel", {
prefix: "<?php bloginfo('template_url'); ?>/infusion/components/uiOptions/html/",
slidingPanel: {
options: {
strings: {
showText: "Show Display Preferences",
hideText: "Hide Display Preferences"
}
}
}
});
</script>

<div class="fs-loginout-link">
<?php wp_loginout(); ?>
<?php wp_loginout(); ?>
</div>
2 changes: 1 addition & 1 deletion wp-content/themes/fluid-studios/inc/sidebar-common.php
@@ -1,3 +1,3 @@
<div class="fs-fluidstudio-logo fl-push">
<a href="<?php echo esc_url(get_home_url()); ?>" title="Fluid Studios logo" class="fl-hidden-replace">Fluid Studios</a>
<a href="<?php echo esc_url(get_home_url()); ?>" title="Fluid Studios logo" class="fl-hidden-replace">Fluid Studios</a>
</div>
25 changes: 1 addition & 24 deletions wp-content/themes/fluid-studios/inc/single-post-summary.php
Expand Up @@ -17,30 +17,7 @@
<?php echo the_excerpt(); ?>
</section><!-- /.entry-content -->
<footer class="entry-utility">
<?php
$tags = get_the_tags();
if ($tags) {
$html = '<div class="fs-tags post_tags">';
// always display at least the first tag
$firsttag = array_shift($tags);
$html .= Studios_build_html($firsttag);
$display = "{$firsttag->name}";
foreach($tags as $tag) {
$newlen = strlen($display) + strlen($tag->name);
// only add next tag if it fits within the limit
if ($newlen < MAX_CHARS_IN_SUMMARY_TAG_LIST) {
$display .= ", {$tag->name}";
$html .= ", ".Studios_build_html($tag);
} else {
// if there are undisplay tags, show ellipses
$html .= "...";
break;
}
}
$html .= '</div>';
echo $html;
}
?>
<?php echo get_tags_summary(get_the_tags()); ?>
</footer><!-- /.entry-utility -->
</article><!-- /#post-<?php the_ID(); ?> -->

2 changes: 1 addition & 1 deletion wp-content/themes/fluid-studios/index.php
Expand Up @@ -35,6 +35,6 @@

</section><!-- /#nav:content -->

<?php get_footer(); ?>
<?php get_footer(); ?>

</div><!-- /#content-container -->
4 changes: 2 additions & 2 deletions wp-content/themes/fluid-studios/page.php
Expand Up @@ -32,8 +32,8 @@

<?php endif; ?>

<?php get_footer(); ?>
<?php get_footer(); ?>

</section><!-- /#nav:content -->

</div><!-- /#content-container -->
</div><!-- /#content-container -->
4 changes: 2 additions & 2 deletions wp-content/themes/fluid-studios/search.php
Expand Up @@ -58,8 +58,8 @@

<?php endif; ?>

<?php get_footer(); ?>
<?php get_footer(); ?>

</section><!-- /#nav:content -->

</div><!-- /#content-container -->
</div><!-- /#content-container -->
2 changes: 1 addition & 1 deletion wp-content/themes/fluid-studios/sidebar-non-index.php
@@ -1,4 +1,4 @@
<div class="sidebarback"> </div>
<div class="sidebarback"> </div>
<aside id="sidebar" class="fl-clearfix fl-col-side" role="complementary">
<?php include (TEMPLATEPATH . '/inc/sidebar-common.php' ); ?>

Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/fluid-studios/sidebar.php
@@ -1,4 +1,4 @@
<div class="sidebarback"> </div>
<div class="sidebarback"> </div>
<aside id="sidebar" class="fl-clearfix fl-col-side" role="complementary">
<?php include (TEMPLATEPATH . '/inc/sidebar-common.php' ); ?>
</aside><!-- /#sidebar -->
4 changes: 2 additions & 2 deletions wp-content/themes/fluid-studios/single.php
Expand Up @@ -29,6 +29,6 @@

</section><!-- /#nav:content -->

<?php get_footer(); ?>
<?php get_footer(); ?>

</div><!-- /#content-container -->
</div><!-- /#content-container -->

0 comments on commit 7b74d21

Please sign in to comment.