[patch] bb-findhost.cgi redirects to the page when only one host matches
hi,
I made a small modification to bb-findhost.c so that when a search yields only one results, you get transported to that page.
Since we only know there's one result after a full scan of the bb-hosts file, and don't want to scan the file twice, I use an ugly way to do it: a javascript redirect held in a <img> tag.
This works for 4.1.2p1, but the patch applies in 4.2-beta-20060605 too (not tested live, thought).
Regards,
-- Charles Goyard rediscovering C
On Tue, Jun 27, 2006 at 12:05:14PM +0200, Charles Goyard wrote:
I made a small modification to bb-findhost.c so that when a search yields only one results, you get transported to that page.
Since we only know there's one result after a full scan of the bb-hosts file, and don't want to scan the file twice, I use an ugly way to do it: a javascript redirect held in a <img> tag.
I like the overall idea, but the implementation is not so nice.
So I made a different implementation of the same idea, but without the JavaScript/img tag stuff. You'll find it in the snapshot that is generated in a few minutes.
Regards, Henrik
Henrik Stoerner a écrit :
I like the overall idea, but the implementation is not so nice.
So I made a different implementation of the same idea, but without the JavaScript/img tag stuff. You'll find it in the snapshot that is generated in a few minutes.
Hi Henrik
it's working, but I get redirected to
http://hostname/hobbit/page/subpage/#host instead of
http://xx.xx.xx.xx/hobbit/page/subpage/#host
--
Frédéric Mangeant
Steria EDC Sophia-Antipolis
Frédéric Mangeant a écrit :
it's working, but I get redirected to http://hostname/hobbit/page/subpage/#host instead of
http://xx.xx.xx.xx/hobbit/page/subpage/#host
Forget about my mail, the web browser I was using had a misconfigured proxy...
It's working perfectly.
--
Frédéric Mangeant
Steria EDC Sophia-Antipolis
On Wed, Jun 28, 2006 at 12:52:20PM +0200, Fr?d?ric Mangeant wrote:
Henrik Stoerner a écrit :
I like the overall idea, but the implementation is not so nice.
So I made a different implementation of the same idea, but without the JavaScript/img tag stuff. You'll find it in the snapshot that is generated in a few minutes.
it's working, but I get redirected to http://hostname/hobbit/page/subpage/#host instead of
http://xx.xx.xx.xx/hobbit/page/subpage/#host
Then fix your BBWEBHOST (or BBSERVERWWWNAME) setting in hobbitserver.cfg.
Regards, Henrik
Henrik Stoerner a écrit :
On Tue, Jun 27, 2006 at 12:05:14PM +0200, Charles Goyard wrote:
I made a small modification to bb-findhost.c so that when a search yields only one results, you get transported to that page.
I like the overall idea, but the implementation is not so nice.
Didn't I warned you :) ? Thank you for including this 'idea' into hobbit.
I made another modification, so that when all matches are on the same page, you get to that page at once. Why ? My Perl search engine on BB behaves this way, and most users use it not to jump to a specific host, but to a specific page: We use domain names to group hosts by project/farm/customer, like everything in the DMZ is called somehost.dmz01.tld. So to have a look at the dmz, people type "dmz01" (short, easy, ideal for lazy people). It proves so useful I can barely recall how the pages are organized :).
There's two flavours of the patch made against today's snapshot (Chances are you will find a better way to implement it :
- you get to the page without the host anchor ;
- you get to the first match.
Regards,
-- Charles
participants (3)
-
cgoyard@cvf.fr
-
frederic.mangeant@steria.com
-
henrik@hswn.dk