PDA

View Full Version : Change Multiquote Button to Text


PyroNET
10-10-2009, 08:36 PM
I'm trying to swap my postbit buttons images for CSS styled buttons and am having troubles with the multiquote button.

Relevant HTML:

<if condition="$show['multiquote_post']">
<li id="mq_$post[postid]">
<a href="$post[replylink]" rel="nofollow" onclick="return false">$vbphrase[multi_quote_this_message] +</a>
</li>
</if>


Altered portion of vbulletin_multi_quote.js
function change_mq_image(postid, to_selected)
{
var mq_obj = fetch_object('mq_' + postid);
if (mq_obj)
{
if (to_selected == true)
{
mq_obj.className = 'mq_selected';
mq_obj.innerHTML = mq_obj.innerHTML.replace('+', '-');
}
else
{
mq_obj.className = '';
mq_obj.innerHTML = mq_obj.innerHTML.replace('-', '+');
}
}
}

I want the script to add the class 'mq_selected' to the element and swap the + for a -, but it currently does neither. Anybody know why?

pcunite
09-10-2010, 04:17 PM
I am running into trouble with this as well. I have the other buttons switched to txt.

kh99
09-10-2010, 07:20 PM
Well, regarding the above code - There's a function called mq_init (also in vbulletin_multi_quote.js) which sets stuff up by calling fetch_tags and passing "img". Since the modified code removed the images, this might be the problem. Maybe changing it to "li" will work. But I wasn't able to make it through all the javascript so I'm not sure.

pcunite
09-10-2010, 08:04 PM
Okay, well I can live with a tiny custom multiquote image I made.

kh99
09-10-2010, 10:32 PM
Just for the record, that does seem to work. Well, with another change: I tested it by getting rid of the "li" tags and putting the id in the "a" tag (in the postbit_legacy template)

<if condition="$show['multiquote_post']">
<a id="mq_$post[postid]" href="$post[replylink]" rel="nofollow" onclick="return false">$vbphrase[multi_quote_this_message] +</a>
</if>


then in vbulletin_multi_quote.js I changed

var A=fetch_tags(D,"img");

to
var A=fetch_tags(D,"a");

and also replaced the change_mq_image function with the code posted by the OP.

One other thing, the way the OP's code works, the text for the multi quote link can't have any + or - in it except at the end (for instance, "Multi-Quote this Message" doesn't work right).

kau
03-29-2011, 06:50 PM
Any mastered this without CSS, just doing straight HTML text links?