From: Gary B. <ga...@in...> - 2001-09-21 19:00:45
|
On Fri, 21 Sep 2001, Gary Benson wrote: > > > Any of you guys who are running a PhpWiki-1.2.0 site may benefit from this > > > patch, which should lower the load on your server. It removes an > > > "efficiency" thing which meant that the MostPopular list was generated on > > > every pageview. > > > > Hi Gary, > > > > Good catch! > > > > But... I think your patch makes the situation worse. > > > > > + $tmpline = str_replace('%%Search%%', RenderQuickSearch(), $tmpline); > > > + $tmpline = str_replace('%%Fullsearch%%', RenderFullSearch(), $tmpline); > > > + $tmpline = str_replace('%%Mostpopular%%', RenderMostPopular(), $tmpline); > > > > I think this calls RenderMostPopular() once for every line in the > > page... > > I think the correct fix is something like: > > > > if (strstr($tmpline, '%%Mostpopular%%')) > > $tmpline = str_replace('%%Mostpopular%%', RenderMostPopular(), > > $tmpline); > > > > (Not that I've tested any of this or anything...) > > Doh! > > Expect a revised patch soonish... Try these two instead... |