Skip to content

Commit

Permalink
Paradigm version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kuz-z-zma committed Nov 25, 2023
1 parent 00e9bb2 commit 707794d
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 97 deletions.
32 changes: 10 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@ Since I’ve updated this theme to fix usage of depreciated functions and added

New additions include: more flexibility for displaying content.

version 1.3 and 1.3.1:
version 1.4:

- Cleaned up and structured Theme Options.
- Control how many News Items are shown on Homepage.
- Control if Dropdown Menus are shown, separately for Albums, News, Pages.
- Option to display mix of Albums and various sets of Images on Homepage.
- Optional Sidebar in Archive.
- If Print_album_menu is enabled, Album List it’s shown in Sidebar for Contact, Search and Credits pages.
- Optional Popular Tags in Sidebar.
- Control how Popular Tags are displayed.
- Extended “Copyright Notice” field (HTML allowed), displayed on Image and Credits pages.
- Additional “Homepage Message” field (HTML allowed), to display on Homepage.
- Option to display “Gallery Description” as tagline under Text Logo in Header.
- Fixed noindex/nofollow for Tags pages.
- Favicon in [website root] folder will be linked in the Head section.
- If you use IMG Logo in Header, it will be automatically included as OpenGraph and Twitter Preview Image for Homepage.
- If logo not selected: img.png in [website root]/uploaded folder will used.
- Preview Images for other pages for OpenGraph and Twitter cards either use Default Size for Images in gallery or 800px width.
- Added glyphicons from Bootstap to Headings for more uniform look.
- New optional pages: Explore (lists all used Tags) and Sitemap (lists all News Categories, Pages and all Albums).
- Some code clean-up and updates for mobile presentation.
- fix getMainSiteURL() (depreciated function) in header, footer and breadcrumbs.
- fixed breadcrumbs for uniform look on all pages with home icon.
- Added option to assign rel=”nofollow” to Tags links (works on every page, where they are displayed).
- Added option to specify length to News Items on Homepage.
- Added option to enable Album Descriptions on Homepage.
- If Album Custom Data is present – it is shown in full, if it is not available, Album Description is used.
- Added option to specify length of Album Descriptions on Homepage.
- Fixed H1 on News Archive pages.
- Added sorting parameters to Archive list.
- Some code clean-up.
- Changed theme preview.
2 changes: 1 addition & 1 deletion album.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<?php
if (getTags()) {
echo '<div id="tags" class="block"><h2><i class="glyphicon glyphicon-tag"></i>' . gettext('Tags') . '</h2>';
printTags_zb('links', '', 'taglist', ', ');
printTags_zb('links', '', 'taglist', ', ', getOption('tags-seo-nofollow'));
echo '</div>';
}
?>
Expand Down
4 changes: 2 additions & 2 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

<h1><i class="glyphicon glyphicon-calendar"></i><?php echo gettext('Archive'); ?></h1>
<h2 itemprop="name"><?php echo gettext('Gallery archive'); ?></h2>
<div class="columns"><?php printAllDates(); ?></div>
<div class="columns"><?php printAllDates('archive','year','month','asc'); ?></div>

<hr />

<?php if (function_exists("printNewsArchive")) { ?>
<h2><?php echo gettext('News archive'); ?></h2>
<div class="columns">
<?php printNewsArchive("archive"); ?>
<?php printNewsArchive('archive', 'year', 'month', "archive-active", false, 'asc'); ?>
</div>
<hr />
<?php } ?>
Expand Down
14 changes: 10 additions & 4 deletions css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@
background: #e5e5e5;
}
/*===== Title =====*/
#logo-text {
#logo-text h1 {
font-size: 2em;
margin: 30px 10px 10px;
font-weight: 700;
text-transform: uppercase;
}
#logo-text h2 {
font-size: 2em;
margin: 30px 10px 10px;
font-weight: 700;
text-transform: uppercase;
}
#logo-text a {text-decoration: none;}
#logo-text a:hover, header h1 a:focus {text-decoration: none;}
#logo-text a:hover, header h1 a:focus, header h2 a:focus {text-decoration: none;}

