From: Sverre B. <sv...@us...> - 2005-11-03 13:27:33
|
Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26343 Modified Files: index.php Log Message: RFE1346889 Google-like result presentation Index: index.php =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.php 21 Oct 2005 10:59:23 -0000 1.11 --- index.php 3 Nov 2005 13:27:18 -0000 1.12 *************** *** 34,39 **** include_once ("lib/config.inc"); include ($conf_index_file); - include ($conf_includepath."/time.inc"); - include ($conf_includepath."/url.inc"); //if register_globals is off --- 34,37 ---- *************** *** 45,75 **** $start = $_REQUEST['start']; $debug = $_REQUEST['debug']; ! include($conf_includepath . "/header.inc"); ! ?> ! ! <script language="javascript"> ! function submitForm(v) { ! ! if (v == 2){ ! document.search.action = "<?php print $conf_advanced_search ?>"; ! document.search.submit(); ! }else{ ! document.search.action = "<?php print $conf_simple_search ?>"; ! document.search.submit(); ! } ! } ! </script> ! ! </HEAD> ! ! <body><center> ! ! <?php - if ($year_from == "" and $year_to == "") { $query_time = ""; --- 43,58 ---- $start = $_REQUEST['start']; $debug = $_REQUEST['debug']; ! $showall = $_REQUEST['showall']; + if (strpos($query, 'site:') !== false) { + $showall = TRUE; } + + include($conf_includepath . "/header.inc"); ! ?> ! </HEAD><body><center> <?php if ($year_from == "" and $year_to == "") { $query_time = ""; *************** *** 96,100 **** $year_from = $first_year; } - # $query_time = "date:[".$year_from."0101000000;".$year_to."0101000000] "; $query_time = "date:".$year_from."0101000000-".$year_to."0101000000 "; } --- 79,82 ---- *************** *** 107,125 **** <tr> <td class="norm" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> ! <td class="norm" align="left"><img alt="" src="<?php print $conf_logo;?>"></td> ! <td class="norm" align="right"> ! <?php ! ! ! //print "<a href=\"$conf_advanced_search?query=$query&querytype=$querytype&year_from=$year_from&year_to=$year_to\">"; ! //print nls("Advanced search") . "</a>"; ! ?> ! </td> ! <td class="norm" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> </tr> </table> ! <table border='0' cellpadding='0' cellspacing='0' width=90%> <tr> <td class="norm" colspan="4" align="left"><img alt='' height='8' src='/images/1px.gif' width='1'></td> --- 89,98 ---- <tr> <td class="norm" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> ! <td class="norm" colspan="5" align="left"><img alt="" src="<?php print $conf_logo;?>"></td> </tr> </table> ! <table border='1' cellpadding='0' cellspacing='0' width=90%> <tr> <td class="norm" colspan="4" align="left"><img alt='' height='8' src='/images/1px.gif' width='1'></td> *************** *** 140,148 **** <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> ! <?php ! ! $query = trim(stripslashes($query)); - ?> --- 113,118 ---- <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> ! <?php $query = trim(stripslashes($query)); ?> *************** *** 150,154 **** <form name='search' action=<? echo $_SERVER['PHP_SELF']; ?> method='get'> <input type='text' name='query' value='<?php print $query; ?>' class="searchtext" size="50"/> ! <input type='submit' value='<?php print(nls("Search"));?>' class="searchbutton" onClick="submitForm(0);"/> </td> </tr> --- 120,124 ---- <form name='search' action=<? echo $_SERVER['PHP_SELF']; ?> method='get'> <input type='text' name='query' value='<?php print $query; ?>' class="searchtext" size="50"/> ! <input type='submit' value='<?php print(nls("Search"));?>' class="searchbutton"/> </td> </tr> *************** *** 162,171 **** <input name='year_from' size=4 maxlength="4" type="text" value='<?php print $year_from;?>'/> - <input name='year_to' maxlength="4" value='<?php print $year_to; ?>' size=4 type="text"/> ! <?php ! if (isset ($debug)) { print "<input type=\"hidden\" name=\"debug\" value=\"$debug\">"; } ?> </td> --- 132,141 ---- <input name='year_from' size=4 maxlength="4" type="text" value='<?php print $year_from;?>'/> - <input name='year_to' maxlength="4" value='<?php print $year_to; ?>' size=4 type="text"/> ! <?php if (isset ($debug)) { print "<input type=\"hidden\" name=\"debug\" value=\"$debug\">"; } + ?> </td> *************** *** 176,180 **** </table> - <!-- ************************ Results: ****************************************************** --> <table align="center" class="greyborder" border="0" cellspacing="0" cellpadding="1" width="90%"> <tr> --- 146,149 ---- *************** *** 225,230 **** $search->setSizeOfResultSet($sizeofresultset); $search->setOffset($start -1); ! $search->setFieldsInResult("title url description archiveidentifier"); ! $search->setSupressDuplicates(); if ($search->doQuery()) { --- 194,204 ---- $search->setSizeOfResultSet($sizeofresultset); $search->setOffset($start -1); ! $search->setFieldsInResult("title url description archiveidentifier site"); ! if ($showall) { ! $search->setDedup(0); ! } ! else { ! $search->setDedup(1); ! } if ($search->doQuery()) { *************** *** 237,241 **** if ($total > 0) { print (nls("Total number of versions found")." : <b>$total</b>. "); ! print (nls("Displaying URL's")); print " <b>$start-$numhits</b>"; print "</td></tr>"; --- 211,220 ---- if ($total > 0) { print (nls("Total number of versions found")." : <b>$total</b>. "); ! if ($showall) { ! print (nls("Displaying URL's")); ! } ! else { ! print (nls("Displaying sites")); ! } print " <b>$start-$numhits</b>"; print "</td></tr>"; *************** *** 250,254 **** if ($conf_show_num_verions) { $search2 = new $conf_index_class (); ! $search2->unsetSupressDuplicates(); $search2->setSortorder("descending"); $search2->setSizeOfResultSet(1); --- 229,233 ---- if ($conf_show_num_verions) { $search2 = new $conf_index_class (); ! $search->setDedup(0); $search2->setSortorder("descending"); $search2->setSizeOfResultSet(1); *************** *** 303,307 **** $linkstring = "<a href=\"result.php?time=".$versions[1]['date']."&url=".index_encode($value["url"])."\">".nls("Timeline")."</a>"; $overview = "<a href=\"overview.php?url=".index_encode($value["url"])."\" >".nls("Overview")."</a>"; ! print "<b>".$linkstring." | ".$overview."</b>"; print "<br> <br>"; $last_hit = $key; --- 282,291 ---- $linkstring = "<a href=\"result.php?time=".$versions[1]['date']."&url=".index_encode($value["url"])."\">".nls("Timeline")."</a>"; $overview = "<a href=\"overview.php?url=".index_encode($value["url"])."\" >".nls("Overview")."</a>"; ! $morefromsite ="<a href=\"index.php?query=site:". $value['site'] . " " . $query . "\" >".nls("More from this site")."</a>"; ! print "<b> $linkstring | $overview"; ! if(!$showall) { ! print " | $morefromsite"; ! } ! print "</b>"; print "<br> <br>"; $last_hit = $key; *************** *** 328,332 **** if ($start > 1) { $prev_start = $start - $sizeofresultset; ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$prev_start." \"><< ".nls("Prev")."</a> | "; } --- 312,316 ---- if ($start > 1) { $prev_start = $start - $sizeofresultset; ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$prev_start."&showall=".$showall." \"><< ".nls("Prev")."</a> | "; } *************** *** 339,343 **** print $low_lim."-".$last_hit." | "; } else { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$low_lim." \">".$low_lim."-".$last_hit."</a> | "; } break; --- 323,327 ---- print $low_lim."-".$last_hit." | "; } else { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$low_lim."&showall=".$showall." \">".$low_lim."-".$last_hit."</a> | "; } break; *************** *** 346,355 **** print $low_lim."-".$high_lim." | "; } else { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$low_lim." \">".$low_lim."-".$high_lim."</a> | "; } } } if ($hits_in_set == $sizeofresultset and $search->morepages) { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$next_start."\">".nls("Next")." >></a>"; } print "</b>"; --- 330,342 ---- print $low_lim."-".$high_lim." | "; } else { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$low_lim."&showall=".$showall." \">".$low_lim."-".$high_lim."</a> | "; } } } if ($hits_in_set == $sizeofresultset and $search->morepages) { ! print " <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$next_start."&showall=".$showall."\">".nls("Next")." >></a>"; ! } ! if (!$showall) { ! print " | <a href=\"".$_SERVER['PHP_SELF']."?".$url_querypart."&start=".$start."&showall=true\">".nls("Show all")."</a>"; } print "</b>"; *************** *** 393,402 **** <?php include($conf_includepath . "/footer.inc"); ! ?> ! ! ! ! ! ! ! --- 380,382 ---- <?php include($conf_includepath . "/footer.inc"); ! ?> \ No newline at end of file |