-Phew- First of all, thanks for pointing me to functions.php. It's really helping me to begin understanding how vbulletin works.
After a lot of learning (particularly noteworthy is the php str_replace) as well as furthering my understanding of vbulletin's functions, I've managed to create a working concept. Any character I throw at it it replaces with a javascript-friendly version.
I set up a live example
here.
You'll see though in the example that the thread on the right doesn't show the tooltip. This is because the post preview (pagetext) has a line break in it. To remedy this problem, I did the following:
PHP Code:
$placeholders = array("'", "<br />");
$fixup = array("\'", " ");
$saPreview2 = str_replace($placeholders, $fixup, $lastxdevel2['pagetext']);
What's odd is, if you view the source you will indeed see that the <br /> has been properly replaced with a space. Yet there is still a line break, and more importantly, the tooltip still does not work.
So my question is, why would a line break in pagetext cause the tooltip to cease functioning? Is there something about how vbulletin handles line breaks in pagetext that I'm unaware of? Or is this a javascript syntax conflict? I know that javascript ignores whitespace so I'm leaning towards the possibility this is more a vbulletin issue than a javascript one...