Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 50
3 members and 47 guests
buynm6ymobcha8b, cliaw9cckhereto, int5nwernetmarx
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > NM Staff > Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
HP/MP/XP MOD
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 35
Join Date: Nov 2002
HP/MP/XP MOD - 11-14-2002, 08:43 AM

OK I downloaded this MOD from somewhere else, and it was usebable for the port. It had some bugs in it, with the calculation. That was even wrong for the normal phpbb2. However I found the 2 bugs, fixed em, and post now the code here, so anyone might install this if he likes. Just remember that the image path is modules/Forums/templates/"templatename"/images/level_mod/"imagename". Download the images from original MOD:

http://www.phpbb2-users.de/modules.p...p=getit&lid=14

But use this code:
Code:
################################################################# 
## Mod Title: HP/MO/EXP Mod
## Mod Version: 3.5 - BETA
## Author: Jon Borzilleri <jon@asylumsw.com> - http://www.asylumsw.com
## Description: This mod adds an rpg-like level, hp, mp, and exp rating
## to a user's profile, and under their name in their posts.
##  Level: a user's level is based on how many posts the user has made.
##   This should be able to scale up indefinitly.
##  HP: represents how active the user is. max hp is based off level,
##   current hp is based on how often the user posts.
##  MP: represnts how quickly the user posts. Max mp is based on level,
##   each post costs mp, and mp regenerates over time.
##  Exp: a percentage showing how many more posts the user has to make
##   to get to the next level.
## 
## Installation Level: Easy
## Installation Time: 5 Minutes 
## Files To Edit: 4
## ./includes/usercp_viewprofile.php
## ./viewtopic.php
## ./templates/YOUR_TEMPLATE_NAME/viewtopic_body.php
## ./templates/YOUR_TEMPLATE_NAME/profile_view_body.php
##
## Included Files: 
## levelmod/exp_bar_fil.gif
## levelmod/exp_bar_filexp_bar_fil_end.gif
## levelmod/exp_bar_filexp_bar_left.gif
## levelmod/exp_bar_filhp_bar_fil.gif
## levelmod/exp_bar_filhp_bar_fil_end.gif
## levelmod/exp_bar_filhp_bar_left.gif
## levelmod/exp_bar_fillevel_bar_emp.gif
## levelmod/exp_bar_fillevel_bar_right.gif
## levelmod/exp_bar_filmp_bar_fil.gif
## levelmod/exp_bar_filmp_bar_fil_end.gif
## levelmod/exp_bar_filmp_bar_left.gif
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
## Author Note: 
## 
## This is mod is designed for phpBB 2.0 Final
##
## Remember to replace all instances of "YOUR_TEMPLATE_NAME" with the folder name of
## your template. The default is 'subSilver' (without the quotes)
##
## Remember to upload the folder of images into your template's image folder.
## The path to the grahpics should be:
## ./templates/YOUR_TEMPLATE_NAME/images/level_mod/
##
## You will need to upload the images in each template directory you wish
## to use this mod with.
## 
## Additional Credits:
## Thank's to Xenocide from the mods.phpbb.com forums for help
## with some of the formulas.
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

# 
#-----[ OPEN ]------------------------------------------ 
# 

./includes/usercp_viewprofile.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$search = '' . $lang['Search_user_posts'] . '';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

/* Begin HP/MP/EXP Mod
 *
 * Note: all new variables used created in this mod
 * are prefixed with level_ to be sure of not overwriting
 * other variables.
 *
 */
 
/* Calculate Level
 * A user's level is determined by their total number of posts.
 * A nice mathmatical formula is used to translate their post count
 * into an intager level.
 *
 * Note: A user with zero (0) posts is considered level 0, however
 * making one (1) post, raises them to level 1.
 *
 */

if($profiledata['user_posts'] < 1)
{
	$level_level = 0;
}
else
{
	$level_level = floor( pow( log10( $profiledata['user_posts'] ), 3 ) ) + 1;
}

