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

echo $title; echo $title;
?> ?>
</a> </a>

<? <?
endforeach; endforeach;
?> ?>

+ 4
- 5
site/solr.php View File



foreach($random as $id => $content){ foreach($random as $id => $content){
// Search for the title in the content element and display it // 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; return $output;
if (preg_match('/Abstract.*\n(.*)\n/', $content, $abstract)){ if (preg_match('/Abstract.*\n(.*)\n/', $content, $abstract)){
$output[$x] = array($id=>$abstract[1]); $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]); $output[$x] = array($id=>$abstract[1]);
} }
} }

Loading…
Cancel
Save