Ein Level mod

Du suchst einen bestimmten Mod, weißt aber nicht genau wo bzw. ob er überhaupt existiert? Wenn dir dieser Artikel nicht weiterhilft, kannst du hier den von dir gewünschten/gesuchten Mod beschreiben ...
Falls ein Mod-Autor eine der Anfragen hier aufnimmt um einen neuen Mod zu entwicklen, geht's in phpBB 2.0: Mods in Entwicklung weiter.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Benutzeravatar
sledgi
Mitglied
Beiträge: 289
Registriert: 20.08.2003 15:39
Kontaktdaten:

Beitrag von sledgi »

Das ist meine viewtopic_body.tpl
<!-- BEGIN switch_xs_enabled -->
<?php

// This code will be visible only with eXtreme Styles mod

$search_img = '<a href="search.' . $this->vars['PHP'] . 'search_author=%s"><img src="' . $this->vars['TEMPLATE'] . 'images/lang_' . $this->vars['LANG'] . '/icon_search.gif" border="0" alt="' . $lang['Search_user_posts'] . '"></a>';

$postrow_count = ( isset($this->_tpldata['postrow.']) ) ? sizeof($this->_tpldata['postrow.']) : 0;
for ($postrow_i = 0; $postrow_i < $postrow_count; $postrow_i++)
{
$postrow_item = &$this->_tpldata['postrow.'][$postrow_i];
if(!empty($postrow_item['PROFILE']))
{
// add search button if user isn't guest
$postrow_item['SEARCH_IMG2'] = str_replace('%s', $postrow_item['POSTER_NAME'], $search_img);
// replace username with link to user profile
$search = array($lang['Read_profile'], '<a ');
$replace = array($postrow_item['POSTER_NAME'], '<a class="name" ');
$postrow_item['POSTER_NAME'] = str_replace($search, $replace, $postrow_item['PROFILE']);
}
// change view of joined, posts, location items
$data = array();
$data[] = isset($postrow_item['POSTER_JOINED']) ? $postrow_item['POSTER_JOINED'] : '';
$data[] = isset($postrow_item['POSTER_POSTS']) ? $postrow_item['POSTER_POSTS'] : '';
$data[] = isset($postrow_item['POSTER_FROM']) ? $postrow_item['POSTER_FROM'] : '';
$postrow_item['POSTER_JOINED'] = '';
$postrow_item['POSTER_POSTS'] = '';
$postrow_item['POSTER_FROM'] = '';
$str = '';
for($i=0; $i<count($data); $i++)
{
$arr = explode(': ', $data[$i], 2);
if(count($arr) == 2)
{
if(!$str)
{ // add table header when first non-empty item found
$str = '<table width="100%" cellspacing="1" cellpadding="3" class="profileline">';
}
$str .= '<tr><td align="left" valign="middle" class="profile" nowrap="nowrap"><b>' . $arr[0] . '</b></td><td align="left" valign="middle" class="profile">' . $arr[1] . '</td></tr>';
}
}
if($str)
{ // add table footer if string isn't empty
$str .= '</table>';
}
$postrow_item['XS_DATA_START'] = $str . '<!-- ';
$postrow_item['XS_DATA_END'] = ' -->';
}

?>
<!-- END switch_xs_enabled -->
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="middle"><span class="nav">
<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a>
-> <a class="nav" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span></td>
<td align="right" valign="middle"><span class="nav"><b>{PAGINATION}</b></span></td>
</tr>
<tr>
<td align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></td>
<td align="right" valign="middle"><span class="nav">
<a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a>&nbsp;
</span></td>
</tr>
</table>

{POLL_DISPLAY}

