|
|
 |
 |
 |
manilaSuite.discuss.buildIndex
- Adds a call to sys.systemtask in a tight loop over all messages in a website. Needed to stop Frontier consuming all CPU resources while building an index of a big website.
- Support orderign of pictures and stories alphabetically
Amended script:
| on buildIndex (adrSite, categoryName) |
| |
«Build an index -- of stories, pictures, whatever. adrSite is the address of a site; categoryName is a name like "stories" or "pictures." |
| |
local (adrIndex = manilaSuite.discuss.getIndexAddress (adrSite, categoryName)) |
| |
local (listedIn = manilaSuite.discuss.getCategoryName (categoryName, adrSite)) //go from "stories" to "mySiteStories" or whatever |
| |
local (dgName = adrSite^.["#prefs"].discussionRoot) |
| |
manilaSuite.discuss.rpcGetGroupAddress (dgName, @adrDiscussionGroup) |
| |
local (adrMessages = @adrDiscussionGroup^.messages) |
| |
for adrMsg in adrMessages //loop through all messages |
| |
if defined (adrMsg^.flDeleted) //deleted? |
| |
if manilaSuite.discuss.isInCategory (adrMsg, listedIn) //is it in this category? |
| |
local (itemName = string.padWithZeros (adrMsg^.msgNum, 7)) |
| |
«adrTable^.[itemName] = true |
| |
adrTable^.[itemName] = string.lower(adrMsg^.subject) //03/01/21, 17:00:39 by DAB |
| |
thread.sleepfor(0) //03/01/02, 18:23:22 by DAB |
| |
adrIndex^.index = t //copy at the end |
| |
local (sortedBy = "") //03/02/12, 13:45:34 by DAB |
| |
try {sortedBy = adrIndex^.sortedBy} //03/02/12, 13:45:38 by DAB |
| |
local (sortedByWanted = "name") |
| |
if manilaSuite.getNewssitePref("flstoriesAlphaSort", adrSite, false, true) //03/02/12, 13:46:35 by DAB |
| |
if sortedByWanted != sortedBy |
| |
local (oldTarg = target.set(@adrIndex^.index)) |
| |
table.sortby(sortedByWanted) //03/02/12, 13:45:53 by DAB |
| |
try {target.set(oldTarg)} |
| |
adrIndex^.flValid = true //we just built it, it's valid |
| |
adrIndex^.flValueIsSubject = true //03/02/01, 17:22:57 by DAB |
| |
adrIndex^.sortedBy = sortedByWanted //03/02/12, 13:50:11 by DAB |
| «buildindex(@uniquemarketingManilawebsite, "stories") |
| «buildindex(@uniquemarketingManilawebsite, "pictures") |
Relative to Frontier version 9.7b10
|