/* Determine Hit Points (HP)
 * 
 * Hp is based on user activity.
 * Max HP is based on the user's level, and will generally
 * be the same for all users of the same level.
 *
 * A user's current HP is based on the user's posts per day.
 * A higher post per day (ppd), the more HP they will have. A 
 * user with an average PPD (set below) will have 50% of their 
 * max HP. As a user goes over the average PPD, they will have 
 * more HP, but the gains will decrease as the user's PPD increases.
 * This makes achieving 100% hp difficult, but not impossible.
 *
 * For users with under the average PPD, they will have HP equal
 * to 1/2 the percentage their ppd is of the average.
 * ie- a user with 2.5 ppd, and an average ppd of 5 will have
 * 25% of their max HP. This is because 2.5 is 50% of 5, and 1/2
 * of that, is 25%.
 *
 * Users who manage to post so far above the average that they have
 * more HP than their max will recieve a bonus to their max HP.
 *
 * Note that users at level 0 will always have 0 / 0 hp.
 *
 */

/*
 * This value determines the 'average' posts per day.
 * The admin may redefine this variable as he wishes. 
 * Higher values will generally decrease users' HP, and
 * lower values will generally increase users' HP.
 *
 * Note: Do NOT set this value to zero (0).
 * This -may- be set to a fractional value (eg, 5.1, 3.1415)
 *
 */

$level_avg_ppd = 5;

/* 
 * this value sets how hard it is to achieve 100%
 * hp. The higher you set it, the harder it is to
 * get full hp.
 *
 * to judge how high to set it, a user must have
 * posts per day equal to the $level_avg_ppd plus
 * the number set below.
 * 
 * This should NOT be zero.
 */
 
$level_bonus_redux = 5;

if($level_level < 1)
{
	$level_hp = "0 / 0";
	$level_hp_percent = 0;
}
else
{
	$level_max_hp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (1.5) );

	if($posts_per_day >= $level_avg_ppd)
	{
		$level_hp_percent = floor( (.5 + (($posts_per_day - $level_avg_ppd) / ($level_bonus_redux * 2)) ) * 100);
	}
	else
	{
		$level_hp_percent = floor( $posts_per_day / ($level_avg_ppd / 50) );
	}
	
	if($level_hp_percent > 100)
	{
		//Give the user a bonus to max HP for greater than 100% hp.
		$level_max_hp += floor( ($level_hp_percent - 100) * pi() );
		$level_hp_percent = 100;
	}
	else
	{
		$level_hp_percent = max(0, $level_hp_percent);
	}
	
	$level_cur_hp = floor($level_max_hp * ($level_hp_percent / 100) );
	
	//Be sure a user has no more than max, and no less than zero hp.
	$level_cur_hp = max(0, $level_cur_hp);
	$level_cur_hp = min($level_max_hp, $level_cur_hp);
	
	$level_hp = $level_cur_hp . ' / ' . $level_max_hp;
}

/* Determine MP
 * 
 * MP is calculated by how long the user has been around
 * and how often they post.
 * 
 * Max MP is based on level, and increases with level
 * Each post a user makes costs them mp,
 * and a user regenerates mp proportional to how
 * many days they have been registered
 *
 */
 
//Number of days the user has been at the forums.
$level_user_days = max(1, round( ( time() - strtotime($profiledata['user_regdate']) ) / 86400 ));

/* The mp cost for one post.
 * Raising this value will generally decrease the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 2, 2.1, 3.141596)
 * This should NOT be set to 0
 */
$level_post_mp_cost = 2.5;

/* This determines how much mp a user regenerates per day
 * Raising this value will generally increase the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 3, 3.5, 2.71828)
 * This should NOT be set to 0
 */
$level_mp_regen_per_day = 4;

if($level_level < 1)
{
	$level_mp = '0 / 0';
	$level_mp_percent = 0;
}
else
{
	$level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );
	
	$level_mp_cost = $profiledata['user_posts'] * $level_post_mp_cost;
	$level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);
	
	$level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
	$level_cur_mp = max(0, $level_cur_mp);
	$level_cur_mp = min($level_max_mp, $level_cur_mp);
	
	$level_mp = $level_cur_mp . ' / ' . $level_max_mp;
	$level_mp_percent = floor($level_cur_mp / $level_max_mp * 100 );
	
}

