Documentation is as important as the rest of the code, so if something is unclear, missing or just plain wrong, please tell it.
Posts: 1
Joined: Fri Jun 01, 2007 10:04 pm


Postby Kirogl » Fri Jun 01, 2007 10:39 pm

Hi all, I can't find any info on the "GenerateURL" event and what it returns.

I'm trying to write a plugin, that's like SnapShots for wordpress (see ... -anywhere/) but use's for the thumbnails.

So I need to take the string

'<a href="">text</a>'

and make it

'<a href="" onMouseOver(Java call)>text</a>'

as I said I think the GenerateURL is what I'm after but any advice would be welcome.
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts

Postby ftruscot » Sat Jun 02, 2007 12:09 am

function event_GenerateURL(&$data) {


Where $data is an associative array with the follwoing keys:
type is a string which is something like 'blog', 'category', 'item', 'archive' depending on the type of link being generated,
params is an ssociative array of parameters being included in the link. Such as blogid, itemid, catid, etc...
completed is a boolean and passed by reference, so you can set it to true after you have generated your url, so that no other plugin messes it up (you should also check to be sure it is still false before you change the url).
url is a string and is passed by reference so you can set it to be whatever you want.

This probably isn't the best event to use, as it is for generating Nucleus urls and you will conflict with custom/fancy url plugins that some people use to create url schemes for their pages.

You probably want to try something using the 'PreItem','PostItem','PreSkinParse' events. For an example, download the code and look at NP_RightURL.php

Return to “Documentation”