c90837e6e7b85301490c0f89bfc0ba83255dc0df max Mon Mar 26 15:25:40 2012 -0700 adding elsevier outlinks for sciverse app to hgc publications page diff --git src/hg/hgc/pubs.c src/hg/hgc/pubs.c index aea3be7..5dca585 100644 --- src/hg/hgc/pubs.c +++ src/hg/hgc/pubs.c @@ -22,30 +22,43 @@ "intro", "methods", "results", "discussion", "conclusions", "ack", "refs", "unknown" }; // // whether a checkbox is checked by default, have to correspond to pubsSecNames static int pubsSecChecked[] ={ 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 }; static char* pubsSequenceTable; +static char* mangleUrl(char* url) +/* add publisher specific parameters to url and return new url*/ +{ +if (!stringIn("sciencedirect.com", url)) + return url; + +// cgi param to add the "UCSC matches" sciverse application to elsevier's sciencedirect +char* sdAddParam = "?svAppaddApp=298535"; +char* longUrl = catTwoStrings(url, sdAddParam); +char* newUrl = replaceChars(longUrl, "article", "svapps"); +return newUrl; +} + static void printFilterLink(char* pslTrack, char* articleId) /* print a link to hgTracks with an additional cgi param to activate the single article filter */ { int start = cgiInt("o"); int end = cgiInt("t"); printf(" ", hgTracksPathAndSettings(), database, seqName, start+1, end, articleId, pslTrack); char startBuf[64], endBuf[64]; sprintLongWithCommas(startBuf, start + 1); sprintLongWithCommas(endBuf, end); printf("Show these sequence matches individually on genome browser"); } static char* makeSqlMarkerList(void) /* return list of sections from cgi vars, format like "'abstract','header'" */ @@ -168,34 +181,32 @@ printLimitWarning(conn, markerTable, item, itemLimit, sectionList); printf("
", snippets); printf("
%s
\n", authors); printf("%s\n", url, title); printf("%s", cit); if (strlen(pmid)!=0 && strcmp(pmid, "0")) printf(", PMID%s\n", pmid, pmid); printf("
\n"); printf("%s
\n", abstract); sqlFreeResult(&sr); return articleId; } @@ -559,46 +572,55 @@ char query[512]; struct sqlResult *sr; char **row; bioSeq *seq = NULL; safef(query, sizeof(query), "select sequence from %s where annotId = '%s'", table, id); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) { AllocVar(seq); seq->name = cloneString(id); seq->dna = cloneString(row[0]); seq->size = strlen(seq->dna); } sqlFreeResult(&sr); + return seq; } void pubsAli(struct sqlConnection *conn, char *pslTable, char *seqTable, char *item) /* this is just a ripoff from htcCdnaAli, similar to markd's transMapAli */ { bioSeq *oSeq = NULL; writeFramesetType(); puts(""); printf("\n