Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 10-10-2009, 08:36 PM
PyroNET PyroNET is offline
 
Join Date: Aug 2004
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Change Multiquote Button to Text

I'm trying to swap my postbit buttons images for CSS styled buttons and am having troubles with the multiquote button.

Relevant HTML:

HTML Code:
<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
Code:
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?
Reply With Quote
  #2  
Old 09-10-2010, 04:17 PM
pcunite pcunite is offline
 
Join Date: Aug 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am running into trouble with this as well. I have the other buttons switched to txt.
Reply With Quote
  #3  
Old 09-10-2010, 07:20 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-10-2010, 08:04 PM
pcunite pcunite is offline
 
Join Date: Aug 2010
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, well I can live with a tiny custom multiquote image I made.
Reply With Quote
  #5  
Old 09-10-2010, 10:32 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)

HTML Code:
<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

Code:
var A=fetch_tags(D,"img");
to
Code:
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).
Reply With Quote
  #6  
Old 03-29-2011, 06:50 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any mastered this without CSS, just doing straight HTML text links?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09305 seconds
  • Memory Usage 2,202KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete