From: Sverre B. <sv...@us...> - 2005-10-06 02:07:45
|
Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13143 Modified Files: index.php Log Message: Now possible to turn of displaying number of versions per hit (expensive) Index: index.php =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.php 5 Oct 2005 01:38:18 -0000 1.3 --- index.php 6 Oct 2005 02:07:37 -0000 1.4 *************** *** 123,137 **** <table border='0' cellpadding='0' cellspacing='0' width=90%> <tr> ! <td class="norm" colspan="5" align="left"><img alt='' height='8' src='/images/1px.gif' width='1'></td> </tr> <tr> ! <td colspan='5' class='border'><img alt='' height='2' src='/images/1px.gif' width='1'></td> </tr> <tr> ! <td colspan='5'><img src='/images/1px.gif' width='1' height='5' alt=''></td> </tr> <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> - <td class="shade" width="5%"><?php print(nls("Match"));?>:</td> <td class="shade"><?php print(nls("Query:"));?></td> <td class="shade" align="right"><a href="<?php print($conf_helplinks['search']['file']);?>"> --- 123,136 ---- <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> </tr> <tr> ! <td colspan='4' class='border'><img alt='' height='2' src='/images/1px.gif' width='1'></td> </tr> <tr> ! <td colspan='4'><img src='/images/1px.gif' width='1' height='5' alt=''></td> </tr> <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> <td class="shade"><?php print(nls("Query:"));?></td> <td class="shade" align="right"><a href="<?php print($conf_helplinks['search']['file']);?>"> *************** *** 141,160 **** <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> - <td class="shade"><form name='search' action=<? echo $_SERVER['PHP_SELF']; ?> method='get'> <?php $query = trim(stripslashes($query)); ! if ($querytype == "phrase") { ! $query = str_replace('"', '', $query); ! } ?> ! <select name='querytype'> ! <option value=all <?php if ($querytype=="all") print "selected"?>><?php print(nls("All words"));?> ! <option value=any <?php if ($querytype=="any") print "selected"?>><?php print(nls("Any word"));?> ! <option value=phrase <?php if ($querytype=="phrase") print "selected"?>><?php print(nls("Exact phrase"));?> ! </select> ! </td> <td colspan="3"> <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);"/> --- 140,152 ---- <tr> <td class="shade" width="10"><img alt='' height='1' src='/images/1px.gif' width="1"></td> <?php $query = trim(stripslashes($query)); ! ?> ! <td colspan="3"> + <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);"/> *************** *** 162,170 **** </tr> <tr> ! <td class="shade" height="30" colspan="2"> </td> <td colspan="3" class="shade" valign="bottom"><?php print(nls("Year"));?> <?php print(nls("(from - to)"))?></td> </tr> <tr> ! <td class="shade" height="30" colspan="2"> </td> <td colspan="3"> <input name='year_from' size=4 maxlength="4" type="text" value='<?php print $year_from;?>'/> - --- 154,162 ---- </tr> <tr> ! <td class="shade" height="30"> </td> <td colspan="3" class="shade" valign="bottom"><?php print(nls("Year"));?> <?php print(nls("(from - to)"))?></td> </tr> <tr> ! <td class="shade" height="30"> </td> <td colspan="3"> <input name='year_from' size=4 maxlength="4" type="text" value='<?php print $year_from;?>'/> - *************** *** 256,284 **** print "(".$value['url'].")<br>"; print "(".$value['description'].")<br>"; - $search2 = new $conf_index_class (); - $vquery = $query . " exacturl:" . urlencode($value["url"]); - $search2->setQuery($vquery); - $search2->unsetSupressDuplicates(); - $search2->setSortorder("descending"); - $search2->setSizeOfResultSet(1); - $search2->setOffset(0); - $search2->setFieldsInResult(date); - if ($search2->doQuery()) { - $versions = $search2->getResultSet(); - $numversions = $search2->getNumHitsTotal(); - } - else { - $numversions = "<b>? <a href=\"" . $search2->queryurl . "\">" . $search2->getErrorMessage() . "</a></b>"; - } - $search2->setQuery("exacturl:" . urlencode($value["url"])); - if ($search2->doQuery()) { - $totalversions = $search2->getNumHitsTotal(); - } - else { - $totalversions = "<b>? <a href=\"" . $search2->queryurl . "\">" . $search2->getErrorMessage() . "</a></b>"; - } ! print nls("Number of versions satisfying query")." / ".nls("total number of versions")." : "; ! print $numversions."/".$totalversions."<br>"; $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>"; --- 248,292 ---- print "(".$value['url'].")<br>"; print "(".$value['description'].")<br>"; ! if ($conf_show_num_verions) { ! $search2 = new $conf_index_class (); ! $search2->unsetSupressDuplicates(); ! $search2->setSortorder("descending"); ! $search2->setSizeOfResultSet(1); ! $search2->setOffset(0); ! $search2->setFieldsInResult(date); ! $numversions_text1 = ""; ! $numversions_text2 = ""; ! ! if ($conf_show_num_verions_matching_query) { ! $vquery = $querystring . " exacturl:" . urlencode($value["url"]); ! $search2->setQuery($vquery); ! ! if ($search2->doQuery()) { ! $versions = $search2->getResultSet(); ! $numversions = $search2->getNumHitsTotal(); ! } ! else { ! $numversions = "<b>? <a href=\"" . $search2->queryurl . "\">" . $search2->getErrorMessage() . "</a></b>"; ! } ! $numversions_text1 = "(" . nls("matching query")."/". nls(total) . ")"; ! $numversions_text2 = $numversions."/"; ! } ! ! ! $search2->setQuery("exacturl:" . urlencode($value["url"])); ! if ($search2->doQuery()) { ! $totalversions = $search2->getNumHitsTotal(); ! } ! else { ! $totalversions = "<b>? <a href=\"" . $search2->queryurl . "\">" . $search2->getErrorMessage() . "</a></b>"; ! } ! ! print nls("Versions") . " "; ! print $numversions_text1 . " "; ! print $numversions_text2 . $totalversions."<br>"; ! } ! ! $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>"; |