From: Steve W. <wai...@us...> - 2001-07-07 17:34:55
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv15027 Modified Files: search.php Log Message: Reformatted the code by hand to PEAR standards. Well, mostly by hand. php-mode doesn't like variable assignments that span several lines like: $html = "<P><B>" . sprintf(gettext ("Searching for \"%s\" ....."), htmlspecialchars($searchterm)) . "</B></P>\n"; I have to indent this by hand. Index: search.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/search.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** search.php 2001/02/12 01:43:10 1.5 --- search.php 2001/07/07 17:34:52 1.6 *************** *** 1,31 **** <?php - // Title search: returns pages having a name matching the search term - rcs_id('$Id$'); ! if (empty($searchterm)) ! $searchterm = ''; // FIXME: do something better here? ! fix_magic_quotes_gpc($searchterm); ! $html = "<P><B>" ! . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($searchterm)) ! . "</B></P>\n"; ! ! // quote regexp chars ! $search = preg_quote($searchterm); ! ! // search matching pages ! $query = InitTitleSearch($dbi, $searchterm); ! $found = 0; ! while ($page = TitleSearchNextMatch($dbi, $query)) { ! $found++; ! $html .= LinkExistingWikiWord($page) . "<br>\n"; ! } ! ! $html .= "<hr noshade>\n" ! . sprintf(gettext ("%d pages match your query."), $found) ! . "\n"; ! echo GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0); ?> --- 1,34 ---- <?php ! // Title search: returns pages having a name matching the search term ! rcs_id('$Id$'); ! if (empty($searchterm)) ! $searchterm = ''; // FIXME: do something better here? ! fix_magic_quotes_gpc($searchterm); ! ! $html = "<P><B>" ! . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($searchterm)) ! . "</B></P>\n"; ! ! // quote regexp chars ! $search = preg_quote($searchterm); ! ! // search matching pages ! $query = InitTitleSearch($dbi, $searchterm); ! $found = 0; ! while ($page = TitleSearchNextMatch($dbi, $query)) { ! $found++; ! $html .= LinkExistingWikiWord($page) . "<br>\n"; ! } ! ! $html .= "<hr noshade>\n" ! . sprintf(gettext ("%d pages match your query."), $found) ! . "\n"; ! ! echo GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0); ! ?> |