Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Prev Previous Post   Next Post Next
  #1  
Old 11-11-2009, 10:56 AM
Mobo Mobo is offline
 
Join Date: Jan 2004
Location: Colorado
Posts: 319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help getting THIS code into a plugin

I am trying to get the below code from vBExperience to show up in a new user profile tab I created using [How-to] Add more tabs to the vB 3.7 profile pages.

Here is the all of the code from the vBExperience template (xperience_memberinfo_block)

Code:
<style type="text/css" id="memberinfo_css">
<!--
/**
* Experience Tab
*/
#vBExperience fieldset.vbexperience_group {
	margin-top:6px;
}
#vBExperience fieldset.vbexperience_group ul {
	padding:6px;
}
#vBExperience fieldset.vbexperience_group ul li {
	margin-bottom:3px;
}
-->
</style>

<div class="alt1 block_row">
<if condition="$block_data[xperience_points] > 0">
	<fieldset class="vbexperience_group">
	<legend>$vbphrase[xperience_name]</legend>
		<ul class="list_no_decoration">
			<li><span class="shade">$vbphrase[xperience_points]:</span> $block_data[xperience_points]</li>
			<li><span class="shade">$vbphrase[xperience_level]:</span> $block_data[xperience_level]</li>
	<if condition="!$vboptions[xperience_hideprofilegfx]">
		<table width="200" cellpadding="0" cellspacing="0" >
		<tr style="background-image:url($vboptions[bburl]/xperience/images/red_faded.png)">
				<td width="5" height="11"><img alt="$vbphrase[xperience_points]: $block_data[xperience_points], $vbphrase[xperience_level]: $block_data[xperience_level]" src="$vboptions[bburl]/xperience/images/red_left.png" height="11" /></td>
				<td style="background-image:url($vboptions[bburl]/xperience/images/red_faded.png)" height="11"><img alt="$vbphrase[xperience_points]: $block_data[xperience_points], $vbphrase[xperience_level]: $block_data[xperience_level]" src="$vboptions[bburl]/xperience/images/red.png" width="$block_data[xperience_levelp]%" height="11" /></td>
				<td width="1" height="11"><img alt="$vbphrase[xperience_points]: $block_data[xperience_points], $vbphrase[xperience_level]: $block_data[xperience_level]" src="$vboptions[bburl]/xperience/images/red_right.png" height="11" /></td>
		</tr>
		</table>
	</if>
			<li><span class="shade">$vbphrase[xperience_level_up]:</span> $block_data[xperience_level_up]%</li>
			<li><span class="shade">$vbphrase[xperience_points_needed]:</span> $block_data[xperience_level_up_points]</li>
	<if condition="!$vboptions[xperience_hideprofilegfx]">
		<table width="200" cellpadding="0" cellspacing="0" >
		<tr style="background-image:url($vboptions[bburl]/xperience/images/grey_faded.png)"> 
			<td width="5" height="11"><img alt="$vbphrase[xperience_level_up]: $block_data[xperience_level_up]% - $block_data[xperience_level_up_points] $vbphrase[xperience_points_needed]" src="$vboptions[bburl]/xperience/images/grey_left.png" height="11" /></td>
			<td style="background-image:url($vboptions[bburl]/xperience/images/grey_faded.png)" height="11"><img alt="$vbphrase[xperience_level_up]: $block_data[xperience_level_up]%" src="$vboptions[bburl]/xperience/images/grey.png" width="$block_data[xperience_level_up]%" height="11" /></td>
			<td width="1" height="11"><img alt="$vbphrase[xperience_level_up]: $block_data[xperience_level_up]% - $block_data[xperience_level_up_points] $vbphrase[xperience_points_needed]" src="$vboptions[bburl]/xperience/images/grey_right.png" height="11" /></td>
		</tr>
		</table>
	</if>
			<li><span class="shade">$vbphrase[xperience_activity]:</span> $block_data[xperience_activity]%</li>
	<if condition="!$vboptions[xperience_hideprofilegfx]">
		<table width="200" cellpadding="0" cellspacing="0" >
		<tr> 
			<td width="5" height="11"><img alt="$vbphrase[xperience_activity]: $block_data[xperience_activity]%" src="$vboptions[bburl]/xperience/images/green_left.png" height="11" /><td>
			<td style="background-image:url($vboptions[bburl]/xperience/images/green_faded.png)" height="11"><img alt="$vbphrase[xperience_activity]: $block_data[xperience_activity]%" src="$vboptions[bburl]/xperience/images/green.png" height="11" width="$block_data[xperience_activity]%" /><td>
			<td width="1" height="11"><img alt="$vbphrase[xperience_activity]: $block_data[xperience_activity]%" src="$vboptions[bburl]/xperience/images/green_right.png" /></td>
		</tr>
		</table>
		</if>
		</ul>
		<if condition="$vboptions[xperience_use_gap]">
		<ul class="list_no_decoration">
			<li><span class="shade"><a href="xperience.php?go=gap">$vbphrase[xperience_gap]</a></span></li>
		</ul>
		
		</if>
	</fieldset>

<else />
	<fieldset class="vbexperience_group">
	<legend>$vbphrase[xperience_name]</legend>
	<ul class="list_no_decoration">
		<li><span class="shade">$vbphrase[xperience_no_data]</span></li>
	</ul>
	</fieldset>
</if>
<if condition="$vboptions[xperience_use_awards]">
	<if condition="$vboptions[xperience_award_block] == 0">
		<fieldset class="vbexperience_group">
		<legend>$vbphrase[xperience_awards_short]</legend>
		<ul class="list_no_decoration">
			<li>
				<if condition="$block_data[xperience_awards]">
					$block_data[xperience_awards]
				<else />
					$vbphrase[xperience_awards_empty]			
				</if>
			</li>
			<li>
			<a href="xperience.php?go=awards">$vbphrase[xperience_awards_list]</a>
			</li>
		</ul>
		</fieldset>
	</if>
</if>

	<if condition="$block_data[xperience_points_user]<>0">
	<fieldset class="vbexperience_group">
		<legend>$vbphrase[xperience_points_for_user]</legend>
		<ul class="list_no_decoration">
			<li><span class="shade">$vbphrase[xperience_points_user]:</span> $block_data[xperience_points_user]</li>
			<if condition="$block_data[xperience_points_user_infractions] > 0"><li><span class="shade">$vbphrase[xperience_points_user_infractions]:</span> <if condition="$block_data[xperience_points_user_infractions]<0">-</if>$block_data[xperience_points_user_infractions]</li></if>
			<if condition="$block_data[xperience_points_user_reputation] > 0"><li><span class="shade">$vbphrase[xperience_points_user_reputation]:</span> $block_data[xperience_points_user_reputation]</li></if>
			<if condition="$block_data[xperience_points_user_reputation_use] > 0"><li><span class="shade">$vbphrase[xperience_points_user_reputation_use]:</span> $block_data[xperience_points_user_reputation_use]</li></if>
			<if condition="$block_data[xperience_points_user_online] > 0"><li><span class="shade">$vbphrase[xperience_points_user_online]:</span> $block_data[xperience_points_user_online]</li></if>
			<if condition="$block_data[xperience_points_user_socialgroup] > 0"><li><span class="shade">$vbphrase[xperience_points_user_socialgroup]:</span> $block_data[xperience_points_user_socialgroup]</li></if>
			<if condition="$block_data[xperience_points_user_friends] > 0"><li><span class="shade">$vbphrase[xperience_points_user_friends]:</span> $block_data[xperience_points_user_friends]</li></if>
			<if condition="$block_data[xperience_points_user_visitormessages] > 0"><li><span class="shade">$vbphrase[xperience_points_user_visitormessages]:</span> $block_data[xperience_points_user_visitormessages]</li></if>
			<if condition="$block_data[xperience_points_user_albumpictures] > 0"><li><span class="shade">$vbphrase[xperience_points_user_albumpictures]:</span> $block_data[xperience_points_user_albumpictures]</li></if>				
			<if condition="$block_data[xperience_points_user_referrals] > 0"><li><span class="shade">$vbphrase[xperience_points_user_referrals]:</span> $block_data[xperience_points_user_referrals]</li></if>				
			<if condition="$block_data[xperience_points_user_profile] > 0"><li><span class="shade">$vbphrase[xperience_points_user_profile]:</span> $block_data[xperience_points_user_profile]</li></if>				
			$block_data[xperience_points_user_tpl]
		</ul>
	</fieldset>
	</if>
	<if condition="$block_data[xperience_points_thread]<>0">
	<fieldset class="vbexperience_group">
		<legend>$vbphrase[xperience_points_for_thread]</legend>
		<ul class="list_no_decoration">
			<li><span class="shade">$vbphrase[xperience_points_thread]:</span> $block_data[xperience_points_thread]</li>
			<if condition="$block_data[xperience_points_threads] > 0"><li><span class="shade">$vbphrase[xperience_points_threads]:</span> $block_data[xperience_points_threads]</li></if>
			<if condition="$block_data[xperience_points_threads_sg] > 0"><li><span class="shade">$vbphrase[xperience_points_threads_sg]:</span> $block_data[xperience_points_threads_sg]</li></if>
			<if condition="$block_data[xperience_points_thread_tags] > 0"><li><span class="shade">$vbphrase[xperience_points_thread_tags]:</span> $block_data[xperience_points_thread_tags]</li></if>
			<if condition="$block_data[xperience_points_thread_votes] > 0"><li><span class="shade">$vbphrase[xperience_points_thread_votes]:</span> $block_data[xperience_points_thread_votes]</li></if>
			<if condition="$block_data[xperience_points_thread_replycount] > 0"><li><span class="shade">$vbphrase[xperience_points_thread_replycount]:</span> $block_data[xperience_points_thread_replycount]</li></if>
			<if condition="$block_data[xperience_points_thread_views] > 0"><li><span class="shade">$vbphrase[xperience_points_thread_views]:</span> $block_data[xperience_points_thread_views]</li></if>
			<if condition="$block_data[xperience_points_thread_stickies] > 0"><li><span class="shade">$vbphrase[xperience_points_thread_stickies]:</span> $block_data[xperience_points_thread_stickies]</li></if>
			$block_data[xperience_points_thread_tpl]
		</ul>
	</fieldset>
	</if>
	<if condition="$block_data[xperience_points_post]<>0">
	<fieldset class="vbexperience_group">
		<legend>$vbphrase[xperience_points_for_post]</legend>
		<ul class="list_no_decoration">
			<li><span class="shade">$vbphrase[xperience_points_post]:</span> $block_data[xperience_points_post]</li>
			<if condition="$block_data[xperience_points_posts] > 0"><li><span class="shade">$vbphrase[xperience_points_posts]:</span> $block_data[xperience_points_posts]</li></if>
			<if condition="$block_data[xperience_points_posts_sg] > 0"><li><span class="shade">$vbphrase[xperience_points_posts_sg]:</span> $block_data[xperience_points_posts_sg]</li></if>
			<if condition="$block_data[xperience_points_post_attachment] > 0"><li><span class="shade">$vbphrase[xperience_points_post_attachment]:</span> $block_data[xperience_points_post_attachment]</li></if>
			<if condition="$block_data[xperience_points_post_attachment_views] > 0"><li><span class="shade">$vbphrase[xperience_points_post_attachment_views]:</span> $block_data[xperience_points_post_attachment_views]</li></if>
			<if condition="$block_data[xperience_points_post_thanks] > 0"><li><span class="shade">$vbphrase[xperience_points_post_thanks]:</span> $block_data[xperience_points_post_thanks]</li></if>
			<if condition="$block_data[xperience_points_post_thanks_use] > 0"><li><span class="shade">$vbphrase[xperience_points_post_thanks_use]:</span> $block_data[xperience_points_post_thanks_use]</li></if>
			<if condition="$block_data[xperience_points_post_avg] > 0"><li><span class="shade">$vbphrase[xperience_points_post_avg]:</span> $block_data[xperience_points_post_avg]</li></if>
			$block_data[xperience_points_post_tpl]
		</ul>
	</fieldset>
	</if>
	<if condition="$block_data[xperience_points_misc]<>0">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_points_for_misc]</legend>
			<ul class="list_no_decoration">
				<li><span class="shade">$vbphrase[xperience_points_misc]:</span> $block_data[xperience_points_misc]</li>
				<if condition="$block_data[xperience_points_misc_ldm] > 0"><li><span class="shade">$vbphrase[xperience_points_misc_ldm]:</span> $block_data[xperience_points_misc_ldm]</li></if>
				<if condition="$block_data[xperience_points_misc_dl2] > 0"><li><span class="shade">$vbphrase[xperience_points_misc_dl2]:</span> $block_data[xperience_points_misc_dl2]</li></if>
				<if condition="$block_data[xperience_points_misc_ppd] > 0"><li><span class="shade">$vbphrase[xperience_points_misc_ppd]:</span> $block_data[xperience_points_misc_ppd]</li></if>
				<if condition="$block_data[xperience_points_misc_vbblog] > 0"><li><span class="shade">$vbphrase[xperience_points_misc_vbblog]:</span> $block_data[xperience_points_misc_vbblog]</li></if>
				<if condition="$block_data[xperience_points_misc_events] > 0"><li><span class="shade">$vbphrase[xperience_points_misc_events]:</span> $block_data[xperience_points_misc_events]</li></if>
				<if condition="$block_data[xperience_points_misc_custom]<>0"><li><span class="shade">$vbphrase[xperience_points_misc_custom]:</span> $block_data[xperience_points_misc_custom]</li></if>
				$block_data[xperience_points_misc_tpl]
			</ul>
		</fieldset>
	</if>
	<if condition="$block_data[xperience_points_shop]<>0">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop]</legend>
			<ul class="list_no_decoration">
				<li><span class="shade">$vbphrase[xperience_points_shop]:</span> $block_data[xperience_points_shop]</li>
			</ul>
			<table>
			<tr>
				$block_data[xperience_shop_items]			
			</tr>
			</table>
		</fieldset>
	</if>
	<if condition="$block_data[xperience_shop_items_received]	">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop_items_received]</legend>
			<table>
			<tr>
				$block_data[xperience_shop_items_received]			
			</tr>
			</table>
			
			
		</fieldset>
	</if>
	
	<if condition="$vboptions[xperience_use_activities]">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_activities]</legend>
			<ul class="list_no_decoration">
				<li><span class="shade"><a href="xperience.php?go=activities">$vbphrase[xperience_activities]</a></span></li>
			</ul>
			$block_data[xperience_activities]
		</fieldset>
	</if>

