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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2012, 04:12 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How Do You create CUSTOM FORUM BUTTONS without left alignment?

I'm trying to figure out how to create custom buttons properly which automatically inherit the style of the forum.

So I figured out if I just wrap the newcontent_textcontrol class around text will make the button with whatever text I want in it, however it's ALWAYS aligned to the left, no matter if I put any type of align="center" in any HTML surrounding it. Very frustrating.

I can't find this particular entry in any of the CSS files, I was searching so I could just duplicate it in additional CSS with a new name and eliminate any attributes that might be causing it to align left no matter what I do.

Here's a snapshot of the type of 'forum button' I'm talking about, http://screencast.com/t/l6fT8YE1Coi1

Essentially what I had come up with so far, but always results in a far left alignment is this:
Code:
<a class="newcontent_textcontrol" href="http://www.forumname.com/wherever-button-goes">Click here</a>
After searching all the various CSS templates for all instances of newcontent_textcontrol I could only find the one I need to duplicate and change so I can align the button however I want.

Basically I just have some ads/banners and I want to use a custom 'click here' button that matches the forum itself.
Reply With Quote
  #2  
Old 04-24-2012, 01:23 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit - WITHOUT the left alignment. I can make the button just need it to not align so I can do whatever I want with it.

Anyone??
Reply With Quote
  #3  
Old 04-24-2012, 05:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can we get a link (and possibly a test username/password) to view the problem? It's impossible to troubleshoot CSS from an image.
Reply With Quote
  #4  
Old 04-25-2012, 06:49 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Lynne thanks for the reply.

If you put this code anywhere on your board, (where you can input html) the button will always be aligned left and I want to be able to do this however without the left alignment.'

Code:
<a class="newcontent_textcontrol" href="http://www.forumname.com/some-link">Click here</a>
I'm assuming there's a newcontent_textcontrol css class somewhere that I can just duplicate, rename, and place in the additional.css template and just remove whatever it is that's forcing the left alignment.

Placing the newcontent_textcontrol class in the HTML is what creates the button, but I can't find newcontent_textcontrol all by itself in any of the css templates.

Ideally, my end product would be something like,
Code:
<a class="my_custom_button" href="http://www.forumname.com/some-link">Click here</a>
but would of course output the same as the code above minus the left alignment.
Reply With Quote
  #5  
Old 04-25-2012, 08:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do a Search in Templates for ".newcontent_textcontrol" and you will find that class defined. It is set to float: left. So, copy it, give it another class name and apply that class to your button.
Reply With Quote
  #6  
Old 04-28-2012, 03:46 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne I did a search in templates for that, and after searching all the css templates that come up, when searching for .newcontent_textcontrol in them (via CTRL+F) I can only find instances of it where it's attached to another class.

Like this,

.above_threadlist .newcontent_textcontrol {

I can't find it by itself like this, to copy and rename,

.newcontent_textcontrol {

Which css template is it in?
Reply With Quote
  #7  
Old 04-28-2012, 04:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look in vbulletin-chrome.css right under where it says "/* NEW CONTENT LINK */"
Reply With Quote
  #8  
Old 04-28-2012, 08:01 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It didn't work Lynne, lol, this is weird.

I went to vbulletin-chrome.css, and found the entry. Which is below
Code:
.newcontent_textcontrol {
	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};
}
I then copied that entry, and pasted it into additional.css and changed the name of the entry from .newcontent_textcontrol to .my_custom_button and saved it. Also I removed the 'float left' attribute from the class.

However if I use the same HTML as above but with the new class it doesn't work, doesn't even show a button at all actually just a clickable text link.

Code:
<a class="my_custom_button" href="http://www.somelink.com">Click here button</a>
Doesn't work after following all the above steps. If you simulate the above steps you should see the same thing happen too I would think (I hope).
Reply With Quote
  #9  
Old 04-29-2012, 03:05 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There could be other classes being applied to the button also based on the way everything cascades (thus, Cascading Style Sheets).
Reply With Quote
  #10  
Old 04-29-2012, 11:55 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So is there anyway I can just create a custom button or are you saying it's impossible now??

All I want for christmas is the ability to make a custom button like above.

Please... please... show me how
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:49 AM.


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.16991 seconds
  • Memory Usage 2,271KB
  • Queries Executed 12 (?)
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
  • (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
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete