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("%s; ", authors); printf("%s ", citation); if (!isEmpty(pmid) && strcmp(pmid, "0")!=0 ) printf(", PMID%s\n", pmid, pmid); printf("
\n"); if (pubsDebug) printf("articleId=%s", articleId); printf("%s

", snippets); printf("


"); } 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("
\n"); printf("

%s

\n", authors); // // logo of publisher -char *logoUrl = urlToLogoUrl(conn, pubsArticleTable, articleId, url); +char *logoUrl = urlToLogoUrl(pubsArticleTable, articleId, url); if (logoUrl) printf("\n", url, logoUrl); freeMem(logoUrl); printf("
"); printf("%s
\n", url, title); printf("
\n"); printf("\n"); printf("

%s", cit); if (strlen(pmid)!=0 && strcmp(pmid, "0")) printf(", PMID%s\n", pmid, pmid); printf("

\n"); printf("

%s

\n", abstract);