vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Convert buttons to text - multiquote problem (https://vborg.vbsupport.ru/showthread.php?t=265578)

Spinball 06-21-2011 09:46 AM

Convert buttons to text - multiquote problem
 
Hello,
I don't think I will have a problem replacing buttons with links which are stuled to look like buttons, but I am struggling with the Multiquote button.
This threadhttps://vborg.vbsupport.ru/showthread.php?p=1604783#post1604783
offers an answer which doesn't work.
Code:

<a href="$post[replylink]" rel="nofollow" onclick="return false"><span style="color:<if condition="$show['multiquote_selected']">green<else />red</if>;" id="mq_$post[postid]">$vbphrase[multi_quote_this_message]"</span></a>
The javascript - wherever it is - doesn't want to work on the <span.

Any help appreciated.
Thanks

Spinball 06-24-2011 07:02 AM

Ok I've examined the Javascript and established that it's the function which uses the img tag content which won't work on a span.
I'm surprised there isn't a resource on here which has already been created to help people wanting to do this.
Also somewhat disappointed (though not entirely surprised) at the lack of response to my thread.

BirdOPrey5 06-27-2011 12:21 AM

I could respond but I wouldn't have anything of value to add- JavaScript isn't one of my strong points. ;)

Spinball 06-27-2011 06:49 AM

I compromised and used buttons in the end.
Is there a decent forum out there where I could get a better response to this or is vBulletin dead?

BirdOPrey5 06-27-2011 08:55 AM

Quote:

Originally Posted by Spinball (Post 2213414)
I compromised and used buttons in the end.
Is there a decent forum out there where I could get a better response to this or is vBulletin dead?

vBulletin's not dead... The obvious answer is if you don't get a lot of responses what you're asking is either:

1) A lot harder to do than you think it is
and/or
2) No one else really thinks it's worth the effort

I'd say this is probably a combination of both- is it really that big a deal to change multi-quote to text? A small 4 color gif file will load just as fast even on a mobile browser and work just fine as is- probably look better too.

That combined with the fact good javascript programmers are much more rare on this site than good php programmers probably has a lot to do with it.

BirdOPrey5 06-27-2011 09:37 AM

I got it working. :)

Guess I picked up more about javascript than I though.

Open your vbulletin_multi_quote.js file

find:

Code:

(D,"img")
replace with:
Code:

(D,"span")
find:
Code:

{A.src=A.src.replace(/\/multiquote_off\.([a-zA-Z0-9]+)$/,"/multiquote_on.$1")}
replace with:
Code:

{A.textContent = "MultiQuote On";A.style.color = "green";}
find:
Code:

{A.src=A.src.replace(/\/multiquote_on\.([a-zA-Z0-9]+)$/,"/multiquote_off.$1")}
replace with:
Code:

{A.textContent= "MultiQuote Off";A.style.color = "red";}

I used the replacement instead of what you put in your first post:
Code:

<a href="$post[replylink]" rel="nofollow" onclick="return false"><span style="color:red;" id="mq_$post[postid]">$vbphrase[multi_quote_this_message]</span></a>

Motasm 11-18-2013 08:21 PM

thank you


All times are GMT. The time now is 06:37 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.01084 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete