PDA

View Full Version : How do I center the user profile bit


TNERatedEdge
07-19-2012, 02:03 PM
I want the avatar, location, and posts centered.

how do I do that

Lynne
07-19-2012, 04:01 PM
You would just add some CSS to your additional.css template to center things. I can't be more specific since you didn't provide a link to a showthread page on your site.

TNERatedEdge
07-19-2012, 04:20 PM
<a href="http://www.mysportslegion.com/forums/showthread.php?13424-David-Ortiz-to-15-day-DL" target="_blank">http://www.mysportslegion.com/forums...z-to-15-day-DL</a>

see how it's not centered?

ForceHSS
07-19-2012, 04:48 PM
Guests can't see plz update user group permissions or give a temp user name

TNERatedEdge
07-19-2012, 06:04 PM
<a href="http://www.mysportslegion.com/forums/showthread.php?13461-Team-USA-vs-Great-Britain-Discussion-Thread-%282-10-EST-on-ESPN2%29" target="_blank">http://www.mysportslegion.com/forums...ST-on-ESPN2%29</a>

ForceHSS
07-19-2012, 09:05 PM
I see nothing wrong with what you have. Looks to me you are looking for some custom work done if so you need to post in the correct section

Lynne
07-19-2012, 09:22 PM
For the avatar, try:
.postbitlegacy .userinfo a.postuseravatar {
display: block;
text-align: center;
width: 100%;
}
I don't think you can center just the posts and location without modifying the template and giving them their own class.

Sarteck
07-19-2012, 10:46 PM
I allow my users to select whether or not they want the username, avatar, user ranks, etc., alligned to the left, right, or centered using the followng plugin on parse_templates hook.


global $vbulletin,$template_hook;

$css_additional = array();

/// Postbit Alignment
if ($vbulletin->userinfo['field43'] == 'Centered')
{
$css_additional[] = '.postdetails .userinfo {text-align:center;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:auto;margin-right:auto;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:center;}';
}
if ($vbulletin->userinfo['field43'] == 'Left')
{
$css_additional[] = '.postdetails .userinfo {text-align:left;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:0px;margin-right:auto;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:left;}';
}
if ($vbulletin->userinfo['field43'] == 'Right')
{
$css_additional[] = '.postdetails .userinfo {text-align:right;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:auto;margin-right:0px;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:right;}';
}
$template_hook['headinclude_bottom_css'] .= '<style type="text/css">'."\n".implode("\n",$css_additional)."\n".'</style>';

I have a User Profile Field that's a drop-down element containing "Left", "Right", and "Center". This profile field is field43. That's why it's set up like that. If you just want to always have it centered, you only need something like:

global $vbulletin,$template_hook;
$css_additional = array();
/// Postbit Alignment [Center]
$css_additional[] = '.postdetails .userinfo {text-align:center;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:auto;margin-right:auto;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:center;}';
$template_hook['headinclude_bottom_css'] .= '<style type="text/css">'."\n".implode("\n",$css_additional)."\n".'</style>';

(You don't even need the array, it could just be a string; I just do it that way to make it easier to modify.)

Syxguns
07-19-2012, 11:18 PM
Sartreck,
I love your idea, and hope it works for what I'm searching for. I'm searching to center user profile fields.

However, for forum fields I found something that works great, it just doesn't work for the user profile.

Open additional.css and place this code in there. You will have to do it for every style that you have.


/* center avatar, username, title, rank in postbit legacy 4.x.x */
.postbitlegacy .userinfo .username_container, .postbitlegacy .userinfo .rank, .postbitlegacy .userinfo .usertitle {text-align:center;}
.postbitlegacy .userinfo .postuseravatar, .postbitlegacy .userinfo .postuseravatar img {float:none; text-align:center;}
.postbitlegacy .userinfo .usertitle {display: block; float:none; text-align:center; clear: both;}

Sarteck
07-19-2012, 11:51 PM
Well, for Profile Fields, I have something else altogether.


I change the display of the existing fields to "none", and put in my OWN stuff.







parse_templates
global $vbulletin,$template_hook;


$css_additional = array();

$css_additional[] = '.userinfo_extra {display:none !important;}';
$css_additional[] = '.imlinks {display:none !important;}';
$css_additional[] = '.onlinestatus {float:left;left:5px !important;}';

/// Postbit Alignment
if ($vbulletin->userinfo['field43'] == 'Centered')
{
$css_additional[] = '.postdetails .userinfo {text-align:center;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:auto;margin-right:auto;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:center;}';
}
if ($vbulletin->userinfo['field43'] == 'Left')
{
$css_additional[] = '.postdetails .userinfo {text-align:left;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:0px;margin-right:auto;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:left;}';
}
if ($vbulletin->userinfo['field43'] == 'Right')
{
$css_additional[] = '.postdetails .userinfo {text-align:right;}';
$css_additional[] = '.postdetails .userinfo .username_container {width:auto;margin-left:auto;margin-right:0px;}';
$css_additional[] = '.postbitlegacy .userinfo .postuseravatar, .eventbit .userinfo .eventuseravatar {text-align:right;}';
}
$template_hook['headinclude_bottom_css'] .= '<style type="text/css">'."\n".implode("\n",$css_additional)."\n".'</style>';




cache_templates
$cache[] = 'sar_postbit_info_extra';


postbit_display_complete
//global $vbulletin,$show,$template_hook;
global $vbulletin;

/// User Info Shit
$templater = vB_Template::create('sar_postbit_info_extra');
$templater->register('post', $post);
$uinfobit = $templater->render();
$template_hook['postbit_userinfo_right'] = $uinfobit;


postbit_display_start (to make it work with PMs)
global $vbulletin;
if (THIS_SCRIPT == 'private')
{
$user = fetch_userinfo($post['fromuserid'],2);
$post = array_merge($user,$post);
$post['postid'] = $post['pmid'];
}











Damned 20,000 character limit is making me split this post.

Sarteck
07-19-2012, 11:52 PM
HTML Templates:
sar_postbit_info_extra Note that this will change drastically depending on what you want to display. X3
<div class="block">
<h2 style="text-align:center;font-size:10px;" class="blockhead" onmouseover="toggle_content({vb:raw post.postid});">(Hover Here for Info)</h2>
<div class="blockbody">
<vb:if condition="$vbulletin->userinfo['field56'] != 'Collapse'">
<div class="blockrow" id="postbit_tabs_{vb:raw post.postid}_content_table" style="margin:3px;padding:3px;display:block;">
<vb:else />
<div class="blockrow" id="postbit_tabs_{vb:raw post.postid}_content_table" style="margin:3px;padding:3px;display:none;">
</vb:if>
<!-- Tab Heads Start -->
<h2 style="text-align: center;" class="blockhead">
<div id="postbit_tabs_{vb:raw post.postid}_head"><!-- Begin tab_heads -->
<div class="sar_postbit_tab_head_active" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">D</div>
<div class="sar_postbit_tab_head_inactive" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">A</div>
<div class="sar_postbit_tab_head_inactive" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">B</div>
<div class="sar_postbit_tab_head_inactive" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">G</div>
<div class="sar_postbit_tab_head_inactive" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">H</div>
<div class="sar_postbit_tab_head_inactive" onmouseover="activate_postbit_tab(this,{vb:raw post.postid});">$</div>
<div class="clearbit" style="clear: both;"> </div>
</div>
</h2>
<!-- Tab Heads End -->
<div class="blockbody">
<div class="blockrow" id="postbit_tabs_{vb:raw post.postid}_content">
<!-- Tab Contents Start -->

<!-- TAB START: "D" -->
<div class="sar_postbit_tab_content_active">
<vb:if condition="$post['joindate']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">{vb:rawphrase join_date}</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.joindate}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field2']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">{vb:rawphrase location_perm}</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.field2}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">{vb:rawphrase 'posts'}</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.posts}</div>
<div style="clear: both;"> </div>
</div>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;"><img src="images/statusicon/coin.gif" class="inlineimg" border="0" />Han</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.han}</div>
<div style="clear: both;"> </div>
</div>
<vb:if condition="$post['g13_div']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Guild</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.guildname}</div>
<div style="clear: both;"> </div>
</div>
<vb:if condition="($post['g13_div'] != 46) AND ($post['g13_rank'] > 0)">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Rank</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">&nbsp;<vb:if condition="$post['g13_rank'] == 1">Guild Master<vb:elseif condition="$post['g13_rank'] == 2" />Guardian<vb:elseif condition="$post['g13_rank'] == 3" />Guardian<vb:elseif condition="$post['g13_rank'] == 4" />Guardian<vb:elseif condition="$post['g13_rank'] == 5" />Guardian<vb:else />Regular</vb:if></div>
<div style="clear: both;"> </div>
</div>
</vb:if>
</vb:if>
<vb:if condition="$post['field25']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">GFX Class</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.field25}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">{vb:rawphrase blog_entries}</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">&nbsp;<a href="{vb:link blog, {vb:raw post}, null, 'userid', 'blog_title'}">{vb:raw post.entries}</a></div>
<div style="clear: both;"> </div>
</div>
</div>
<!-- TAB END: "D" -->
<!-- TAB START: "A" -->
<div class="sar_postbit_tab_content_inactive"><!-- Begin 'A' : each node here is a part of List A -->
<vb:if condition="$post['field6']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Fav Anime</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field6}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field7']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Fav Manga</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field7}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field5']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Fav Character</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field5}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Claimlist</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;"><a href="claimlist.php?do=gen_list&oid={vb:raw post.userid}">Click</a></div>
<div style="clear: both;"> </div>
</div>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">TT Deck</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;"><a href="ttv2.php?do=cardlist&amp;uid={vb:raw post.userid}" rel="nofollow">Clicky</a></div>
<div style="clear: both;"> </div>
</div>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Thanked</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.post_thanks_user_amount_formatted}</div>
<div style="clear: both;"> </div>
</div>
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:100%;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
{vb:rawphrase post_thanks_times_posts, {vb:raw post.post_thanks_thanked_times_formatted}, {vb:raw post.post_thanks_thanked_posts_formatted}}
</div>
</div>
</div>
<!-- TAB END: "A" -->
<!-- TAB START: "B" -->
<div class="sar_postbit_tab_content_inactive"><!-- Begin 'B' : each node here is a part of List B -->
<vb:if condition="$post['field23']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Gender</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field23}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field49']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">PSN ID</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field49}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field50']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Gamertag</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field50}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field1']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">About Me</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field1}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field3']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Interests</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field3}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['field4']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Occupation</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:var post.field4}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
</div>
<!-- TAB END: "B" -->


<!-- TAB START: "G" -->
<div class="sar_postbit_tab_content_inactive"><!-- Begin 'G' : each node here is a part of List B -->
<vb:if condition="$post['gifts']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Gifts</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.gifts}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
<vb:if condition="$post['ribbons']">
<div style="border-width:1px;border-style:solid;margin:2px;padding:2px;">
<div style="width:40%;float:left;font-size:10px;font-weight:normal;font-variant:small-caps;text-align:right;font-family:Verdana,Tahoma,Arial;">
<span style="margin-right:5px;">Ribbons</span>
</div>
<div style="width:60%;float:left;font-size:11px;font-weight:normal;text-align:left;font-family:Verdana,Tahoma,Arial;">{vb:raw post.ribbons}</div>
<div style="clear: both;"> </div>
</div>
</vb:if>
</div>
<!-- TAB END: "G" -->


<!-- TAB START: "H" -->
<div class="sar_postbit_tab_content_inactive"><!-- Begin 'H' : each node here is a part of List H -->
<fieldset class="blockrow">
<legend>CB Awards</legend>
{vb:raw post.cbawards_html}
</fieldset>
</div>
<!-- TAB END: "H" -->


<!-- TAB START: "$" -->
<div class="sar_postbit_tab_content_inactive"><!-- Begin '$' : each node here is a part of List $ -->
<fieldset class="blockrow">
<legend>ArCAdE</legend>
<hr /><hr />
{vb:raw post.crowns}{vb:raw post.champtext}
</fieldset>
</div>
<!-- TAB END: "$" -->

</div>
</div>
</div>
</div>
</div>


sar_postbit_headinclude This is just to make the "tabs" work.
<script type="text/javascript">
function activate_postbit_tab(tab_head,tab_postid)
{
var HeadsNode = document.getElementById('postbit_tabs_'+tab_postid +'_head');
var ContentsNode = document.getElementById('postbit_tabs_'+tab_postid +'_content');
// var tab_heads = HeadsNode.childNodes;
var tab_heads = new Array();
for (var i in HeadsNode.childNodes) {if ((HeadsNode.childNodes[i].nodeType == 1) && (HeadsNode.childNodes[i].nodeName == 'DIV')) {tab_heads[tab_heads.length] = HeadsNode.childNodes[i];}}
// var tab_contents = ContentsNode.childNodes;
var tab_contents = new Array();
for (var i in ContentsNode.childNodes) {if ((ContentsNode.childNodes[i].nodeType == 1) && (ContentsNode.childNodes[i].nodeName == 'DIV')) {tab_contents[tab_contents.length] = ContentsNode.childNodes[i];}}

var this_tab_index = false;
for (var i in tab_heads)
{
if (tab_heads[i].className != 'clearbit')
{
tab_heads[i].className = 'sar_postbit_tab_head_inactive';
if (tab_heads[i].innerHTML == tab_head.innerHTML) {this_tab_index = i; tab_heads[i].className = 'sar_postbit_tab_head_active';}
}
}
for (var i in tab_contents)
{
tab_contents[i].className = 'sar_postbit_tab_content_inactive';
if (this_tab_index == i) {tab_contents[i].className = 'sar_postbit_tab_content_active';}
}
}
function toggle_content(tab_postid)
{
var Contents = document.getElementById('postbit_tabs_'+tab_postid +'_content_table');
if (Contents.style.display == 'block') {Contents.style.display = 'none';} else {Contents.style.display = 'block';}
}
</script>


