489bd982dd3eeb7eba197733e3c9b43abe8d90dd max Mon May 6 14:18:27 2013 -0700 fixed publisher filter and publisher logo bugs diff --git src/hg/hgc/pubs.c src/hg/hgc/pubs.c index d7fed2f..d97e4d7 100644 --- src/hg/hgc/pubs.c +++ src/hg/hgc/pubs.c @@ -381,36 +381,36 @@ printf("<SMALL>%s</SMALL>; ", authors); printf("<SMALL>%s ", citation); if (!isEmpty(pmid) && strcmp(pmid, "0")!=0 ) printf(", <A HREF=\"http://www.ncbi.nlm.nih.gov/pubmed/%s\">PMID%s</A>\n", pmid, pmid); printf("</SMALL><BR>\n"); if (pubsDebug) printf("articleId=%s", articleId); printf("<I>%s</I><P>", snippets); printf("<HR>"); } freeMem(sectionList); sqlFreeResult(&sr); } -static char *urlToLogoUrl(struct sqlConnection *conn, char* pubsArticleTable, - char* articleId, char *urlOrig) +static char *urlToLogoUrl(char* pubsArticleTable, char* articleId, char *urlOrig) /* return a string with relative path of logo for publisher given the url of * fulltext or a table/articleId, has to be freed */ { +struct sqlConnection *conn = hAllocConn(database); char* pubCode = NULL; if (hHasField("hgFixed", pubsArticleTable, "publisher")) { char query[4000]; safef(query, sizeof(query), "SELECT publisher from %s where articleId=%s", pubsArticleTable, articleId); pubCode = sqlQuickString(conn, query); } else { // get top-level domain url if not publisher field char url[1024]; memcpy(url, urlOrig, sizeof(url)); char *slashParts[20]; // split http://www.sgi.com/test -> to [http:,www.sgi.com,test] @@ -464,31 +464,31 @@ if (strlen(abstract)==0) abstract = "(No abstract available for this article. " "Please follow the link to the fulltext above by clicking on the titel or the fulltext image.)"; if (stringIn("sciencedirect.com", url)) { pubsHasSupp = FALSE; pubsIsElsevier = TRUE; } // authors title printf("<DIV style=\"width:1024px; font-size:100%%\">\n"); printf("<P>%s</P>\n", authors); // // logo of publisher -char *logoUrl = urlToLogoUrl(conn, pubsArticleTable, articleId, url); +char *logoUrl = urlToLogoUrl(pubsArticleTable, articleId, url); if (logoUrl) printf("<a href=\"%s\"><img align=\"right\" hspace=\"20\" src=\"%s\"></a>\n", url, logoUrl); freeMem(logoUrl); printf("<div style=\"width:800px\">"); printf("<A TARGET=\"_blank\" HREF=\"%s\"><B>%s</B></A></div>\n", url, title); printf("</DIV>\n"); printf("</DIV>\n"); printf("<P style=\"width:1024px; font-size:80%%\">%s", cit); if (strlen(pmid)!=0 && strcmp(pmid, "0")) printf(", <A HREF=\"http://www.ncbi.nlm.nih.gov/pubmed/%s\">PMID%s</A>\n", pmid, pmid); printf("</P>\n"); printf("<P style=\"width:1024px; font-size:100%%\">%s</P>\n", abstract);