Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Design and Graphics Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2009, 05:39 PM
grecostimpy grecostimpy is offline
 
Join Date: Mar 2005
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Replacing all of my buttons with text/css - question regarding multiquote

I also posted this on VB.com, but figured I might have better luck here with edited code.

I am replacing all of my postbit buttons with custom made css buttons that I developed. I have every single one of them working correctly except for multiquote.

The multiquote functionality just does not want to work correctly on my dev server.

All other buttons I added work correctly, but it seems this if/else statement is driving my system (and me) batty. The if/else statement basically just says "If post selected for multiquote, then use one image, if it not, use a different image"

Well, originally I had two different css states for the buttons depending on the multiquote function. (two different css classes) but I could not get the if/else statement to work with that. Then I decided to simplify and just do what Vbulletin natively does and do an image switch....I can't seem to get that to work either.

The issue is that half the posts show the state as being on (when they were never clicked) and the other half show it as off (completely random order). Clicking an on or off multiquote button does not change the image.

Any ideas? I'm sure plenty of people have done stuff like this (using html/css in place of buttons...so somebody must have a solution for my multiquote problem!

Here's the original vbulletin multiquote html:

Code:
<if condition="$show['multiquote_post']">
<a href="$post[replylink]" rel="nofollow" onclick="return false"><img src="$stylevar[imgdir_button]/multiquote_<if condition="$show['multiquote_selected']">on<else />off</if>.gif" alt="$vbphrase[multi_quote_this_message]" border="0" id="mq_$post[postid]" /></a>
</if>
Here's my multiquote html (for my new button):

Code:
<if condition="$show['multiquote_post']">
<a href="$post[replylink]" rel="nofollow" onclick="return false" class="buttons" style="margin-bottom:10px; width:60px"> <img src="images/pngbuttons/<if condition="$show['multiquote_selected']">quote<else />quote2</if>.png" alt="$vbphrase[multi_quote_this_message]" border="0" id="mq_$post[postid]" /></a>        
</if>

Here's the css buttons in action:

Attached Images
File Type: gif css-buttons.gif (25.5 KB, 0 views)
Reply With Quote
  #2  
Old 05-14-2009, 08:24 PM
grecostimpy grecostimpy is offline
 
Join Date: Mar 2005
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Note: Once the multiquote issue is fixed (and I QA thoroughly), I plan on releasing this. It's really nice because you can edit the text, images and colors of your buttons all in html/css...no making new buttons in photoshop anymore! Do it all right in the AdminCP.

OK, enough buttering up.
Reply With Quote
  #3  
Old 05-14-2009, 09:59 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have read it somewhere here or at vb.com ... you need to edit one of the javascript to make text link of multiquote button.

If I find the link I will post it here.
Reply With Quote
  #4  
Old 05-14-2009, 10:17 PM
vbboarder's Avatar
vbboarder vbboarder is offline
 
Join Date: Jun 2008
Location: Silicon Valley, CA
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool idea, would be a great mod when you release it.

Have you tried using some JS, like find:
Quote:
onclick="return false"
Replace with:
Code:
onclick="this.className = 'buttons'; return false;"
.
Maybe the class name is not registering when the multiquote state changes. If that doesn't work, maybe you can try similar onclick code with your previous case where you were using 2 css classes. For example, find:
Quote:
onclick="return false"
Replace with:
Code:
onclick="this.className = (this.className == 'buttons1' ? 'buttons2' : 'buttons1'); return false;"
.
Hope that helps, good luck
Reply With Quote
  #5  
Old 05-15-2009, 01:24 PM
grecostimpy grecostimpy is offline
 
Join Date: Mar 2005
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys, thanks for all the suggestions! I finally narrowed it down to the js file that controls multiquote. It references the EXACT image names for multiquote_on and multiquote_off. So, I just renamed my png files to those names and now it works!

Here's the fixed HTML:

Code:
<if condition="$show['multiquote_post']">
<a href="$post[replylink]" rel="nofollow" onclick="return false" class="buttons" style="margin-bottom:10px; width:60px"> <img src="$stylevar[imgdir_button]/multiquote_<if condition="$show['multiquote_selected']">on<else />off</if>.png" alt="$vbphrase[multi_quote_this_message]" border="0" id="mq_$post[postid]" /></a>         
</if>
I also stuck all my png images in the default folder so I don't have to mess with editing the html again if I decide to switch images later on.

Now, I assume I could edit the js file to switch css classes...but I'm clueless when it comes to js, so I'm be happy with this for now.

Thanks again!

Edit:

Well, not so fast unfortunately. If I add text to the button it messes up again. It may just end up being a png icon inside of my css box as my html above shows. I had planned on this (the multiquote button) being a tiny button anyway.
Reply With Quote
  #6  
Old 05-16-2009, 10:40 AM
Bowromir Bowromir is offline
 
Join Date: Dec 2005
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks really good it would be awesome if you'd release it
Reply With Quote
Reply


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 06:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04223 seconds
  • Memory Usage 2,239KB
  • Queries Executed 14 (?)
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
  • (5)bbcode_code
  • (2)bbcode_quote
  • (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
  • (1)postbit_attachment
  • (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_postinfo_query
  • fetch_postinfo
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete