Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-29-2012, 03:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not impossible at all, but you will need to use something like firebug to view all the CSS being applied to it and then create your own.
Reply With Quote
  #12  
Old 04-29-2012, 07:49 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
It's not impossible at all, but you will need to use something like firebug to view all the CSS being applied to it and then create your own.
That's what I did, used firebug and I came up with the newcontent_textcontrol class...

Am I duplicating the wrong class?

If,

Code:
<a class="newcontent_textcontrol" "href="http://www.urlhere.com">button text here</a>
makes a custom button just as I need, except with the forced left alignment, if I copy the class and change it's name the following should work fine right?

Code:
<a class="new_custom_class" href="http://www.urlhere.com">button text here</a>
should show the same thing right? It's bizarre, although the name of the class in that css file is the exact same, it doesn't seem to work once I duplicate it and put it in additional.css

I'm honestly stumped on this I felt like I've gone through every single css file here and can't find the correct class to duplicate and edit... I will do 100 push-ups if you can figure this connundrum out for me (not all at once though I'm not in that good of shape)
Reply With Quote
  #13  
Old 04-29-2012, 10:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, they shouldn't necessarily show the same thing. What if the CSS you are stealing it from is like this:

HTML Code:
<div class="thisclass">
<a class="newcontent_textcontrol" "href="http://www.urlhere.com">button text here</a>
</div>
And you put yours in like this:
HTML Code:
<div class="otherclass">
<a class="new_custom_class" href="http://www.urlhere.com">button text here</a>
</div>
There could be css that is for ".thisclass .newcontent_textcontrol" and unless you also write ".otherclass .new_custom_class" that is exactly the same, then you are going to have different results. These are *cascading* style sheets which means the little <a> that you are writing gets all the CSS from all the classes "above" it also.
Reply With Quote
  #14  
Old 04-29-2012, 11:53 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Interesting, so are you saying that I need to add MORE to the new entry I put in additional.css?

I posted above, the css class you pointed out in that template, do I need to have that AND the contents of another class somewhere as well? I'm kind of understanding the cascading stylesheets thing, I just don't know how to put it together and get this to work.

This is what I have so far (which isn't working),

Code:
.my_new_button {
	background: {vb:stylevar control_content_background};
	_background-image: none;
	-moz-border-radius: {vb:stylevar control_content_radius};
	-webkit-border-radius: {vb:stylevar control_content_radius};
	-moz-box-shadow: 0 3px 8px {vb:stylevar control_content_shadow_color};
	-webkit-box-shadow: 0 3px 8px {vb:stylevar control_content_shadow_color};
	font: {vb:stylevar control_content_font};
	color: {vb:stylevar control_content_color};
	padding: {vb:stylevar control_content_padding};
	border: {vb:stylevar control_content_border};
	display:block;
	clear: {vb:stylevar right};
}
That includes everything from the newcontent_textcontrol class in the template you pointed out. It looks like it should make a button... but it doesn't make a button...
Reply With Quote
  #15  
Old 04-30-2012, 01:36 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since you have not provided any link to be able to see exactly what CSS is being used on the custom button, and a link to see exactly what CSS is being used on the button you are trying to copy, it's impossible to see what is missing. I am pretty sure when you look at the button using firebug that you are no seeing just that one class - I'll bet there is a whole list of stuff on the right side. *All* of those items listed on the right side are adding to the style of the button you are looking at.
Reply With Quote
  #16  
Old 04-30-2012, 03:13 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, ok.

Well, for starters I haven't tested the button in any 'particular' place, however I've been testing it in the advertising spots. I want to create ads, with the custom buttons underneath. The ads will show pretty much anywhere, I'm talking in the header AND in first/last post of threads.

I've tested the HTML I provided in these ad spots, so if you were to put the code in for example, the global ad that shows above forums (large banner spot), you should be the same results as my own.

I was putting the button in center tags to test, in the top ad area and first/last post ad areas.
Reply With Quote
  #17  
Old 04-30-2012, 03:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just added this to my additional.css template:
HTML Code:
.my_custom_button {
	background: {vb:stylevar control_content_background};
	_background-image: none;
	-moz-border-radius: {vb:stylevar control_content_radius};
	-webkit-border-radius: {vb:stylevar control_content_radius};
	-moz-box-shadow: 0 3px 8px {vb:stylevar control_content_shadow_color};
	-webkit-box-shadow: 0 3px 8px {vb:stylevar control_content_shadow_color};
	font: {vb:stylevar control_content_font};
	color: {vb:stylevar control_content_color};
	padding: {vb:stylevar control_content_padding};
	border: {vb:stylevar control_content_border};
	display:block;
	float: {vb:stylevar left};
	clear: {vb:stylevar right};
}
And added this to my Advertising > global > Header 1 code:
HTML Code:
<a class="my_custom_button" href="http://www.somelink.com">Click here button</a>
and this is my result:


Isn't that what you want?
Attached Images
File Type: png Screen Shot 2012-04-30 at 9.08.13 AM.png (23.6 KB, 0 views)
Reply With Quote
  #18  
Old 04-30-2012, 07:03 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok that does recreate the button, however it is still a forced left alignment.

If I remove the following from the css entry,
Code:
        float: {vb:stylevar left};
	clear: {vb:stylevar right};
the button becomes what seems like a 100% width, rather than the width of the text. If I put center tags around it, the text is centered within the button background but the button remains that 100% width, although I don't see that specified in the css entry.

So at least now I have a css class to mess with, any idea how I should modify this class so there's no forced left alignment, but keep the button the same size as the text as it is by default in vbulletin?

BTW thanks Lynne I appreciate your help this is driving me nuts. I apologize if I'm driving you nuts as well
Reply With Quote
  #19  
Old 04-30-2012, 09:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, in that particular spot, if you remove those two lines, and you leave it in that ad spot, then you would need to look at the CSS for "#ad_global_header1" because it is surrounded by <div>s with that id and it so happens that the CSS for that floats it left. So, you would need to write some custom CSS to not float the ad div left also.
Reply With Quote
  #20  
Old 04-30-2012, 10:51 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh boy. I didn't realize it was going to be this complicated to make a custom button that looks like my forum and doesn't have a forced left alignment. I give up.

I can center anything else I want to center, anywhere on the forum, except for this button I can't stand it.

Going to have to hire a coder or something.

Thanks Lynne.
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 06:15 PM.


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.02718 seconds
  • Memory Usage 2,279KB
  • 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
  • (4)bbcode_code
  • (4)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete