Skip to content

Commit

Permalink
minor: tour builder tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ebellempire committed Nov 8, 2022
1 parent 1b3b6ec commit 8e83fcc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion curatescape-echo/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ function rl_homepage_recent_random($num=3,$html=null,$index=1)
function rl_homepage_tags($num=25)
{
if(get_theme_option("homepage_tags") == "1"){
$tags=get_records('Tag', array('sort_field' => 'count', 'sort_dir' => 'd'), $num);
$tags=get_records('Tag', array('sort_field' => 'count', 'sort_dir' => 'd','type'=>'item'), $num);
if(count($tags)){
$html = '<h2 class="query-header">'.__('Popular Tags').'</h2>';
$html.=tag_cloud($tags, 'items/browse');
Expand Down
16 changes: 11 additions & 5 deletions curatescape-echo/tour-builder/tours/browse.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?php
$label=rl_tour_label('plural');
if (isset($_GET['tags'])) {
$title = __('%1$s tagged "%2$s"', rl_tour_label('plural'), htmlspecialchars($_GET['tags']));
$title = __('%1$s tagged "%2$s": %3$s', rl_tour_label('plural'), htmlspecialchars($_GET['tags']),'<span class="item-number">'.total_tours().'</span>');
$title_facet = ' | '.htmlspecialchars($_GET['tags']);
$scroll_to = 'content';
}elseif (isset($_GET['featured']) && $_GET['featured'] == 1) {
$title = __('Featured %1$s: %2$s', $label, total_tours());
$title = __('Featured %1$s: %2$s', $label, '<span class="item-number">'.total_tours().'</span>');
$title_facet = ' | '.__('Featured');
$scroll_to = null;
} else {
$title = __('All %1$s: %2$s', $label, total_tours());
$title = __('All %1$s: %2$s', $label, '<span class="item-number">'.total_tours().'</span>');
$title_facet = null;
$scroll_to = null;
}
$sort_field = (isset($_GET['sort_field']) ? htmlspecialchars($_GET['sort_field']) : null);
$sort_dir = (isset($_GET['sort_dir']) ? htmlspecialchars($_GET['sort_dir']) : null);
Expand Down Expand Up @@ -36,13 +42,13 @@
echo head(
array(
'maptype'=>'none',
'title' => $label,
'title' => $label.$title_facet,
'bodyid'=>'tours',
'bodyclass' => 'browse' )
);

?>
<div id="content" role="main">
<div id="content" role="main" data-scrollto="<?php echo $scroll_to;?>">
<article class="browse tour">
<div class="browse-header">
<h2 class="query-header"><?php echo $title;?></h2>
Expand Down
4 changes: 2 additions & 2 deletions curatescape-echo/tour-builder/tours/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
if (!isset($_GET["sort_field"])) {
$tags=get_records('Tag', array('sort_field' => 'count', 'sort_dir' => 'd', 'type'=>'tour'), 0);
}
echo head(array('maptype'=>'none', 'title'=>__('Browse by Tag'),'bodyid'=>'tours','bodyclass'=>'browse tags'));
echo head(array('maptype'=>'none', 'title'=>__('%s Tags',rl_tour_label()),'bodyid'=>'tours','bodyclass'=>'browse tags'));
?>
<div id="content" role="main">
<article class="browse tags">
<div class="browse-header">
<h2 class="query-header"><?php echo __('Tags: %s', count($tags));?></h2>
<h2 class="query-header"><?php echo __('%1s Tags: %2s', rl_tour_label(), count($tags));?></h2>
<nav class="secondary-nav" id="tag-browse">
<?php rl_tour_browse_subnav(); ?>
</nav>
Expand Down

0 comments on commit 8e83fcc

Please sign in to comment.