|
|
@@ -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]); |
|
|
|
} |
|
|
|
} |