</div>

I'm pretty sure this is all the code that I need from that...

Code:
<if condition="$block_data[xperience_points_shop]<>0">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop]</legend>
			<ul class="list_no_decoration">
				<li><span class="shade">$vbphrase[xperience_points_shop]:</span> $block_data[xperience_points_shop]</li>
			</ul>
			<table>
			<tr>
				$block_data[xperience_shop_items]			
			</tr>
			</table>
		</fieldset>
	</if>
	<if condition="$block_data[xperience_shop_items_received]	">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop_items_received]</legend>
			<table>
			<tr>
				$block_data[xperience_shop_items_received]			
			</tr>
			</table>
			
			
		</fieldset>
	</if>
This is the code I have in my plugin...

Code:
$blocklist = array_merge($blocklist, array(
	'mymodification' => array(
		'class' => 'MyModification',
		'title' => 'Planes Owned',
		'hook_location' => 'profile_left_last'
	)
));

class vB_ProfileBlock_MyModification extends vB_ProfileBlock
{
	var $template_name = 'memberinfo_block_mymodification';

	function confirm_empty_wrap()
	{
		return false;
	}

	function confirm_display()
	{
		return ($this->block_data['mymodification'] != '');
	}

	function prepare_output($id = '', $options = array())
	{
		$this->block_data['mymodification'] = '<if condition="$block_data[xperience_points_shop]<>0">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop]</legend>
			<ul class="list_no_decoration">
				<li><span class="shade">$vbphrase[xperience_points_shop]:</span> $block_data[xperience_points_shop]</li>
			</ul>
			<table>
			<tr>
				$block_data[xperience_shop_items]			
			</tr>
			</table>
		</fieldset>
	</if>
	<if condition="$block_data[xperience_shop_items_received]	">
		<fieldset class="vbexperience_group">
			<legend>$vbphrase[xperience_shop_items_received]</legend>
			<table>
			<tr>
				$block_data[xperience_shop_items_received]			
			</tr>
			</table>
			
			
		</fieldset>
	</if>';
	}
}
And this is what gets displayed in my new tab, called Planes Owned...

Code:
$vbphrase[xperience_shop]

    * $vbphrase[xperience_points_shop]: $block_data[xperience_points_shop]

$block_data[xperience_shop_items]
$vbphrase[xperience_shop_items_received] $block_data[xperience_shop_items_received]
Can anyone help me get this code working in a new tab please?

Thank you for your time and any help!
Reply With Quote
 

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 02:03 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.46869 seconds
  • Memory Usage 3,019KB
  • 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
  • (13)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (20)post_thanks_box
  • (20)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (20)post_thanks_postbit_info
  • (20)postbit
  • (20)postbit_onlinestatus
  • (20)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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