Sorry, you are right, there is still an error in the line sbillard mentioned, but it's easily corrected:
` $links1 = "<a href="".WEBPATH.getSearchURL($singletag[$x], '', SEARCH_TAGS)."" title="".$singletag[$x]."">"; `
Detete the WEBPATH and it should work.