<!-- BEGIN postrow -->
<a name="{postrow.U_POST_ID}"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" align="right" valign="bottom"><img src="{T_TEMPLATE_PATH}/images/hdr_left.gif" width="15" height="28" border="0" alt="" /></td>
<td width="100%" align="center" valign="middle" background="{T_TEMPLATE_PATH}/images/hdr_bg.gif"><span class="cattitle">{postrow.POST_SUBJECT}</span></td>
<td width="15" align="left" valign="bottom"><img src="{T_TEMPLATE_PATH}/images/hdr_right.gif" width="15" height="28" border="0" alt="" /></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="1" width="100%" class="forumline">
<tr>
<td class="th" align="center" valign="middle"><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr height="26">
<td align="left" valign="middle" nowrap="nowrap"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="genmed">{L_POSTED}: {postrow.POST_DATE}</span></td>
<td align="right" valign="bottom" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG} </td>
</tr></table></td>
</tr>
<tr>
<td class="row1" align="left" valign="top" width="100%"><table border="0" cellspacing="0" cellpadding="0" width="100%"><!-- main table start -->
<tr>
<td width="150" align="left" valign="top" rowspan="2"><table border="0" cellspacing="0" cellpadding="0" width="100%"><!-- left row table start -->
<tr>
<td width="100%" align="left" valign="top" background="{T_TEMPLATE_PATH}/images/post_bg.gif"><table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
<td align="left" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td nowrap="nowrap"><span class="name"><b>{postrow.POSTER_NAME}</b></span></td></tr>
<tr><td nowrap="nowrap"><span class="postdetails">{postrow.POSTER_RANK}</span></td></tr>
<tr><td nowrap="nowrap"><span class="postdetails">{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}</span></tr>
<tr><td>&nbsp;</td></tr>
<tr><td nowrap="nowrap">{postrow.XS_DATA_START}<table width="100%" cellspacing="1" cellpadding="3" class="profileline">
<tr><td align="left" class="profile" nowrap="nowrap">{postrow.POSTER_JOINED}</td></tr>
<tr><td align="left" class="profile" nowrap="nowrap">{postrow.POSTER_POSTS}</td></tr>
<tr><td align="left" valign="middle" class="profile">{postrow.POSTER_FROM}</td></tr>
<!-- [BEGIN LEVEL MOD] -->
<span class="postdetails">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">HP:&nbsp;&nbsp{postrow.POSTER_HP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/HPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/HPcontainer1.gif" width="3" height="10"><img src="images/RPG/HPfill.gif" width="{postrow.POSTER_HP_WIDTH}" height="10"><img src="images/RPG/HPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_HP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">MP:&nbsp;&nbsp {postrow.POSTER_MP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/MPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/MPcontainer1.gif" width="3" height="10"><img src="images/RPG/MPfill.gif" width="{postrow.POSTER_MP_WIDTH}" height="10"><img src="images/RPG/level_mod/MPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_MP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">EXP:&nbsp;&nbsp{postrow.POSTER_EXP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/EXPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/EXPcontainer1.gif" width="3" height="10"><img src="images/RPG/EXPfill.gif" width="{postrow.POSTER_EXP_WIDTH}" height="10"><img src="images/RPG/EXPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_EXP_WIDTH}%</font></td>
</tr>
</table>
<font style="FONT: 8pt arial">&nbsplevel #&nbsp;&nbsp;&nbsp<B>{postrow.POSTER_LEVEL}</B></font>
</span>
</td>
<!-- [END LEVEL MOD] -->
</table>{postrow.XS_DATA_END}</td></tr>
</table></td>
</tr>
</table></td>
<td width="5" background="{T_TEMPLATE_PATH}/images/post_right.gif"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="5" height="1" border="0" /></td>
</tr>
<tr>
<td height="10" background="{T_TEMPLATE_PATH}/images/post_bottom.gif"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="150" height="10" border="0" /></td>
<td width="5" height="10"><img src="{T_TEMPLATE_PATH}/images/post_corner.gif" width="5" height="10" border="0" /></td>
</tr>
<!-- left row table end --></table><br /><br /></td>
<td class="row1" align="left" valign="top" width="100%"><table border="0" cellspacing="0" cellpadding="5" width="100%"><!-- right top row table start -->
<tr>
<td width="100%"><span class="postbody">{postrow.MESSAGE}</span></td>
</tr>
<!-- right top row table end --></table></td>
</tr>
<tr>
<td class="row1" align="left" valign="bottom" nowrap="nowrap"><table border="0" cellspacing="0" cellpadding="5" width="100%"><!-- right bottom row start -->
<tr>
<td width="100%"><span class="postbody"><span class="gensmall">{postrow.EDITED_MESSAGE}</span>{postrow.SIGNATURE}</span></td>
</tr>
<!-- right bottom row end --></table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28" valign="bottom" class="catBottom"><table border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="150"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="150" height="1" border="0" /></td>
<td width="100%" align="left" valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.SEARCH_IMG2} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG} {postrow.ICQ_IMG}</td>
</tr></table></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="15" align="right" valign="top"><img src="{T_TEMPLATE_PATH}/images/ftr_left.gif" width="15" height="15" border="0" alt="" /></td>
<td width="100%" background="{T_TEMPLATE_PATH}/images/ftr_bg.gif"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
<td width="15" align="left" valign="top"><img src="{T_TEMPLATE_PATH}/images/ftr_right.gif" width="15" height="15" border="0" alt="" /></td>
</tr>
</table>
<!-- END postrow -->

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" align="right" valign="bottom"><img src="{T_TEMPLATE_PATH}/images/hdr_left.gif" width="15" height="28" border="0" alt="" /></td>
<td width="100%" align="center" valign="middle" background="{T_TEMPLATE_PATH}/images/hdr_bg.gif"><a class="cattitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></td>
<td width="15" align="left" valign="bottom"><img src="{T_TEMPLATE_PATH}/images/hdr_right.gif" width="15" height="28" border="0" alt="" /></td>
</tr>
</table>
<table class="forumline" width="100%" cellspacing="1" cellpadding="" border="0">
<tr>
<td class="row1" align="left" valign="top">
<span class="nav">&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span><br />
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tr>
<td align="left" valign="top">
<span class="gensmall">{S_AUTH_LIST}</span>
</td>
<td align="right" valign="top">
<span class="gensmall">{S_TIMEZONE}&nbsp;&nbsp;<br />
{PAGE_NUMBER}&nbsp;&nbsp;</span>
<span class="nav"><b>{PAGINATION}</b></span><br />
<span class="gensmall">{S_WATCH_TOPIC}</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="catBottom" align="center" valign="middle" nowrap="nowrap"><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<form method="post" action="{S_POST_DAYS_ACTION}"><td align="left" valign="middle" nowrap="nowrap">{S_SELECT_POST_DAYS}&nbsp;{S_SELECT_POST_ORDER}&nbsp;<input type="submit" value="{L_GO}" class="liteoption" name="submit" /></td></form>
<td align="right" valign="middle" nowrap="nowrap">{JUMPBOX}</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="15" align="right" valign="top"><img src="{T_TEMPLATE_PATH}/images/ftr_left.gif" width="15" height="15" border="0" alt="" /></td>
<td width="100%" background="{T_TEMPLATE_PATH}/images/ftr_bg.gif"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
<td width="15" align="left" valign="top"><img src="{T_TEMPLATE_PATH}/images/ftr_right.gif" width="15" height="15" border="0" alt="" /></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tr>
<td align="left" valign="top">&nbsp;<a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></td>
<td align="right" valign="top">{S_TOPIC_ADMIN}&nbsp;</td>
</tr>
</table>
<br />
Und das ist die Anleitung
#################################################################
## Mod : HP/MO/EXP Mod
## Mod Version: 1.0 - BETA
## Author: mikey swinson <mikey_swinson@yahoo.com> - [NO WEBSITE]
## 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: 3 to 5 Minutes
## Files To Edit: 4
## ./templates/YOUR_TEMPLATE_NAME/profile_view_body.tpl
## ./includes/usercp_viewprofile.php
## ./viewtopic.php
## ./templates/YOUR_TEMPLATE_NAME/viewtopic_body.tpl
##
## Included Files:
## images/RPG/HPcontainer.gif
## images/RPG/MPcontainer.gif
## images/RPG/EXPcontainer.gif
## images/RPG/HPcontainer1.gif
## images/RPG/MPcontainer1.gif
## images/RPG/EXPcontainer1.gif
## images/RPG/HPfill.gif
## images/RPG/MPfill.gif
## images/RPG/EXPfill.gif
## images/RPG/HPcap.gif
## images/RPG/MPcap.gif
## images/RPG/EXPcap.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 = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

#
#-----[ 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() - $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,
'MP' => $level_mp,
'MP_WIDTH' => $level_mp_percent,
'EXP' => $level_exp,
'EXP_WIDTH' => $level_exp_percent,
'LEVEL' => $level_level,
/* END LEVEL MOD */

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

/templates/ [YOUR TEMPLATE NAME] /profile_view_body.tpl

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

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

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

<span class="postdetails">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">hp:</font></td>
<td align="right"><font style="font: 8pt arial;color: #000000">{HP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="http://members.lycos.co.uk/balzinc/comm ... tainer.gif" width="108" height="10">
<tr>
<td><img src="http://members.lycos.co.uk/balzinc/comm ... ainer1.gif" width="3" height="10" alt="This represents how active the user is. Max HP is based off level, current HP is based on how often the user posts."><img src="http://members.lycos.co.uk/balzinc/comm ... HPfill.gif" width="{HP_WIDTH}" height="10" alt="This represents how active the user is. Max HP is based off level, current HP is based on how often the user posts."><img src="http://members.lycos.co.uk/balzinc/comm ... /HPcap.gif" width="4" height="10" alt="This represents how active the user is. Max HP is based off level, current HP is based on how often the user posts."></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{HP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">mp:</font></td>
<td align="right"><font style="font: 8pt arial;color: #000000">{MP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="http://members.lycos.co.uk/balzinc/comm ... tainer.gif" width="108" height="10">
<tr>
<td><img src="http://members.lycos.co.uk/balzinc/comm ... ainer1.gif" width="3" height="10" alt="This represents how quickly the user posts. Max MP is based on level, each post costs MP, and MP regenerates over time."><img src="http://members.lycos.co.uk/balzinc/comm ... MPfill.gif" width="{MP_WIDTH}" height="10" alt="This represents how quickly the user posts. Max MP is based on level, each post costs MP, and MP regenerates over time."><img src="http://members.lycos.co.uk/balzinc/comm ... /MPcap.gif" width="4" height="10" alt="This represents how quickly the user posts. Max MP is based on level, each post costs MP, and MP regenerates over time."></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{MP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">exp:</font></td>
<td align="right"><font style="font: 8pt arial;color: #ff0000">{EXP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="http://members.lycos.co.uk/balzinc/comm ... tainer.gif" width="108" height="10">
<tr>
<td><img src="http://members.lycos.co.uk/balzinc/comm ... ainer1.gif" width="3" height="10" alt="This shows a percentage showing how many more posts the user has to make to get to the next level."><img src="http://members.lycos.co.uk/balzinc/comm ... XPfill.gif" width="{EXP_WIDTH}" height="10" alt="This shows a percentage showing how many more posts the user has to make to get to the next level."><img src="http://members.lycos.co.uk/balzinc/comm ... EXPcap.gif" width="4" height="10" alt="This shows a percentage showing how many more posts the user has to make to get to the next level."></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{EXP_WIDTH}%</font></td>
</tr>
</table>
<font style="FONT: 8pt arial">I'm on level #&nbsp;&nbsp;&nbsp<B>{LEVEL}</B></font>
</span>

#
#-----[ 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() - $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() - $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_MP" => $level_mp,
"POSTER_MP_WIDTH" => $level_mp_percent,
"POSTER_EXP" => $level_exp,
"POSTER_EXP_WIDTH" => $level_exp_percent,
"POSTER_LEVEL" => $level_level,
/* END LEVEL MOD */

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

./templates/YOUR_TEMPLATE_NAME/viewtopic_body.tpl

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

{postrow.POSTER_FROM}</span><br />

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

<!-- [BEGIN LEVEL MOD] -->
<span class="postdetails">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">HP:&nbsp;&nbsp{postrow.POSTER_HP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/HPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/HPcontainer1.gif" width="3" height="10"><img src="images/RPG/HPfill.gif" width="{postrow.POSTER_HP_WIDTH}" height="10"><img src="images/RPG/HPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_HP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">MP:&nbsp;&nbsp {postrow.POSTER_MP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/MPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/MPcontainer1.gif" width="3" height="10"><img src="images/RPG/MPfill.gif" width="{postrow.POSTER_MP_WIDTH}" height="10"><img src="images/RPG/level_mod/MPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_MP_WIDTH}%</font></td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font style="font: 8pt arial;color: #000000">EXP:&nbsp;&nbsp{postrow.POSTER_EXP}</font></td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" background="images/RPG/EXPcontainer.gif" width="108" height="10">
<tr>
<td><img src="images/RPG/EXPcontainer1.gif" width="3" height="10"><img src="images/RPG/EXPfill.gif" width="{postrow.POSTER_EXP_WIDTH}" height="10"><img src="images/RPG/EXPcap.gif" width="4" height="10"></td>
</tr>
</table>
</td>
<td align="center"><font style="font: 8pt arial;color: #000000">&nbsp{postrow.POSTER_EXP_WIDTH}%</font></td>
</tr>
</table>
<font style="FONT: 8pt arial">&nbsplevel #&nbsp;&nbsp;&nbsp<B>{postrow.POSTER_LEVEL}</B></font>
</span>
</td>
<!-- [END LEVEL MOD] -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

#
#-----[ NOTICE ]------------------------------------------
#

After installing the mod as it would appear in the profile, the user's contact list
(PM, EMAIL, WEBSITE, AIM, YMSG, MSNM, ICQ, etc.) will appear BELOW the table and the
template will become rearranged. However, the mod will appear in its appropriate
position. If you feel that the contact list is uncomfortable for you, report this
to phpBB by entering its million-user community.


# EoM
Benutzeravatar
Leuchte
Ehemaliges Teammitglied
Beiträge: 9179
Registriert: 26.05.2003 14:57
Wohnort: Duisburg
Kontaktdaten:

Beitrag von Leuchte »

gib einen link zu deiner viewtopic_body.tpl
:roll:
versuch mal die
Benutzeravatar
sledgi
Mitglied
Beiträge: 289
Registriert: 20.08.2003 15:39
Kontaktdaten:

Beitrag von sledgi »

aber es geht noch nicht ganz
Benutzeravatar
Leuchte
Ehemaliges Teammitglied
Beiträge: 9179
Registriert: 26.05.2003 14:57
Wohnort: Duisburg
Kontaktdaten:

Beitrag von Leuchte »

ist der ordner images/RPG/ mit den bildern vorhanden?
Benutzeravatar
sledgi
Mitglied
Beiträge: 289
Registriert: 20.08.2003 15:39
Kontaktdaten:

Beitrag von sledgi »

Ich habe es so /images/level-mod/bilder
Benutzeravatar
Leuchte
Ehemaliges Teammitglied
Beiträge: 9179
Registriert: 26.05.2003 14:57
Wohnort: Duisburg
Kontaktdaten:

Beitrag von Leuchte »

dann musst du das auch in der profile_view_body.tpl und der viewtopic_body.tpl anpassen
Benutzeravatar
sledgi
Mitglied
Beiträge: 289
Registriert: 20.08.2003 15:39
Kontaktdaten:

Beitrag von sledgi »

habe ich gemacht geht immernoch nicht
Benutzeravatar
Leuchte
Ehemaliges Teammitglied
Beiträge: 9179
Registriert: 26.05.2003 14:57
Wohnort: Duisburg
Kontaktdaten:

Beitrag von Leuchte »

ein sehr aussagekräftiger beitrag......
durchsuch die beiden o.g. dateien nach /images/RPG/ und ersetz das mit deinem pfad
---*edit*---
sicher das die dateien vorhanden sind? achte auch auf die richtige schreibweise (gross- und kleinschreibung!)
---*edit2*---
im profil wirds richtig angezeigt.. dort ist auch eine andere adresse.. übernimm die auch für die viewtopic_body.tpl
Benutzeravatar
sledgi
Mitglied
Beiträge: 289
Registriert: 20.08.2003 15:39
Kontaktdaten:

Beitrag von sledgi »

Ich habe es geschaft aber jetzt wollte ich fragen was das alles bedeutet

EXP? MP? HP?
Antworten

Zurück zu „phpBB 2.0: Mod Suche/Anfragen“