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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2004, 02:38 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Attachment button problem - how to fix?

I'm modifying a new skin. I haven't touched the newpost_attachment template.

What I have done however, is used the .css to create rollover effects for the buttons on the board. This one "attachment button" is the only one, that causes any troubles with it, and I'm not sure why. The button isn't even showing up.

My code for the rollover effects for the buttons is:

Code:
.button {     background-image: url("picts/button.gif");
        background-color:#FFFFFF;
        FONT-FAMILY: arial, verdana, helvetica, sans;
        color: #000066;
        font-size: 8pt;
        height: 20px;
        cursor:hand;
        font-weight: bold;
        text-align: center;
        BORDER: #000066 1px solid }

.buttonon { background-image: url("picts/buttonon.gif");
        background-color:#F0F0F0;
        FONT-FAMILY: arial, verdana, helvetica, sans;
        color: #660000;
        font-size: 8pt;
        height: 20px;
        cursor:hand;
        font-weight: bold;
        text-align: center;
        BORDER: #660000 1px solid }
Now to call this up for each button, I used a replacement variable:

class="button" has been replaced with: class="button" onmouseover="this.className='buttonon'" onmouseout="this.className='button'"

The button IS there and reflects the .button .css just fine. But it does not respond to the .buttonon, in fact, it doesn't even show up...not even when it is "off".

Again, all other buttons work fine...it is just the "attachment" button that doesn't. The "newpost_attachment" template hasn't been touched, it's using the default.

The beta forum where I've been working on this is: www.myfamilycorner.net/forums/

You can login and see for yourself by trying to add an attachment, by using:

login: tester
pass: testpass

Any help on this would be greatly appreciated.
Reply With Quote
  #2  
Old 07-19-2004, 02:54 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
document.write('<input type="button" class="button" onmouseover="this.className='buttonon'"
That's the problem - the single quotes arround buttonon. The first one terminates the whole string for document.write, which makes the script invalid -> not executable. You must escape them.
Reply With Quote
  #3  
Old 07-19-2004, 05:12 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you. But how do I "escape" them properly?

I did this:
Code:
 class="button" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'"
That makes the Attachment button work perfectly...but now the other buttons won't work. They appear at least...but "buttonon" won't appear for the rolllover effect.
Reply With Quote
  #4  
Old 07-19-2004, 05:15 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use \'
Reply With Quote
  #5  
Old 07-19-2004, 05:28 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, now the attachment button is gone, and there are no "buttonon" images for the rolloevers.

The code is now:
Code:
 class="button" onmouseover="this.className=\''buttonon\''" onmouseout="this.className=\''button\''"
The html output from "view source" is:

Code:
document.write('<input type="button" class="button" onmouseover="this.className=\''buttonon\''" onmouseout="this.className=\''button\''"
Reply With Quote
  #6  
Old 07-19-2004, 05:33 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
class="button" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'"
This should be correct.
Reply With Quote
  #7  
Old 07-19-2004, 07:00 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope.

That results in: 1) no attachment button, and 2) no rollover effect for all the rest of the buttons.

The html is:
Code:
document.write('<input type="button"class="button" onmouseover="this.className=\'buttonon\'" onmouseout="this.className=\'button\'"
Is there another way to do this perhaps?
Reply With Quote
  #8  
Old 07-19-2004, 08:00 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm ... the button is there for me?
Reply With Quote
  #9  
Old 07-19-2004, 10:41 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I removed the code. You viewed it w/o the code. The button shows up fine when the code isn't there.

I noticed that this was affecting the LOGIN button as well. So I was wrong about it not affecting any other button...I just had not noticed it before.

I don't think that this is possible (rollovers + vbulletin code). But I'm willing to put the code back up to anyone who wants to give it a try. hehe
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 12:45 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.04531 seconds
  • Memory Usage 2,240KB
  • 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
  • (5)bbcode_code
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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