distroquery: make prefix to search page configurable (URL_SEARCH_PREFIX)
This commit is contained in:
parent
53ac68d8d0
commit
c7f47f3adf
@ -585,9 +585,10 @@ void printQueryResponse() {
|
||||
sqlite3_finalize(stmt1);
|
||||
}
|
||||
if (query_compact) {
|
||||
printf("<b><a href='/distribution/search.html?"
|
||||
printf("<b><a href='%s?"
|
||||
"repository=%s&package=%s&arch=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
|
||||
"%s</a></b> %s-%s - %s<br>",
|
||||
query_repositories[i]->configdefaults->url_search_prefix,
|
||||
query_repositories[i]->tag,
|
||||
(const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
|
||||
query_repositories[i]->arch[a],
|
||||
@ -660,9 +661,10 @@ void printQueryResponse() {
|
||||
|
||||
|
||||
if (query_compact) {
|
||||
printf("<a href='/distribution/search.html?"
|
||||
printf("<a href='%s?"
|
||||
"repository=%s&package=%s&arch=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
|
||||
"%s</a> (%s-%s) %s %s<br>",
|
||||
query_repositories[i]->configdefaults->url_search_prefix,
|
||||
query_repositories[i]->tag,
|
||||
sqlite3_column_text(statement,sqlite3_find_column_id(statement, "packages", "name")),
|
||||
query_repositories[i]->arch[a],
|
||||
@ -775,9 +777,10 @@ void printQueryResponse() {
|
||||
|
||||
printf("<br><img class=\"distroqueryimg16\" src=\"%s\" width=\"16\" height=\"16\"> ", buffer);
|
||||
if (query_compact) {
|
||||
printf("<b><a href='/distribution/search.html?"
|
||||
printf("<b><a href='%s?"
|
||||
"repository=%s&package=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
|
||||
"%s</a></b> %s-%s - %s<br>",
|
||||
query_repositories[i]->configdefaults->url_search_prefix,
|
||||
query_repositories[i]->tag,
|
||||
(const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
|
||||
(const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
|
||||
@ -1015,9 +1018,10 @@ void printSpecialQueryResponse() {
|
||||
}
|
||||
|
||||
printf("%s <img class=\"distroqueryimg12\" src=\"%s\" width=\"12\" height=\"12\"> ", strdate, buffer);
|
||||
printf("<b><a href='/distribution/search.html?"
|
||||
printf("<b><a href='%s?"
|
||||
"repository=%s&package=%s&searchbox=true' style=\"color:black\" target='distroquery' title=\"%s\">"
|
||||
"%s</a></b> %s-%s",
|
||||
query_repositories[i]->configdefaults->url_search_prefix,
|
||||
ct->tag,
|
||||
(const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
|
||||
htmlcleanNoBr((const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "summary")),buffer,PATH_MAX),
|
||||
|
@ -249,6 +249,9 @@ struct configTag* read_configuration(const char *confFile)
|
||||
} else if (!strcmp(vartok, "URL_PREFIX")) {
|
||||
configdefaults.url_prefix =
|
||||
(char *) strdup(valuetok);
|
||||
} else if (!strcmp(vartok, "URL_SEARCH_PREFIX")) {
|
||||
configdefaults.url_search_prefix =
|
||||
(char *) strdup(valuetok);
|
||||
} else if (!strcmp(vartok, "URL_DIR")) {
|
||||
configdefaults.url_dir =
|
||||
(char *) strdup(valuetok);
|
||||
|
@ -16,6 +16,7 @@ struct configDefaults {
|
||||
char *distribution_name;
|
||||
char *url_address;
|
||||
char *url_prefix;
|
||||
char *url_search_prefix;
|
||||
char *url_dir;
|
||||
char *arch[ARCHS_MAX];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user