/* Determine EXP percentage
 *
 * Experience is determined by how far the user is away
 * from the next level. This is expressed as a percentage.
 * 
 * Note, a user of level 0 has 100% experience. Making one post
 * will put them at level 1. Also, a user that is shown to have 100%
 * experience, will go up a level on their next post.
 *
 */

if($level_level == 0)
{
	
$level_exp = "0 / 0";
	$level_exp_percent = 100;
}
else
{
	$level_posts_for_next = floor( pow( 10, pow( $level_level, (1/3) ) ) );
	

	$level_posts_for_this = max(1, floor( pow( 10, pow( ($level_level - 1), (1/3) ) ) ) );
	

	
	$level_exp = ($profiledata['user_posts'] - $level_posts_for_this) . " / " . ($level_posts_for_next - $level_posts_for_this);
	
	$level_exp_percent = floor( ( ($profiledata['user_posts'] - $level_posts_for_this) / max( 1, ($level_posts_for_next - $level_posts_for_this ) ) ) * 100);
}

/* END HP/MP/EXP MOD */

# 
#-----[ FIND ]------------------------------------------ 
# 

'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username'])),

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

/* BEGIN LEVEL MOD */
'HP' => $level_hp,
'HP_WIDTH' => $level_hp_percent,
'HP_EMPTY' => ( 100 - $level_hp_percent ),
'MP' => $level_mp,
'MP_WIDTH' => $level_mp_percent,
'MP_EMPTY' => ( 100 - $level_mp_percent ),
'EXP' => $level_exp,
'EXP_WIDTH' => $level_exp_percent,
'EXP_EMPTY' => ( 100 - $level_exp_percent ),
'LEVEL' => $level_level,
/* END LEVEL MOD */

# 
#-----[ OPEN ]------------------------------------------ 
# 

./templates/YOUR_TEMPLATE_NAME/profile_view_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 

<tr> 
  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
  <td> <span class="gen">{INTERESTS}</span></td>
</tr>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	  
	  	<tr>
	  	  <td valign="top" align="right"><span class="gen">Level:</span></td>
	  	  <td><span class="gen">{LEVEL}</span></td>
	  	</tr>
	  	<tr>
	  	  <td></td>
		  <td align="left">
		  <table cellspacing="0" cellpadding="0" border="0">
		  <tr>
		  	<td align="left"><span class="postdetails">HP:</span></td>
		  	<td align="right"><span class="postdetails">{HP}</span></td>
		  	<td></td>
		  </tr>
		  <tr>
		  	<td colspan="2">
		  		<table cellspacing="0" cellpadding="0" border="0">
		  		<tr>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/hp_bar_left.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/hp_bar_fil.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/hp_bar_fil_end.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_emp.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_right.gif[/img]</td>
		  		</tr>
		  		</table>
		  	</td>
			<td align="left"><span class="gen">{HP_WIDTH}%</span></td>
		  </tr>
		  </table>
		  </td>
		</tr>	  
	  
	  	<tr>
	  	  <td></td>
		  <td align="left">
		  <table cellspacing="0" cellpadding="0" border="0">
		  <tr>
		  	<td align="left"><span class="postdetails">MP:</span></td>
		  	<td align="right"><span class="postdetails">{MP}</span></td>
		  	<td></td>
		  </tr>
		  <tr> 
		  	<td colspan="2">
		  		<table cellspacing="0" cellpadding="0" border="0">
		  		<tr>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/mp_bar_left.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/mp_bar_fil.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/mp_bar_fil_end.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_emp.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_right.gif[/img]</td>
		  		</tr>
		  		</table>
		  	</td>
			<td align="left"><span class="gen">{MP_WIDTH}%</span></td>
		  </tr>
		  </table>
		  </td>
		</tr>

	  	<tr>
	  	  <td></td>
		  <td align="left">
		  <table cellspacing="0" cellpadding="0" border="0">
		  <tr>
		  	<td align="left"><span class="postdetails">EXP:</span></td>
		  	<td align="right"><span class="postdetails">{EXP}</span></td>
		  	<td></td>
		  </tr>
		  <tr> 
		  	<td colspan="2">
		  		<table cellspacing="0" cellpadding="0" border="0">
		  		<tr>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/exp_bar_left.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/exp_bar_fil.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/exp_bar_fil_end.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_emp.gif[/img]</td>
		  		<td>[img]templates/YOUR_TEMPLATE/images/level_mod/level_bar_right.gif[/img]</td>
		  		</tr>
		  		</table>
		  	</td>
			<td align="left"><span class="gen">{EXP_WIDTH}%</span></td>
		  </tr>
		  </table>
		  </td>
		</tr>
	  

# 
#-----[ OPEN ]------------------------------------------ 
# 

./viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

/* Begin HP/MP/EXP Mod
 *
 * Note: all new variables used created in this mod
 * are prefixed with level_ to be sure of not overwriting
 * other variables.
 *
 */
 
/* Calculate Level
 * A user's level is determined by their total number of posts.
 * A nice mathmatical formula is used to translate their post count
 * into an intager level.
 *
 * Note: A user with zero (0) posts is considered level 0, however
 * making one (1) post, raises them to level 1.
 *
 */

if($postrow[$i]['user_posts'] < 1)
{
	$level_level = 0;
}
else
{
	$level_level = floor( pow( log10( $postrow[$i]['user_posts'] ), 3 ) ) + 1;
}

/* Determine Hit Points (HP)
 * 
 * Hp is based on user activity.
 * Max HP is based on the user's level, and will generally
 * be the same for all users of the same level.
 *
 * A user's current HP is based on the user's posts per day.
 * A higher post per day (ppd), the more HP they will have. A 
 * user with an average PPD (set below) will have 50% of their 
 * max HP. As a user goes over the average PPD, they will have 
 * more HP, but the gains will decrease as the user's PPD increases.
 * This makes achieving 100% hp difficult, but not impossible.
 *
 * For users with under the average PPD, they will have HP equal
 * to 1/2 the percentage their ppd is of the average.
 * ie- a user with 2.5 ppd, and an average ppd of 5 will have
 * 25% of their max HP. This is because 2.5 is 50% of 5, and 1/2
 * of that, is 25%.
 *
 * Users who manage to post so far above the average that they have
 * more HP than their max will recieve a bonus to their max HP.
 *
 * Note that users at level 0 will always have 0 / 0 hp.
 *
 */

/*
 * This value determines the 'average' posts per day.
 * The admin may redefine this variable as he wishes. 
 * Higher values will generally decrease users' HP, and
 * lower values will generally increase users' HP.
 *
 * Note: Do NOT set this value to zero (0).
 * This -may- be set to a fractional value (eg, 5.1, 3.1415)
 *
 */

$level_avg_ppd = 5;

/* 
 * this value sets how hard it is to achieve 100%
 * hp. The higher you set it, the harder it is to
 * get full hp.
 *
 * to judge how high to set it, a user must have
 * posts per day equal to the $level_avg_ppd plus
 * the number set below.
 * 
 * This should NOT be zero.
 */
 
$level_bonus_redux = 5;

/*
 * We need to actually calculate the user's posts per day
 * because unlike in the profile, it's not done for us.
 *
 */
$level_user_ppd = ($postrow[$i]['user_posts'] / max(1, round( ( time() - strtotime($postrow[$i]['user_regdate']) ) / 86400 )));

if($level_level < 1)
{
	$level_hp = "0 / 0";
	$level_hp_percent = 0;
}
else
{
	$level_max_hp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (1.5) );

	if($level_user_ppd >= $level_avg_ppd)
	{
		$level_hp_percent = floor( (.5 + (($level_user_ppd - $level_avg_ppd) / ($level_bonus_redux * 2)) ) * 100);
	}
	else
	{
		$level_hp_percent = floor( $level_user_ppd / ($level_avg_ppd / 50) );
	}
	
	if($level_hp_percent > 100)
	{
		//Give the user a bonus to max HP for greater than 100% hp.
		$level_max_hp += floor( ($level_hp_percent - 100) * pi() );
		$level_hp_percent = 100;
	}
	else
	{
		$level_hp_percent = max(0, $level_hp_percent);
	}
	
	$level_cur_hp = floor($level_max_hp * ($level_hp_percent / 100) );
	
	//Be sure a user has no more than max, and no less than zero hp.
	$level_cur_hp = max(0, $level_cur_hp);
	$level_cur_hp = min($level_max_hp, $level_cur_hp);
	
	$level_hp = $level_cur_hp . ' / ' . $level_max_hp;
}

/* Determine MP
 * 
 * MP is calculated by how long the user has been around
 * and how often they post.
 * 
 * Max MP is based on level, and increases with level
 * Each post a user makes costs them mp,
 * and a user regenerates mp proportional to how
 * many days they have been registered
 *
 */
 
//Number of days the user has been at the forums.
$level_user_days = max(1, round( ( time() - strtotime($postrow[$i]['user_regdate']) ) / 86400 ));

/* The mp cost for one post.
 * Raising this value will generally decrease the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 2, 2.1, 3.141596)
 * This should NOT be set to 0
 */
$level_post_mp_cost = 2.5;

/* This determines how much mp a user regenerates per day
 * Raising this value will generally increase the current
 * mp for most posters.
 * This may be set to a decimal value (eg, 3, 3.5, 2.71828)
 * This should NOT be set to 0
 */
$level_mp_regen_per_day = 4;

if($level_level < 1)
{
	$level_mp = '0 / 0';
	$level_mp_percent = 0;
}
else
{
	$level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );
	
	$level_mp_cost = $postrow[$i]['user_posts'] * $level_post_mp_cost;
	$level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);
	
	$level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
	$level_cur_mp = max(0, $level_cur_mp);
	$level_cur_mp = min($level_max_mp, $level_cur_mp);
	
	$level_mp = $level_cur_mp . ' / ' . $level_max_mp;
	$level_mp_percent = floor($level_cur_mp / $level_max_mp * 100 );
	
}

/* Determine EXP percentage
 *
 * Experience is determined by how far the user is away
 * from the next level. This is expressed as a percentage.
 * 
 * Note, a user of level 0 has 100% experience. Making one post
 * will put them at level 1. Also, a user that is shown to have 100%
 * experience, will go up a level on their next post.
 *
 */

if($level_level == 0)
{
	$level_exp = "0 / 0";
	$level_exp_percent = 100;
}
else
{
	$level_posts_for_next = floor( pow( 10, pow( $level_level, (1/3) ) ) );
	

	$level_posts_for_this = max(1, floor( pow( 10, pow( ($level_level - 1), (1/3) ) ) ) );
	

	
	$level_exp = ($postrow[$i]['user_posts'] - $level_posts_for_this) . " / " . ($level_posts_for_next - $level_posts_for_this);
	
	$level_exp_percent = floor( ( ($postrow[$i]['user_posts'] - $level_posts_for_this) / max( 1, ($level_posts_for_next - $level_posts_for_this ) ) ) * 100);
}

/* END HP/MP/EXP MOD */

# 
#-----[ FIND ]------------------------------------------ 
# 

'L_MINI_POST_ALT' => $mini_post_alt, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

/* BEGIN LEVEL MOD */
"POSTER_HP" => $level_hp,
"POSTER_HP_WIDTH" => $level_hp_percent,
"POSTER_HP_EMPTY" => ( 100 - $level_hp_percent ),
"POSTER_MP" => $level_mp,
"POSTER_MP_WIDTH" => $level_mp_percent,
"POSTER_MP_EMPTY" => ( 100 - $level_mp_percent ),
"POSTER_EXP" => $level_exp,
"POSTER_EXP_WIDTH" => $level_exp_percent,
"POSTER_EXP_EMPTY" => ( 100 - $level_exp_percent ),
"POSTER_LEVEL" => $level_level,
/* END LEVEL MOD */

# 
#-----[ OPEN ]------------------------------------------ 
# 

./templates/YOUR_TEMPLATE_NAME/viewtopic_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 

{postrow.POSTER_FROM}</span>


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	  
	  <span class="postdetails">
	  Level: {postrow.POSTER_LEVEL}
	  
	  <table cellspacing="0" cellpadding="0" border="0">
	  <tr>
	  	<td align="left"><span class="postdetails">HP:</span></td>
	  	<td align="right"><span class="postdetails">{postrow.POSTER_HP}</span></td>
	  	<td></td>
	  </tr>
	  <tr> 
	  	<td colspan="2">
	  		<table cellspacing="0" cellpadding="0" border="0">
	  		<tr>
	  		<td>[img]templates/subSilYOUR_TEMPLATE_NAMEver/images/level_mod/hp_bar_left.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/hp_bar_fil.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/hp_bar_fil_end.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_emp.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_right.gif[/img]</td>
	  		</tr>
	  		</table>
	  	</td>
		<td align="left"><span class="gen">{postrow.POSTER_HP_WIDTH}%</span></td>
	  </tr>
	  </table>
	  
	  <table cellspacing="0" cellpadding="0" border="0">
	  <tr>
	  	<td align="left"><span class="postdetails">MP:</span></td>
	  	<td align="right"><span class="postdetails">{postrow.POSTER_MP}</span></td>
	  	<td></td>
	  </tr>
	  <tr> 
	  	<td colspan="2">
	  		<table cellspacing="0" cellpadding="0" border="0">
	  		<tr>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/mp_bar_left.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/mp_bar_fil.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/mp_bar_fil_end.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_emp.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_right.gif[/img]</td>
	  		</tr>
	  		</table>
	  	</td>
		<td align="left"><span class="gen">{postrow.POSTER_MP_WIDTH}%</span></td>
	  </tr>
	  </table>

	  <table cellspacing="0" cellpadding="0" border="0">
	  <tr>
	  	<td align="left"><span class="postdetails">EXP:</span></td>
	  	<td align="right"><span class="postdetails">{postrow.POSTER_EXP}</span></td>
	  	<td></td>
	  </tr>
	  <tr> 
	  	<td colspan="2">
	  		<table cellspacing="0" cellpadding="0" border="0">
	  		<tr>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/exp_bar_left.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/exp_bar_fil.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/exp_bar_fil_end.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_emp.gif[/img]</td>
	  		<td>[img]templates/YOUR_TEMPLATE_NAME/images/level_mod/level_bar_right.gif[/img]</td>
	  		</tr>
	  		</table>
	  	</td>
		<td align="left"><span class="gen">{postrow.POSTER_EXP_WIDTH}%</span></td>
	  </tr>
	  </table>
	  </span>
	  

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Get an error for some reason
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 89
Join Date: Nov 2002
Location: USA
Get an error for some reason - 11-14-2002, 03:04 PM

When i go to view a users profile with the mod added I get the following sql error:


Parse error: parse error in /home/amicus/public_html/community/modules/Forums/includes/usercp_viewprofile.php on line 375

When I open it in notepad and go to line 375 here is the code:

Code:
level_exp = "0 / 0";
Did I copy something wrong?

The bars show up fine in the forums, just can't view profiles now? Just curious if this is something simple?
 Send a message via ICQ to Cyberclark  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 85
Join Date: Oct 2002
Location: France
11-17-2002, 02:16 PM

I install this mod only in viewtopic but for all my members XP stay 100%

Do you know this problem ?
 Send a message via ICQ to breakolami  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
One error in the above code
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 89
Join Date: Nov 2002
Location: USA
One error in the above code - 11-17-2002, 11:05 PM

Oh btw it was something verey simple.

There is a line in the above code that reads:

Code:
level_exp = "0 / 0";
it should read

Code:
$level_exp = "0 / 0";

Can't believe I didn't see that sooner.

If someone could make a change in the above code section so that if anyone else copies and pastes the above they won't have the same troubles that would be great!

Thanks
 Send a message via ICQ to Cyberclark  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 35
Join Date: Nov 2002
11-18-2002, 10:13 AM

Done.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#6 (permalink))
Junior Member
 
Status: Offline
Posts: 85
Join Date: Oct 2002
Location: France
11-18-2002, 03:45 PM

Hello everyone

Quote:
$level_exp = "0 / 0";
This the good line I have in my viewtopic.php but MP stay always 100%

8O I don't understand :?:

Thanks, friendly
 Send a message via ICQ to breakolami  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#7 (permalink))
Junior Member
 
Status: Offline
Posts: 35
Join Date: Nov 2002
11-18-2002, 04:08 PM

the normal reason why mp stays 100% is that it is 100% . Just change the variables for mp_costs. The other reason is, that you somehow deleted that strtotime out. Try to recalculate Mp=max mp+days*mp_regen-posts*mp_costs.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On





vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31