more collection fixes

This commit is contained in:
Matt Wells 2014-01-18 12:09:33 -08:00
parent fa59c62264
commit 8edfc2ce70
2 changed files with 31 additions and 21 deletions

View File

@ -1129,11 +1129,8 @@ bool gotResults ( void *state ) {
if ( collLen == 4 && strncmp ( coll, "main", 4) == 0 ) isMain = true; if ( collLen == 4 && strncmp ( coll, "main", 4) == 0 ) isMain = true;
// print "in collection ***" if we had a collection // print "in collection ***" if we had a collection
if ( collLen > 0 && ! isMain && isAdmin ) { if ( collLen > 0 && ! isMain ) // && isAdmin )
sb.safePrintf (" in collection <b>"); sb.safePrintf (" in collection <b>%s</b>",coll);
sb.safeMemcpy ( coll , collLen );
sb.safeMemcpy ( "</b>" , 5 );
}
char *pwd = si->m_pwd; char *pwd = si->m_pwd;
@ -2410,7 +2407,7 @@ static bool printResult ( SafeBuf &sb,
mr->m_docId ); mr->m_docId );
// the new links // the new links
if ( si->m_format == FORMAT_HTML ) { if ( si->m_format == FORMAT_HTML && g_conf.m_isMattWells ) {
//sb.safePrintf(" - <a href=\"/scoring?" //sb.safePrintf(" - <a href=\"/scoring?"
// "c=%s&\">scoring</a>", // "c=%s&\">scoring</a>",
// coll ); // coll );
@ -4725,21 +4722,26 @@ bool printLogoAndSearchBox ( SafeBuf &sb , HttpRequest *hr , long catId ) {
else else
sb.safePrintf("<a title=\"Search the web\" href=/>web</a>"); sb.safePrintf("<a title=\"Search the web\" href=/>web</a>");
sb.safePrintf(" &nbsp;&nbsp;&nbsp;&nbsp; " ); sb.safePrintf(" &nbsp;&nbsp;&nbsp;&nbsp; " );
// SEO functionality not included yet - so redir to gigablast.
if ( g_conf.m_isMattWells )
sb.safePrintf("<a title=\"Rank higher in " if ( g_conf.m_isMattWells ) {
"Google\" href='/seo'>"); // SEO functionality not included yet - so redir to gigablast.
else if ( g_conf.m_isMattWells )
sb.safePrintf("<a title=\"Rank higher in " sb.safePrintf("<a title=\"Rank higher in "
"Google\" href='https://www.gigablast." "Google\" href='/seo'>");
"com/seo'>"); else
sb.safePrintf("<a title=\"Rank higher in "
"Google\" href='https://www.gigablast."
"com/seo'>");
sb.safePrintf( sb.safePrintf(
"seo</a>" "seo</a>"
" &nbsp;&nbsp;&nbsp;&nbsp; " " &nbsp;&nbsp;&nbsp;&nbsp; "
); );
}
if (catId <= 0 ) if (catId <= 0 )
sb.safePrintf("<a title=\"Browse the DMOZ directory\" " sb.safePrintf("<a title=\"Browse the DMOZ directory\" "
@ -4758,12 +4760,12 @@ bool printLogoAndSearchBox ( SafeBuf &sb , HttpRequest *hr , long catId ) {
// i'm not sure why this was removed. perhaps // i'm not sure why this was removed. perhaps
// because it is not working yet because of // because it is not working yet because of
// some bugs... // some bugs...
"<!-- <a title=\"Advanced web search\" " "<a title=\"Advanced web search\" "
"href=/adv.html>" "href=/adv.html>"
"advanced" "advanced"
"</a>" "</a>"
" &nbsp;&nbsp;&nbsp;&nbsp; -->" " &nbsp;&nbsp;&nbsp;&nbsp;"
"<a title=\"Add your url to the index\" " "<a title=\"Add your url to the index\" "
"href=/addurl>" "href=/addurl>"

View File

@ -155,7 +155,15 @@ bool printWebHomePage ( SafeBuf &sb , HttpRequest *r ) {
// submit to https now // submit to https now
sb.safePrintf("<form method=get " sb.safePrintf("<form method=get "
"action=/search name=f>\n"); "action=/search name=f>\n");
CollectionRec *cr = g_collectiondb.getRec ( r );
if ( cr )
sb.safePrintf("<input type=hidden name=c value=\"%s\">",
cr->m_coll);
sb.safePrintf("<input name=q type=text size=60 value=\"\">&nbsp;<input type=\"submit\" value=\"Search\">\n"); sb.safePrintf("<input name=q type=text size=60 value=\"\">&nbsp;<input type=\"submit\" value=\"Search\">\n");
sb.safePrintf("\n"); sb.safePrintf("\n");
sb.safePrintf("</form>\n"); sb.safePrintf("</form>\n");
sb.safePrintf("<br>\n"); sb.safePrintf("<br>\n");