On 28/11/05, Amruta Lonkar gtg808u@mail.gatech.edu wrote:
That makes sense. What is happening though is that an article can have any number of references in it and every reference has a unique id associated with it. So my purpsoe in using wgHooks is to save this reference id for every reference in the article in the database and this id can be obtained only once the user parses the string between the <ref>..</ref> tags i.e in the renderReference function in the extension file. In that case do you think this will work?.
Hm... I'm not sure - I can't see a reason why extension tags would necessarily get parsed at all during the pre-save transform (as opposed to when *viewing* the article), but then I don't know that they won't.
Even so, I would suggest storing the IDs somewhere (e.g. create a global variable called something like $wgReferenceIDs[]) rather than just calling hooked functions multiple times - not that the other way won't work, but it just seems like "nicer" coding to do them all in one go. So, assuming renderReference() is getting called when you want it to, you can just have it add to $wgReferenceIDs[] (or whatever) and the other two functions can run exactly once and process everything from that list.
-- Rowan Collins BSc [IMSoP]