http://www.perlmonks.org?node_id=981619

Update: The below has been done. You may disregard. :-)


If you take a look at the code of each of the sections, you'll see a fairly common pattern. SoPW is the canonical case; it looks like this:

[{get_sitedoclet}] [{votehead}] [{newlistapproved:perlquestion,perlquestion approved linktype,User Que +stions,10,navbaron,showunapproved}] [{votefoot}] [{newmoderatelist:perlquestion,perlquestion approved linktype,Unapprov +ed Questions}] [{addnewform:perlquestion,Add your question,Your question:}]

Examining newlistapproved and newmoderatelist, we find that the latter is logically a part of the former, but it seems to have been split out merely in order to "jump over" a call to votefoot.

I propose merging the code of newmoderatelist back into newlistapproved, and add an option parameter which would tell newlistapproved whether to call votefoot at the appropriate point. There is already an option parameter, showunapproved, which controls whether to show the unapproved list.

In order to grasp all the ramifications across the site, I prepared the following table, which summarizes the code of each place newlistapproved is currently used (excluding test nodes and such).

Table is presented in a reply below.

Based on this data, I believe this change would be safe and straightforward to make. The only real oddball we'd have to worry about is Editor Requests, but I think we could handle that.

I think this change will make the code simpler, but perhaps more importantly, more efficient. The overhead cost of calling an htmlcode is substantial. It includes the cost of (a) retrieving the node from the database, and (b) executing a perl eval.

I reckon we are the only monastery ever to have a dungeon stuffed with 16000 zombies.