Skip to content

Commit

Permalink
new theme options
Browse files Browse the repository at this point in the history
random featured on home, disable author links, date stamp
  • Loading branch information
ebellempire committed Jun 1, 2023
1 parent 0a94922 commit fc19d28
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
15 changes: 15 additions & 0 deletions curatescape-echo/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ stealth_mode.options.label = "Stealth Mode"
stealth_mode.options.description = "Enable Stealth Mode while in development. Stealth Mode replaces your default homepage with a static informational page. Authenticated users will automatically see the full site. Published pages other than the homepage remain accessible by direct link."
stealth_mode.options.value = "1"

; Show Datestamp
show_datestamp.type = "checkbox"
show_datestamp.options.label = "Show Datestamp"
show_datestamp.options.description = "Check box to show the dates published and modified for each item."
show_datestamp.options.value = "0"

; Link Author Names
author_links.type = "checkbox"
author_links.options.label = "Link Author Names"
author_links.options.description = "Check box to automatically generate author links in each byline."
author_links.options.value = "1"

; contact_email
contact_email.type = "text"
contact_email.options.label = "Email"
Expand Down Expand Up @@ -154,6 +166,7 @@ homepage_featured_order.options.label = "Homepage Featured Selection"
homepage_featured_order.options.description = "Select the order of featured items to display on the homepage."
homepage_featured_order.options.multiOptions.modified = "Modified"
homepage_featured_order.options.multiOptions.added = "Added"
homepage_featured_order.options.multiOptions.random = "Random"
homepage_featured_order.options.multiOptions.none = "None (Do Not Display)"
homepage_featured_order.options.value = "modified"

Expand Down Expand Up @@ -646,6 +659,8 @@ headers.elements[] = "item_topic_tag"

advanced.options.legend = "Advanced"
advanced.elements[] = "enable_dark_mode"
advanced.elements[] = "show_datestamp"
advanced.elements[] = "author_links"
advanced.elements[] = "custom_footer_html"
advanced.elements[] = "custom_css"
advanced.elements[] = "additional_file_1"
Expand Down
14 changes: 8 additions & 6 deletions curatescape-echo/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -1227,12 +1227,14 @@ function rl_the_byline($itemObj='item', $include_sponsor=false)
$authors=metadata($itemObj, array('Dublin Core', 'Creator'), array('all'=>true));
$total=count($authors);
$index=1;
$authlink=1;
$authlink=get_theme_option('author_links');
foreach ($authors as $author) {
if ($authlink==1) {
$href=w3_valid_url('/items/browse?search=&advanced[0][element_id]=39&advanced[0][type]=is+exactly&advanced[0][terms]='.$author);
$author='<a href="'.$href.'">'.$author.'</a>';
if ($authlink > 0) {
$href=w3_valid_url('/items/browse?search=&advanced[0][element_id]=39&advanced[0][type]=is+exactly&advanced[0][terms]='.strip_tags($author));
}else{
$href='javascript:void(0)';
}
$author='<a href="'.$href.'">'.$author.'</a>';
switch ($index) {
case ($total):
$delim ='';
Expand Down Expand Up @@ -1270,10 +1272,10 @@ function rl_item_citation()
*/
function rl_post_date()
{
if (get_theme_option('show_datestamp')==1) {
if (get_theme_option('show_datestamp') > 0) {
$a=format_date(metadata('item', 'added'));
$m=format_date(metadata('item', 'modified'));
return '<div class="item-post-date">'.__('Published on %s.', $a).(($a!==$m) ? ' '.__('Last updated on %s.', $m) : null).'</div>';
return '<div class="item-post-date byline">'.__('Published %s.', $a).(($a!==$m) ? ' '.__('Last updated %s.', $m) : null).'</div>';
}
}

Expand Down
1 change: 1 addition & 0 deletions curatescape-echo/items/show-template-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<?php echo rl_the_subtitle();?>
<div class="separator"></div>
<?php echo rl_the_byline($item, true);?>
<?php echo rl_post_date();?>
</div>
<div class="title-card-image">
<?php echo isset($filesforitem['images'][0]) ? rl_gallery_figure($filesforitem['images'][0], 'featured', '#images') : null;?>
Expand Down

0 comments on commit fc19d28

Please sign in to comment.