<style type="text/css">
.sar_postbit_tab_head_active {background-color: #CCCCCC; color: #232323; border: 1px solid #000000; float: left; padding: 2px; margin: 2px;}
.sar_postbit_tab_head_inactive {background-color: #333333; color: #999999; border: 1px solid #000000; float: left; padding: 2px; margin: 2px;}
.sar_postbit_tab_content_active {display: block; border: 1px solid #000000;}
.sar_postbit_tab_content_inactive {display: none;}
</style>















I should have included another plugin on parse_templates with the following:$templater = vB_Template::create('sar_postbit_headinclude');
$templater->register('post', $post);
$sar_postbit_headinclude = $templater->render();
$template_hook['headinclude_bottom_css'] .= $sar_postbit_headinclude; But I just manually put it into my headinclude template.



(Still over 20,000 characters. One more post coming.)

Sarteck
07-19-2012, 11:52 PM
Anyways, this probably isn't what you want, but you can modify it to do what you want. If you want to see a demo of this, Check out a thread in my forum:
http://forums.cleverbaka.com/showthread.php?97579-CleverBaka-Mission-Rules-and-Guidelines

Syxguns
07-20-2012, 12:37 AM
Sarteck,
Nice site, and I love the way you did a lot of different things. I don't think they are modifications to download, I'm guessing you did a lot of the coding yourself. Like your CB Announcements. I've been searching for a mod like that. I may have some questions for you, but luckily I have a test forum to test things out on! Is it best for me to join your site, even though I'm not into anime, and I barely have time to play games even though I love them!!

Sarteck
07-20-2012, 12:42 AM
Sure, join up. XD And thanks. A lot of the mods have been downloaded from here, and a lot I coded myself, and some are a combination of the two (downloaded from here and then modified, or inspired from mods already here).

A lot of it is still works in progress (like our Postbit Modification System that allows username/usertitle markup modification according to usergroups one belongs to and items one owns, and allows the arrangement of userbars according to how the user specifies). Some of it is more-or-less complete, and stuff I'm actually working on making into Products I'll upload here.

But yeah, feel free to ask me with any questions about the site, and I'll either direct you to the mod I downloaded or based it on or tell ya how I coded it.

EDIT: You should check it out around Valentines Day... One of my better modifications. X3 I made it so that users can "date" another user, and both avatars/usernames appear in the postbit for a few days around Valentines Day.

EDIT2: Oh, and if you want the info about the CB Announcement System, either PM me or start another thread, so we don't derail this one any further. Some info on it: I made it so that specific usergroups, "Guilds," and individual users can alter exisitng announcements.

TNERatedEdge
07-20-2012, 02:32 PM
Woah, I'm overwhelemed!

Can you guys install for me?

Syxguns
07-20-2012, 06:08 PM
Woah, I'm overwhelemed!

Can you guys install for me?

Lynne had a way of doing it by making changes to the code in vBulletin, and Sarteck gave you code, but the code must have some changes made to it to work with your forum. My way is simple but effective way for the forums display to work centered. It just doesn't work for user profile field. I'll figure that part out soon. Using this method you do not touch any of the vB code, it is just over ridden by the additional.css file.

AdminCP >> Styles & Templates > Search in Templates

place additional.css in the search field. On the new screen that opens you will see an area for each style that you have. You will also see additional.css for each style. You will have to make the changes one at a time for each style, unless you have a primary style with children under it. Double click the additional.css and the file will open. If you have never placed anything here it will be blank, although some purchased styles may have some code in there. If that is the case, then just scroll to the bottom. Add this code to the bottom of the file:


/* center avatar, username, title, rank in postbit legacy 4.x.x */
.postbitlegacy .userinfo .username_container, .postbitlegacy .userinfo .rank, .postbitlegacy .userinfo .usertitle {text-align:center;}
.postbitlegacy .userinfo .postuseravatar, .postbitlegacy .userinfo .postuseravatar img {float:none; text-align:center;}
.postbitlegacy .userinfo .usertitle {display: block; float:none; text-align:center; clear: both;}


I'll attach a pic so you can see how the items are centered in the forum for user display. I hope that gives you an easy solution for your current needs.