e59d5d7ce5316294712bd16ba74512f540b9aa5d max Thu Jan 26 14:19:47 2012 -0800 typo in track desc diff --git src/hg/hgc/t2g.c src/hg/hgc/t2g.c index d7b5a15..9161313 100644 --- src/hg/hgc/t2g.c +++ src/hg/hgc/t2g.c @@ -18,36 +18,45 @@ char* articleTable; /* splits string with | and returns part index (is there no easier way to do this?) char *splitPart(char* string, int index) { char* name2; name2 = cloneString(string); char **parts = NULL; AllocArray(parts, 2); chopString(name2, "|", parts, 2); return (char *)parts[index]; }*/ void printMarkerSnippets(struct sqlConnection *conn, char* item) { -sqlUpdate(conn, "SET SESSION group_concat_max_len = 10000"); +printf("<H3>Snippets from Publications:</H3>"); + char query[4000]; +safef(query, sizeof(query), "SELECT COUNT(*) from t2gElsevierMarker WHERE markerId='%s'", item); +if (sqlNeedQuickNum(conn, query) > 4000) { + printf("Sorry, this marker is mentioned in more than 4000 times<BR>"); + printf("The results would take too long to load in your browser and are therefore not shown.<P>"); + return; +} + +sqlUpdate(conn, "SET SESSION group_concat_max_len = 10000"); + safef(query, sizeof(query), "SELECT distinct t2gElsevierMarker.articleId, url, title, authors, citation, group_concat(snippet SEPARATOR ' (...) ') FROM t2gElsevierMarker JOIN t2gElsevierArticle USING (articleId) WHERE markerId='%s' GROUP by articleId", item); struct sqlResult *sr = sqlGetResult(conn, query); -printf("<H3>Snippets from Publications:</H3>"); char **row; while ((row = sqlNextRow(sr)) != NULL) { char* articleId = row[0]; char* url = row[1]; char* title = row[2]; char* authors = row[3]; char* citation = row[4]; char* snippets = row[5]; printf("<SMALL>%s</SMALL><BR>", authors); printf("<A HREF=\"%s\">%s</A><BR>", url, title); printf("<SMALL>%s</SMALL><P>", citation); if (t2gDebug) printf("articleId=%s", articleId); printf("<I>%s</I><P>", snippets);