Awesome work, Ormus
! I think you may have dragged this from "broken, partly-functional crud" to "desirable working plugin".
Incidentally, I originally couldn't run Shadowbox at all. Thanks to LordCoffee's hint, I discovered that the problem was my path: it needed the slash on the end. As soon as I added it, three box types that didn't work before started working.
ormus7577 wrote:As for the detection part, judebert: do you think regexp can help us here? We would have to check for already existing rel/class attributes of links. Thickboxs uses the class attribute, so we would have to set a second class anyway (beside serendipity_image_link).
Yes, it does get complicated, requiring lookbacks, alternative branches, and negations. I wouldn't want to come up with a regex for that. (Or multiple passes to mark and unmark stuff.)
However, we might be able to solve the problem with preg_replace_callback. The callback function could use class variables to determine what to look for, and in what attribute. We could roll the check-for-replacement stuff in there too, eliminating the 5.1 version check. I'm just worried about performance. After you get everything working, maybe I'll look into that.
Yes, I figure that will work, too. I just hate entry-specific stuff. It feels like cheating. But if the only other option is to hurt everybody, I'll turn off Lightbox markup for that entry.
I'll look into that. My problem at the moment is that everything is getting 'rel="lightbox"' attached to it. I added some debugging and found that $type, $regex, and $sub are correctly set. I turned off caching. I eventually got so frustrated that I started pulling out my hair, so I stopped. (You never know if that stuff is going to grow back.) "It works, that's good enough."