Thread: Miscellaneous Hacks - DJ's Dynamic Tab Content for Postbit_Legacy
View Single Post
  #54  
Old 08-31-2010, 04:17 PM
AfterWorldForum AfterWorldForum is offline
 
Join Date: Dec 2008
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As promised, here's my version of the script. I used mostly existing stuff ouf of the postbit_legacy template, and converted some of the suggestions from DJ to work with vB4. Code below is ready for copy/paste, and is working on 4.0.5. Live demo can be seen on www.EntropiaPlanets.com.

Code:
<!-- BEGIN POSTBIT TABS -->  
<div id="postbittabs{vb:raw post.postid}" class="djdot">  
	<ul>  
		<li><span title="Forum statistics"><a href="#" rel="tab1{vb:raw post.postid}" id="selected{vb:raw post.postid}">&nbsp;</a></span></li>  
		<li><span title="Personal information"><a href="#" rel="tab2{vb:raw post.postid}">&nbsp;</a></span></li>  
		<li><span title="Ingame info"><a href="#" rel="tab3{vb:raw post.postid}">&nbsp;</a></span></li>
		<li><span title="Arcade"><a href="#" rel="tab4{vb:raw post.postid}">&nbsp;</a></span></li>  
	</ul>  
	<br style="clear: left" />  
</div>  
   
<div class="smallfont">  
   
<!--TAB 1 CONTENT -->  
<div id="tab1{vb:raw post.postid}" class="tabcontent">  
   
	<vb:if condition="$post['joindate']"><div class="info"><b>{vb:rawphrase join_date}: </b> {vb:raw post.joindate}</div></vb:if>
	<div class="info"><b>{vb:rawphrase posts}: </b>{vb:raw post.posts}</div>
	
   	{vb:raw template_hook.postbit_userinfo_right_after_posts}

		<div class="info">
		<vb:if condition="$show['pmlink'] OR $show['emaillink'] OR $post['userid'] AND $show['member']">
		Send {vb:raw post.username}:<br /></vb:if>
				<vb:if condition="$show['pmlink']">
		  <a href="private.php?{vb:raw session.sessionurl}do=newpm&amp;u={vb:raw post.userid}" rel="nofollow"><phrase 1="{vb:raw post.username}">a Private Message</phrase></a><br />
		 </vb:if>
		 <vb:if condition="$show['emaillink']">
		  <a href="sendmessage.php?{vb:raw session.sessionurl}do=mailmember&amp;u={vb:raw post.userid}" rel="nofollow">an Email</a><br />
		 </vb:if>
		 <vb:if condition="$post['userid'] AND $show['member']">
		 <a href="profile.php?{vb:raw session.sessionurl}do=addlist&amp;userlist=buddy&amp;u={vb:raw post.userid}">a Friend Request</a>
		 </vb:if></div>
	
</div>  
   
<!-- TAB 2 CONTENT -->  
<div id="tab2{vb:raw post.postid}" class="tabcontent">  
   
	<vb:if condition="$post['field2']"><div class="info"><b>{vb:rawphrase location_perm}:</b> {vb:raw post.field2}</div></vb:if>
	<vb:if condition="$post['age']"><div class="info"><b>{vb:rawphrase age}:</b> {vb:raw post.age}</div></vb:if>
	<vb:if condition="$post['field1']"><div class="info"><b>Biography:</b> {vb:raw post.field1}</div></vb:if>
	<vb:if condition="$post['field3']"><div class="info"><b>Interests:</b> {vb:raw post.field3}</div></vb:if>
	<vb:if condition="$post['field4']"><div class="info"><b>Occupation:</b> {vb:raw post.field4}</div></vb:if>
	<!-- Real gender -->
	<vb:if condition="$post[field14]=='Male'"><div class="info"><b>Gender:</b> <img style='vertical-align:middle; border-style:none' src="images/entropiaplanets/male.png" alt="Male"></div>
	<vb:else />
	   <vb:if condition="$post[field14]=='Female'"><div class="info"><b>Gender:</b> <img style='vertical-align:middle; border-style:none' src="images/entropiaplanets/female.png" alt="Female"></div></vb:if>
	</vb:if>
	<!-- / flags start -->
	<vb:if condition="$post[field5]"><div class="info"><b>Country:</b> <img src="images/entropiaplanets/userflags/{vb:raw post.field5}.gif"></div></vb:if>
	<!-- / flags end -->
   
</div>  
   
<!-- TAB 3 CONTENT --> 

<div id="tab3{vb:raw post.postid}" class="tabcontent">  
   
   	<!-- Avatar Name -->
	<vb:if condition="$post[field6]"><div class="info"><b>Avatar Name: </b>{vb:raw post.field6}</div></vb:if>
	<!-- Society -->
	<vb:if condition="$post[field7]"><div class="info"><b>Soc: </b>{vb:raw post.field7}</div></vb:if>
   	<!-- Avatar Gender -->
	<vb:if condition="$post[field13]=='Male'"><div class="info"><b>Avatar:</b> <img style='vertical-align:middle; border-style:none' src="images/entropiaplanets/male.png" alt="Male"></div>
	<vb:else />
	   <vb:if condition="$post[field13]=='Female'"><div class="info"><b>Avatar:</b><img style='vertical-align:middle; border-style:none' src="images/entropiaplanets/female.png" alt="Female"></div></vb:if>
	</vb:if>
   
</div> 
   
<!-- TAB 4 CONTENT -->  
<div id="tab4{vb:raw post.postid}" class="tabcontent">  
   
	<div class="info">
		<vb:if condition="$post[crowns]">
			{vb:raw post.crowns}{vb:raw post.champtext}
		<vb:else />
			{vb:raw post.username} has not championed any arcade games.   
		</vb:if>
	</div>
   
</div>  

   
</div>  
   
   
<script type="text/javascript">  
var mytabs=new ddtabcontent("postbittabs{vb:raw post.postid}")  
mytabs.setpersist(false)  
mytabs.setselectedClassTarget("link")  
mytabs.init()  
</script>  
   
<!-- END POSTBIT TABS -->  

<br />
<div class="imlinks">
	{vb:raw post.icqicon} {vb:raw post.aimicon} {vb:raw post.msnicon} {vb:raw post.yahooicon} {vb:raw post.skypeicon}
</div>
Substitute Field<number> with your own userfields. Also please note that under Tab 1, I added the hook postbit_userinfo_right from the original template. I use the PhotoPost vBGallery, and that adds an image count using the hook. The same applies to the Blogs. I added the hook in the specific location so these additional stats show up right under the Posts.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01044 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete