[Refdb-cvs] CVS: refdb/src backend-html.c,1.27.2.4,1.27.2.5 backend-scrn.c,1.17.2.3,1.17.2.4 backend
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-09-18 22:51:33
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21729 Modified Files: Tag: Release_0_9_5_stable backend-html.c backend-scrn.c backend.c risdb.c risxhandler.c Log Message: fixed ulink handling Index: backend-html.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-html.c,v retrieving revision 1.27.2.4 retrieving revision 1.27.2.5 diff -u -U2 -r1.27.2.4 -r1.27.2.5 --- backend-html.c 7 Sep 2005 23:45:00 -0000 1.27.2.4 +++ backend-html.c 18 Sep 2005 22:51:24 -0000 1.27.2.5 @@ -1370,4 +1370,6 @@ int i; char *entitize_string; + char keytype[5][10] = {"URL", "PDF", "FULLTEXT", "RELATED", "IMAGE"}; + char buffer[64]; /* loop over all link types */ @@ -1379,5 +1381,6 @@ while ((item = get_ulink(dbires)) != NULL) { - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p class='ur'><a href=\"", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + sprintf(buffer, "<p class='ur'>%s: <a href=\"", keytype[i]); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), buffer, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); clean_request(dbires); @@ -1432,5 +1435,4 @@ free(entitize_string); - clean_request(dbires); if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</a></p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -1442,4 +1444,5 @@ } } /* end while */ + clean_request(dbires); } /* end for */ } Index: backend-scrn.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-scrn.c,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -u -U2 -r1.17.2.3 -r1.17.2.4 --- backend-scrn.c 7 Sep 2005 23:45:01 -0000 1.17.2.3 +++ backend-scrn.c 18 Sep 2005 22:51:25 -0000 1.17.2.4 @@ -746,6 +746,6 @@ } - clean_request(dbires); } /* end while */ + clean_request(dbires); } /* end for */ } Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.27.2.7 retrieving revision 1.27.2.8 diff -u -U2 -r1.27.2.7 -r1.27.2.8 --- backend.c 11 Sep 2005 19:55:11 -0000 1.27.2.7 +++ backend.c 18 Sep 2005 22:51:25 -0000 1.27.2.8 @@ -2001,5 +2001,5 @@ } - sprintf(sql_command, "SELECT t_link.link_url FROM t_link, t_xlink WHERE t_link.link_id=t_xlink.link_id AND t_xlink.xlink_type=\'%s\' AND t_xlink.xlink_source=\'%s\' AND t_xlink.xref_id="ULLSPEC, keytype[mode], keymode[mode], (unsigned long long)n_id); + sprintf(sql_command, "SELECT t_link.link_url FROM t_link, t_xlink WHERE t_link.link_id=t_xlink.link_id AND t_xlink.xlink_type=\'%s\' AND t_xlink.xlink_source=\'%s\' AND t_xlink.xref_id="ULLSPEC, keytype[type], keymode[mode], (unsigned long long)n_id); LOG_PRINT(LOG_DEBUG, sql_command); Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.44.2.10 retrieving revision 1.44.2.11 diff -u -U2 -r1.44.2.10 -r1.44.2.11 --- risdb.c 11 Sep 2005 20:01:20 -0000 1.44.2.10 +++ risdb.c 18 Sep 2005 22:51:25 -0000 1.44.2.11 @@ -578,4 +578,18 @@ } + /* search orphans in t_ulink */ + result = remove_ulink_entries(n_refdb_id, conn, 0 /* reference */); + if (result != 0 && result != 4) { + sprintf(sql_command, "253:"ULLSPEC"\n", (unsigned long long)(set_count + nongeek_offset)); + if ((new_msgpool = mstrcat(*ptr_msg_pool, sql_command, ptr_msg_pool_len, 0)) == NULL) { + return 0; + } + else { + *ptr_msg_pool = new_msgpool; + } + retval = 1; + goto cleanup; + } + /* search orphans in t_periodical */ sprintf(sql_command, "SELECT refdb_periodical_id FROM t_refdb WHERE refdb_id="ULLSPEC, (unsigned long long)n_refdb_id); @@ -3273,5 +3287,5 @@ dbi_result dbires2; - sprintf(sql_command, "SELECT link_id, xlink_id FROM t_xlink WHERE xlink_type=\'%s\' AND xref_id="ULLSPEC, (mode) ? "NOTE":"REFERENCE", (unsigned long long)ref_id); + sprintf(sql_command, "SELECT link_id, xlink_id FROM t_xlink WHERE xlink_source=\'%s\' AND xref_id="ULLSPEC, (mode) ? "NOTE":"REFERENCE", (unsigned long long)ref_id); LOG_PRINT(LOG_DEBUG, sql_command); dbires = dbi_conn_query(conn, sql_command); Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.28.2.12 retrieving revision 1.28.2.13 diff -u -U2 -r1.28.2.12 -r1.28.2.13 --- risxhandler.c 7 Sep 2005 23:45:03 -0000 1.28.2.12 +++ risxhandler.c 18 Sep 2005 22:51:25 -0000 1.28.2.13 @@ -357,4 +357,27 @@ /* else: all fine */ + /* search orphans in t_ulink */ + result = remove_ulink_entries(ptr_ardata->n_refdb_id, ptr_ardata->conn, 0 /* reference */); + if (result != 0 && result != 4) { + if (result == 1) { + strcpy(sql_command, "select from t_xuser failed\n"); + } + else if (result == 3) { + strcpy(sql_command, "delete from t_xuser failed\n"); + } + + (ptr_ardata->ndb_error)++; + + if ((new_msgpool = mstrcat(ptr_ardata->msgpool, sql_command, &(ptr_ardata->msgpool_len), 0)) == NULL) { + (ptr_ardata->nmem_error)++; + return; + } + else { + ptr_ardata->msgpool = new_msgpool; + } + return; + } + /* else: all fine */ + /* search orphans in t_periodical */ sprintf(sql_command, "SELECT refdb_periodical_id FROM t_refdb WHERE refdb_id="ULLSPEC, (unsigned long long)(ptr_ardata->n_refdb_id)); |