Build published links data

$next "; $limitstr = " limit 20 "; } if (!($start == "")){ if ($start == "all"){ $limitstr = ""; $wherestr = ""; } else { $limitstr = " limit $start, 20 "; } } $limitstr = " limit 200 "; $category = $_GET["cat"]; if ($category == "evolutionary-biology"){ $category = "evolutionary biology"; } $cat = strtolower($category); include "../connect_symposia.php"; mysql_set_charset("utf8"); include('../simple_html_dom.php'); if (!($sub == "Submit")){ echo '
'; $i = 0; ?> '; $sql3 = "SELECT * FROM test.biorxiv_publ_stage "; $res3=mysql_query($sql3); $numinq = mysql_num_rows($res3); echo "\n"; ?> "; $res2=mysql_query($sql2); if(mysql_num_rows($res2)){ while($row = mysql_fetch_array($res2)){ $cnt++; $doi_this_id = $row["id"]; $row_id = $row["id"]; $this_doi = $row["bio_doi"]; $pmdoi = $row["pub_doi"]; $myjournal = $row["pub_journal"]; $thisurl = $row["pub_url"]; $mypubdate = $row["pub_date"]; $pub_str = $row["pub_src"]; $pub_str = "$pub_str "; $cit_html = $row["pub_pmrec"]; $this_cit_title = $row["pub_pmpub"]; //echo "
x $cit_html"; //if (!(substr($this_cit_title, -1) == "")){ //$this_cit_title = $this_cit_title . "\""; //} // check and see whether we have already found a published version $sql7 = "SELECT * FROM test.biorxiv_publ WHERE bio_doi = '$this_doi'"; $foundone = "no"; $res7=mysql_query($sql7); $this_src = ""; if(mysql_num_rows($res7)){ $foundone = "yes"; while($row7 = mysql_fetch_array($res7)){ $pub_doi = $row7["pub_doi"]; //$pub_str = "already pub: " . $pub_doi; } } // end check for prior published version if ($foundone == "no") { $sql9 = "SELECT * FROM test.biorxiv_index WHERE article_doi = '$this_doi' order by id asc "; $foundone = "no"; $res9=mysql_query($sql9); $xx = 0; while($row9 = mysql_fetch_array($res9)){ if ($xx == 0){ $this_date = $row9[article_date]; } $xx++; $this_version = $row9[article_url]; $mss = str_replace("10.1101/","",$this_doi); $this_url = "https://biorxiv.org/cgi/content/short/" . $mss . "v" . $this_version; $this_authors = $row9[article_authors]; $this_title_full = $row9[article_title]; $this_title = substr($row9[article_title],0,15); } $cnt_hov++; echo "'; echo ''; //echo "'; if ($this_date > $mypubdate){ echo ''; } else { echo ''; } echo ''; echo ""; echo ""; echo "\n"; echo "
Matched citation:
" . $cit_html . "
" . $this_cit_title . "
" . $mypubdate . "

Biorxiv citation:
" . $this_title_full ."
" . $this_authors ."
" . $this_date . "
\n"; echo ''; // ******* add to match table so we know it has already been considered ******* //$query9 = "INSERT INTO test.biorxiv_pub_match (bio_doi, pub_med_id) VALUES ('$this_doi','$pid') "; //echo "
" . $query; //mysql_query($query9)or die ("mess up".mysql_error()); // ******* end add to match table ******* } $i++; } } ?>
Left in Queue: $numinq
Xbio doipub doijournalpublish datepublished article urlpubmed linkbiorxiv linkpublished article link

X

"; echo '
'; echo 'Pub date earlier than post date!$pub_str$this_title$thisurl"; //echo "
Matched citation:
" . $cit_html . "
" . $this_cit_title . "
" . $pubm_auths . "
Biorxiv citation:
" . $this_title_full ."
" . $this_authors ."
" . $this_date . "



Or see next 20 matches

See next 10 matches

