Browse Source

resolving some errors with random titles and abstracts pages

main
Simon Bowie 2 years ago
parent
commit
6b177958c1
2 changed files with 5 additions and 5 deletions
  1. +1
    -0
      site/public/titles.php
  2. +4
    -5
      site/solr.php

+ 1
- 0
site/public/titles.php View File

@@ -40,6 +40,7 @@ foreach ($random_titles as $record_array):
echo $title;
?>
</a>

<?
endforeach;
?>

+ 4
- 5
site/solr.php View File

@@ -167,9 +167,9 @@ function ten_random_titles ($core){

foreach($random as $id => $content){
// Search for the title in the content element and display it
preg_match('/Title.*\n(.*)\n/', $content, $title);
$output[$x] = array($id=>$title[1]);
if (preg_match('/Title.*\n(.*)\n/', $content, $title)){
$output[$x] = array($id=>$title[1]);
}
}
}
return $output;
@@ -185,8 +185,7 @@ function ten_random_abstracts ($core){
if (preg_match('/Abstract.*\n(.*)\n/', $content, $abstract)){
$output[$x] = array($id=>$abstract[1]);
}
else {
preg_match('/\(.\) \\n\\n(.*)\\n/', $content, $abstract);
elseif (preg_match('/\(.\) \\n\\n(.*)\\n/', $content, $abstract)) {
$output[$x] = array($id=>$abstract[1]);
}
}

Loading…
Cancel
Save