.tagline {
font-size:90%;
Expand Down Expand Up @@ -297,7 +304,6 @@ h2.media-heading i {
border-radius: 3px;
max-width: 100%;
height: auto;
margin:20px auto;
}
.media-object {
margin-left: 10px;
Expand Down Expand Up @@ -361,7 +367,7 @@ hr {
.feat-image {max-width:100%;height:auto;margin:20px auto;display:block;float:none;clear:both;}
.feat-image-home {max-width:100%;width:auto;height:auto;margin:20px auto;display:block;float:none;clear:both;}
.col-lg-4 {display:block;float:none;clear:both;}
.media-body {height:100%;overflow:visible;height:fit-content (20em);display:block;}
.media-body {height:100%;overflow:visible;display:block;}
.media-object {max-width:100%;width:auto;height:auto;margin:20px auto;display:block;float:none;clear:both;}
}

Expand Down
2 changes: 1 addition & 1 deletion explore.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<h1 itemprop="name"><i class="glyphicon glyphicon-tags"></i>Tags</h1>
<?php if (getAllTagsCount() >0) { ?>
<div id="sitemap-tags">
<?php printAllTagsAs_zb('cloud', 'list', 'abc', false, true,1,2,1, null); ?>
<?php printAllTagsAs_zb('cloud', 'list', 'abc', false, true,1,1,0,null,1,getOption('tags-seo-nofollow')); ?>
</div>
<?php } ?>

Expand Down
2 changes: 1 addition & 1 deletion favorites.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<h1><?php printAlbumTitle(); ?></h1>
<p class="lead"><?php printAlbumDesc(); ?></p>

<?php include("includes/_albums.php"); ?>
<?php include("includes/_albumlist.php"); ?>

<?php printAddToFavorites($_zp_current_album, '', gettext('Remove')); ?>

Expand Down
21 changes: 16 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
* @param string $separator what charactor shall separate the tags
* @since 1.1
*/
function printTags_zb($option = 'links', $preText = NULL, $class = NULL, $separator = ', ') {
function printTags_zb($option = 'links', $preText = NULL, $class = NULL, $separator = ', ', $nofollow=FALSE) {
global $_zp_current_search;
if (is_null($class)) {
$class = 'taglist';
}
if (!$nofollow) {
$nofollow = "";
} else {
$nofollow = " rel=\"nofollow\"";
}
$singletag = getTags();
$tagstring = implode(', ', $singletag);
if ($tagstring === '' or $tagstring === NULL) {
Expand Down Expand Up @@ -47,7 +52,7 @@ function printTags_zb($option = 'links', $preText = NULL, $class = NULL, $separa
$separator = "";
}
if ($option === "links") {
$links1 = "<a href=\"" . html_encode(SearchEngine::getSearchURL(($atag),'', 'tags', 0, array('albums' => $albumlist))) . "\" title=\"" . html_encode($atag) . "\" >";
$links1 = "<a href=\"" . html_encode(SearchEngine::getSearchURL(($atag),'', 'tags', 0, array('albums' => $albumlist))) . "\" title=\"" . html_encode($atag) . "\"$nofollow>";
$links2 = "</a>";
} else {
$links1 = $links2 = '';
Expand Down Expand Up @@ -75,12 +80,18 @@ function printTags_zb($option = 'links', $preText = NULL, $class = NULL, $separa
* @param int $minfontsize minimum font size the cloud should display
* @since 1.1
*/
function printAllTagsAs_zb ($option,$class='',$sort='abc',$counter=FALSE,$links=TRUE,$maxfontsize=2,$maxcount=50,$mincount=15, $limit=NULL,$minfontsize=0.8) {
function printAllTagsAs_zb ($option,$class='',$sort='abc',$counter=FALSE,$links=TRUE,$maxfontsize=2,$maxcount=50,$mincount=15,$limit=NULL,$minfontsize=0.8,$nofollow=FALSE) {
global $_zp_current_search;
$option = strtolower($option);
if ($class != "") {
$class = "class=\"".$class."\"";
}
if (!$nofollow) {
$nofollow = "";
}
else {
$nofollow = "rel=\"nofollow\"";
}
$tagcount = getAllTagsCount();
if (!is_array($tagcount)) { return false; }
if ($sort == "results") {
Expand Down Expand Up @@ -116,7 +127,7 @@ function printAllTagsAs_zb ($option,$class='',$sort='abc',$counter=FALSE,$links=
$albumlist = NULL;
}
$list .= "\t<li><a href=\"".
html_encode(SearchEngine::getSearchURL($key, '', 'tags', 0, array('albums'=>$albumlist)))."\"$size >".
html_encode(SearchEngine::getSearchURL($key, '', 'tags', 0, array('albums'=>$albumlist)))."\"$size $nofollow>".
$key.$counter."</a></li>\n";
} else {
$list .= "\t<li$size>".$key.$counter."</li>\n";
Expand Down Expand Up @@ -238,7 +249,7 @@ function printImageMetadata_zb() {
return;
}
?>
<table class="table table-striped itemprop="exifData"">
<table class="table table-striped" itemprop="exifData"">
<?php
foreach ($exif as $field => $value) {
$label = $_zp_exifvars[$field][2];
Expand Down
2 changes: 1 addition & 1 deletion image.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<?php
if (getTags()) {
echo '<h2><i class="glyphicon glyphicon-tag"></i>' . gettext('Tags') . '</h2>';
printTags_zb('links', '', 'taglist', ', ');
printTags_zb('links', '', 'taglist', ', ',getOption('tags-seo-nofollow'));
}
?>

Expand Down
9 changes: 8 additions & 1 deletion includes/_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
</div>
<div class="col-sm-3 text-right" id="social">
<p>
<?php if (class_exists('RSS')) { ?>
<?php if (class_exists('RSS')) { ?>
<?php if (($_zp_gallery_page == 'news.php') && (getOption('RSS_articles'))) {
printRSSLink('News','',gettext('RSS News'),'',false);
} elseif ((getOption('RSS_pages') && ($_zp_gallery_page == 'pages.php'))) {
printRSSLink('Pages','',gettext('RSS Pages'),'',false);
} elseif (getOption('RSS_album_image')) {
printRSSLink('Gallery','',gettext('RSS Gallery'),'',false);
} ?>
<?php } ?>
<?php if (getOption('facebook_url')!='') {
echo '<a href="';
Expand Down
13 changes: 8 additions & 5 deletions includes/_head.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


<?php $searchwords = getSearchWords();?>
<?php $searchdate = getSearchDate();?>

<!-- meta -->

Expand All @@ -35,7 +36,7 @@
if ($_zp_gallery_page == 'credits.php') {echo gettext('Credits'); echo ' | ';}
if ($_zp_gallery_page == 'explore.php') {echo gettext('Explore'); echo ' | ';}
if ($_zp_gallery_page == 'sitemap.php') {echo gettext('Sitemap'); echo ' | ';}
if ($_zp_gallery_page == 'search.php') {echo html_encode($searchwords); echo ' | ';}
if ($_zp_gallery_page == 'search.php') {echo html_encode($searchwords); echo html_encode($searchdate); echo ' | ';}
echo getParentSiteTitle();}
?>
</title>
Expand All @@ -57,15 +58,16 @@


<?php
if (isset($_GET["page"]) && $_zp_gallery_page == 'archive.php' || $_zp_gallery_page == 'favorites.php' || $_zp_gallery_page == 'password.php' || $_zp_gallery_page == 'register.php' || $_zp_gallery_page == 'contact.php') {
if (isset($_GET["page"]) && $_zp_gallery_page == 'favorites.php' || $_zp_gallery_page == 'password.php' || $_zp_gallery_page == 'register.php' || $_zp_gallery_page == 'contact.php' || $_zp_gallery_page == 'search.php' || $_zp_gallery_page == 'archive.php' || $_zp_gallery_page == '404.php') {
echo '<meta name="robots" content="noindex, follow">';
}
else {
echo '<meta name="robots" content="index, follow">';
}
?>



<link rel="canonical" href="<?php echo (PROTOCOL."://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]); ?>"/>

<!-- Open Graph -->

<meta property="og:title" content="<?php
Expand Down Expand Up @@ -211,7 +213,8 @@
<!-- rss -->

<?php if (class_exists('RSS')) printRSSHeaderLink('Gallery', gettext('Gallery RSS')); ?>

<?php if (class_exists('RSS')) printRSSHeaderLink("News", "Zenpage news", ""); ?>

<?php zp_apply_filter('theme_head'); ?>

</head>
4 changes: 4 additions & 0 deletions includes/_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
<div class="logo-header"><?php if (getOption('zenphoto_logo') != '') { ?>
<a id="logo" href="<?php echo html_encode(getStandardGalleryIndexURL()); ?>" title="<?php printGalleryTitle(); ?>"><img src="<?php echo pathurlencode(WEBPATH.'/'.UPLOAD_FOLDER.'/'.getOption('zenphoto_logo')); ?>" alt="<?php printGalleryTitle(); ?>" /></a>
<?php } elseif (getGalleryTitle() != '') { ?>
<?php if ($_zp_gallery_page == 'index.php' || $_zp_gallery_page == 'gallery.php') { ?>
<h1 id="logo-text"><a href="<?php echo html_encode(getStandardGalleryIndexURL()); ?>" title="<?php printGalleryTitle(); ?>"><?php printGalleryTitle(); ?></a></h1>
<?php } else { ?>
<h2 id="logo-text"><a href="<?php echo html_encode(getStandardGalleryIndexURL()); ?>" title="<?php printGalleryTitle(); ?>"><?php printGalleryTitle(); ?></a></h1>
<?php } ?>
<?php if (getOption('zenphoto_tagline')) { ?>
<div class="tagline"><?php printGalleryDesc(); ?></div>
<?php } ?>
Expand Down
12 changes: 7 additions & 5 deletions includes/_homepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
<?php
if (getNewsCustomData()!='')
{echo getNewsCustomData();
echo '<p class="readmorelink"><a href="' . getNewsURL() . '" title="' . gettext('Read more') .'" >' . gettext('Read more') . '</a></p><hr />';
echo '<p class="readmorelink"><a href="' . getNewsURL() . '" title="' . getNewsReadMore() .'" >' . getNewsReadMore() . '</a></p><hr />';
}
else {printNewsContent(250);}
else {printNewsContent(getOption('homepage_news_length'));}
?>
</div>
<?php
Expand All @@ -93,12 +93,14 @@
<h3 class="media-heading"><a href="<?php echo html_encode(getAlbumURL()); ?>" title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle(); ?>"><?php printAlbumTitle(); ?></a></h3>
<div class="media-body">
<a href="<?php echo html_encode(getAlbumURL()); ?>" title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle(); ?>"><?php printAlbumThumbImage(getBareAlbumTitle(),"media-object"); ?></a>
<p><?php
<p><?php if (getOption('homepage_content_albums_desc_show')) { ?>
<?php
if (getAlbumCustomData()!='')
{echo shortenContent(getAlbumCustomData(), 200, '...');}
{ echo getAlbumCustomData(); }
else
{echo shortenContent(getAlbumDesc(), 200, '...');}
{ echo shortenContent(getAlbumDesc(), (getOption('homepage_content_albums_desc_length')), '...'); }
?></p>
<?php } ?>
</div>
</div>
<?php endwhile; ?>
Expand Down
2 changes: 1 addition & 1 deletion includes/_imagethumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="thumbnail" itemprop="thumbnail">
<?php
if ($_zp_current_image->isPhoto()) { ?>
<a href="<?php echo html_encode(getDefaultSizedImage()); ?>" rel="lightbox-<?php echo $_zp_current_album->getID();?> noopener nofollow" title="<?php printBareImageTitle(); ?>"><?php printImageThumb(getBareImageTitle()); ?></a>
<a href="<?php echo html_encode(getImageURL()); ?>" title="<?php printBareImageTitle(); ?>"><?php printImageThumb(getBareImageTitle()); ?></a>
<?php
} else { ?>
<a href="<?php echo html_encode(getImageURL()); ?>"><?php printImageThumb(getBareImageTitle()); ?></a>
Expand Down
22 changes: 22 additions & 0 deletions includes/_imagethumbs_lightbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php if (getNumImages() > 0) print "<h3><i class=\"glyphicon glyphicon-picture\"></i>Images:</h3>"; ?>
<div id="images" class="row">
<?php while (next_image()): ?>
<div class="col-lg-3 col-md-4 col-xs-6" style="height:<?php echo html_encode(getOption('thumb_size')+55);echo 'px'; ?>" itemscope itemtype="https://schema.org/ImageObject">
<div class="thumbnail" itemprop="thumbnail">
<?php
if ($_zp_current_image->isPhoto()) { ?>
<a href="<?php echo html_encode(getDefaultSizedImage()); ?>" rel="lightbox-<?php echo $_zp_current_album->getID();?> noopener nofollow" title="<?php printBareImageTitle(); ?>"><?php printImageThumb(getBareImageTitle()); ?></a>
<?php
} else { ?>
<a href="<?php echo html_encode(getImageURL()); ?>"><?php printImageThumb(getBareImageTitle()); ?></a>
<?php
}
?>
<div class="caption">
<a href="<?php echo html_encode(getImageURL()); ?>"><span itemprop="name"><?php printBareImageTitle(); ?></span></a>
</div>
</div>
</div>
<?php endwhile; ?>
</div>

8 changes: 2 additions & 6 deletions includes/_sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@

<?php if ((getAllTagsCount()) && (getOption('display_tags-sidebar'))) { ?>
<!-- Print tag cloud -->

<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?php echo gettext('Popular Tags'); ?></h2></div>
<div id="tag_cloud" class="panel-body">
<?php printAllTagsAs_zb('cloud', 'taglist', 'abc', false, true,getOption('display_tags-maxfontsize'),getOption('display_tags-maxcount'),getOption('display_tags-mincount'), null); ?>
<?php printAllTagsAs_zb('cloud', 'taglist', 'abc', false, true,getOption('display_tags-maxfontsize'),getOption('display_tags-maxcount'),getOption('display_tags-mincount'), null, getOption('display_tags-minfont-size'), getOption('tags-seo-nofollow')); ?>
</div>
</div>
<?php } ?>

<?php if (getcodeblock(1, $_zp_gallery)!='') { ?>
<hr/>
<div class="well">
Expand All @@ -67,6 +66,3 @@
<?php } ?>

</aside>



Loading

0 comments on commit 707794d

Please sign in to comment.