"; foreach ($_POST['rows'] as $row) { $bio_doi = trim($row['bio_doi']); $pub_doi = trim($row['pub_doi']); $pub_jrn = trim($row['pub_jrn']); $pub_jrn = mysql_real_escape_string($pub_jrn); $pub_lnk = trim($row['pub_link']); $pub_date = trim($row['pub_date']); $pub_src = "pubmed"; //echo "
$bio_doi"; if (!($bio_doi == "")){ $sql1 = "SELECT * FROM test.biorxiv_publ WHERE bio_doi = '$bio_doi'"; $res1=mysql_query($sql1); //echo "
$sql1"; if(mysql_num_rows($res1)){ //echo "
$sql1"; while($row = mysql_fetch_array($res1)){ echo "
already exists: " . $bio_doi; //$res=mysql_query($sql); } } else { $query="INSERT INTO test.biorxiv_publ (bio_doi, pub_doi, pub_journal, pub_url, pub_date, pub_src, pub_pmrec, pub_pmpub, pub_pmacc ) VALUES ('$bio_doi','$pub_doi','$pub_jrn','$pub_lnk', '$pub_date' , '$pub_src', '', '', '') "; //echo "
" . $query; mysql_query($query)or die ("mess up".mysql_error()); $id = mysql_insert_id(); //**************** send email to author *************************** $pub_journal = ""; $pub_doi = ""; $pub_url = ""; $pub_date = ""; $pub_journal = $pub_jrn; $pub_url = $pub_lnk; $sql3 = "SELECT * FROM test.biorxiv_author_corr where authorc_doi = '".$bio_doi."'"; $res3=mysql_query($sql3); //echo "
$sql3"; if(mysql_num_rows($res3)){ while($row3 = mysql_fetch_array($res3)){ $cnt++; $author_email = $row3[authorc_email]; $recno = $row3[id]; $doi = $row3[authorc_doi]; $author_inst = $row3[authorc_inst]; $author_name = $row3[authorc_name]; $doibits = explode("/", $doi); $link = $latest . "/" . $doibits[1]; //echo "
test2 $author_name"; } } $pub_src4 = substr($pub_src,0,4); if (!(is_numeric($pub_src4))){ $to = $author_email; $subject = "Link to the published version of your bioRxiv preprint $bio_doi "; $latest = "http://biorxiv.org/cgi/content/short"; $doibits = explode("/", $bio_doi); $link = $latest . "/" . $doibits[1]; //echo "
test $author_name email: $author_email"; $headers = "From: noreply@connect.biorxiv.org\r\n"; $headers .= "Reply-To: biorxiv@cshl.edu \r\n"; $headers .= "BCC: black@cshl.edu,roeder@cshl.edu\r\n"; $headers .= "MIME-Version: 1.0\r\n"; //$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8 \r\n"; $message = "

Dear " . $author_name . ",

"; $message .= "

We have linked your bioRxiv preprint to the published journal article version of your paper. "; $message .= "The link appears in red near the top of your bioRxiv post " . $bio_doi . "."; $message .= "

If this is a different paper and is not in fact the published version of your preprint, "; $message .= "please let us know by email.

"; $message .= "

The bioRxiv Team

"; mail($to, $subject, $message, $headers); //echo "
$sql4"; echo "
sent to: $to"; $today = date('Y/m/d'); $sql3 = "UPDATE test.biorxiv_publ SET pub_src = '" . $today . "' where id = " . $id . " "; //$res3=mysql_query($sql3); //echo "
$sql3"; } else { echo "
No notice sent - author has already been notified. \n"; } // ********************** end send email echo '

our_dois[\''.$bio_doi.'\'] = {"pubdoi": "'.$pub_doi.'", "pubjournal": "'.$pub_jrn.'", "publink": "'.$pub_lnk.'"};
'; $query9 = "DELETE FROM test.biorxiv_pub_match WHERE bio_doi = '$bio_doi' "; mysql_query($query9)or die ("mess up".mysql_error()); $query10 = "DELETE FROM test.biorxiv_publ_stage WHERE bio_doi = '$bio_doi' "; mysql_query($query10)or die ("mess up".mysql_error()); } } } } include "../close_symposia.php"; ?>