|
|
@@ -95,9 +95,7 @@ function parse_result($input){ |
|
|
|
preg_match('/\(.\) \\n\\n(.*)\\n/', $input, $abstract); |
|
|
|
$output['abstract'] = $abstract[1]; |
|
|
|
} |
|
|
|
|
|
|
|
return $output; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function get_random_record(){ |
|
|
@@ -143,9 +141,7 @@ function one_random_record (){ |
|
|
|
foreach ($random as $id => $content){ |
|
|
|
$output = parse_result($content); |
|
|
|
} |
|
|
|
|
|
|
|
return $output; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function ten_random_titles (){ |
|
|
@@ -153,17 +149,33 @@ function ten_random_titles (){ |
|
|
|
for ($x=0; $x <= 9; $x++) { |
|
|
|
$random = get_random_record(); |
|
|
|
|
|
|
|
foreach($random as $id => $content){ |
|
|
|
// Search for the title in the content element and display it |
|
|
|
preg_match('/Title.*\n(.*)\n/', $content, $title); |
|
|
|
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]); |
|
|
|
} |
|
|
|
} |
|
|
|
return $output; |
|
|
|
} |
|
|
|
|
|
|
|
function ten_random_abstracts (){ |
|
|
|
|
|
|
|
$output[$x] = array($id=>$title[1]); |
|
|
|
for ($x=0; $x <= 9; $x++) { |
|
|
|
$random = get_random_record(); |
|
|
|
|
|
|
|
foreach($random as $id => $content){ |
|
|
|
// Search for the abstract in the content element and display it |
|
|
|
if (preg_match('/Abstract.*\n(.*)\n/', $content, $abstract)){ |
|
|
|
$output[$x] = array($id=>$abstract[1]); |
|
|
|
} |
|
|
|
else { |
|
|
|
preg_match('/\(.\) \\n\\n(.*)\\n/', $content, $abstract); |
|
|
|
$output[$x] = array($id=>$abstract[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return $output; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|