Skip to content

Commit

Permalink
Merge pull request #624 from rentonsa/LUC023A-194
Browse files Browse the repository at this point in the history
LUC023A-202 Quick CLD image fixes
  • Loading branch information
rentonsa authored Oct 8, 2020
2 parents 5978268 + a5010ae commit 6d2f39a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/clds.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
'Origin' => 'Origin',
'Identifier' => 'Identifier');

$config['skylight_results_per_page'] = 10;
$config['skylight_results_per_page'] = 20;
$config['skylight_share_buttons'] = false;

// $config['skylight_homepage_recentitems'] = false;
Expand Down
2 changes: 1 addition & 1 deletion theme/clds/views/record.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
foreach ($solr[$bitstream_field] as $bitstream) {
$mp4ok = false;
$b_segments = explode("##", $bitstream);
$b_filename = $b_segments[1];
$b_filename = urlencode($b_segments[1]);
$b_handle = $b_segments[3];
$b_seq = $b_segments[4];
$b_handle_id = preg_replace('/^.*\//', '', $b_handle);
Expand Down
24 changes: 18 additions & 6 deletions theme/clds/views/search_results.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@
foreach ($doc[$bitstream_field] as $bitstream)
{
$b_segments = explode("##", $bitstream);
$b_filename = $b_segments[1];
//SR urlencode- lots of filenames with spaces etc
$b_filename = urlencode($b_segments[1]);

$b_seq = $b_segments[4];
$imageformat = false;
if((strpos($b_filename, ".jpg") > 0) || (strpos($b_filename, ".JPG") > 0)) {



$imageformat = true;

$bitstream_array[$b_seq] = $bitstream;



if ($started) {
if ($b_seq < $min_seq) {
Expand All @@ -63,29 +70,34 @@
echo $thumbnailLink;
}


// if there is a thumbnail and a bitstream
if(isset($min_seq) && count($bitstream_array) > 0) {

// get all the information
$b_segments = explode("##", $bitstream_array[$min_seq]);
$b_filename = $b_segments[1];
//SR urlencode- lots of filenames with spaces etc
$b_filename = urlencode($b_segments[1]);
$b_handle = $b_segments[3];
$b_seq = $b_segments[4];
$b_handle_id = preg_replace('/^.*\//', '',$b_handle);
$b_uri = './record/'.$b_handle_id.'/'.$b_seq.'/'.$b_filename;

$thumbnailLink = "";

if(isset($doc[$thumbnail_field])) {
foreach ($doc[$thumbnail_field] as $thumbnail) {

$t_segments = explode("##", $thumbnail);
$t_filename = $t_segments[1];
$t_filename = urlencode($t_segments[1]);

if ($t_filename === $b_filename . ".jpg") {

$t_handle = $t_segments[3];
$t_seq = $t_segments[4];
$t_uri = './record/'.$b_handle_id.'/'.$t_seq.'/'.$t_filename;


$thumbnailLink = '<a href="./record/'. $doc['id'].'" title = "' . $doc[$title_field][0] . '"> ';
$thumbnailLink .= '<div class ="imagebox"><img src = "'.$t_uri.'" class="img-responsive" title="'. $doc[$title_field][0] .'" /></div></a>';
}
Expand All @@ -111,15 +123,15 @@
<p>
<?php
$recordlen = strlen($doc[$title_field][0]);
if ($recordlen > 26)
if ($recordlen > 15)
{
$recordtitle = substr($doc[$title_field][0],0,60).'...';
$recordtitle = substr($doc[$title_field][0],0,15).'...';
}
else {
$recordtitle = $doc[$title_field][0];
}
?>
<a href="./record/<?php echo $doc['id']?>?highlight=<?php echo $query ?>"><?php echo $recordtitle ?></a>
<a href="./record/<?php echo $doc['id']?>?highlight=<?php echo $query ?>" title="<?php echo $doc[$title_field][0]?>"><?php echo $recordtitle ?></a>
</p>
</div>
</div>
Expand Down

0 comments on commit 6d2f39a

Please sign in to comment.