[BETA] HP/MP/EXP Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

Have you tried the latest post of code I made?

I made a few alterations.
I've Been Banned!
deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Contact:

?

Post by deny »

IT is the same code as from the link:

http://home.kimo.com.tw/ycl_6/HP_MP_EXP.zip

Isn't?
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Just change the level_mod.php in the HP_MP_EXP.zip package to the new edited one by Antony. I believe he fix the trying to raise a non positive value problem. Let me know if the fix works

~Mac
deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Contact:

Still same

Post by deny »

It is still same.
Level and skill ration on the viewtopic.php are correct but if you clik on the profile level and skill ratio and graphic are the same for the all user.I think that something must be changed in profile_view_body.php.I use this code:

./templates/YOUR_TEMPLATE_NAME/profile_view_body.tpl

Code: Select all

# 
#-----[ FIND ´M§ä ]------------------------------------------ 
# 

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

# 
#-----[ AFTER, ADD ¤§«á¥[¤J ]------------------------------------------ 
# 

<!-- [BEGIN LEVEL MOD] --> 
<tr> 
<td align="right" valign="top" nowrap="nowrap" class="explaintitle"><span class="postdetails">Level/Skill Ratio: </span></td> 
<td><b><span class="gen">{LEVEL}/{LEVEL_SKILLRATIO}</span></b></td> 
</tr> 
<tr> 
<td align="right" valign="top" nowrap="nowrap" class="explaintitle"><span class="postdetails">Class: </span></td> 
<td><b><span class="gen">{LEVEL_CLASSNAME}</span></b></td> 
</tr> 
<tr> 
<td align="right" valign="top" nowrap="nowrap" class="explaintitle"> </td> 
<td> 
<span class="postdetails"> </span> 
<table width="143" border="0" cellpadding="0" cellspacing="0" style="background-image:url(templates/subSilver/images/level_mod/lm_bkg.gif)"> 
<tr> 
<td><img src="images/spacer.gif" alt="" width="31" height="49" /></td> 
<td width="100%"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td><img src="images/spacer.gif" alt="" width="20" height="6" /></td> 
</tr> 
<tr> 
<td><img src="templates/subSilver/images/level_mod/lm_hp_bar.gif" alt="{HP}" title="{HP}" width="{HP_WIDTH}" height="9" /><img src="templates/subSilver/images/level_mod/lm_hp_bar_end.gif" alt="" width="4" height="9" /></td> 
</tr> 
<tr> 
<td><img src="images/spacer.gif" alt="" width="20" height="4" /></td> 
</tr> 
<tr> 
<td><img src="templates/subSilver/images/level_mod/lm_mp_bar.gif" alt="{MP}" title="{MP}" width="{MP_WIDTH}" height="9" /><img src="templates/subSilver/images/level_mod/lm_mp_bar_end.gif" alt="" width="4" height="9" /></td> 
</tr> 
<tr> 
<td><img src="images/spacer.gif" alt="" width="20" height="4" /></td> 
</tr> 
<tr> 
<td><img src="templates/subSilver/images/level_mod/lm_exp_bar.gif" alt="{EXP}" title="{EXP}" width="{EXP_WIDTH}" height="9" /><img src="templates/subSilver/images/level_mod/lm_exp_bar_end.gif" alt="" width="4" height="9" /></td> 
</tr> 
<tr> 
<td><img src="images/spacer.gif" alt="" width="20" height="8" /></td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
</td> 
</tr> 
<!-- [END LEVEL MOD] --> 
And there is probably something wrong
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

@deny: No it's an edited code. Two small edits, two whole cahtrectors. It attempts to surpess any error resulting form the lines giving he non-positive value.

@ycl6: Yes, that's exactly what I'm trying to do. And as I have previously stated all my code is rough and untested. :)
I've Been Banned!
Alienz
Registered User
Posts: 53
Joined: Thu Mar 13, 2003 12:16 am

Post by Alienz »

Antony, I am using your modifier HP/MP/EXP mod. But why does the MP would'nt drop? It just remain 8/8 no matter how much I post?
deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Contact:

Tried

Post by deny »

I tried edited code but it is still same problem as described above!
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

@Alienz: The alterations for the way MP and EXP and HP is rewarded and calculated can be seen aneasily edited if you look at the files, I seet it high, as many peple claimed to have no MP and claimed it to be brokedn.

@Deny: I am only trying to fix the Non-Positive value error. As soon as i have that error fixed, I count this mod as final, as that is the only part I am responsable for. And then, I want it submitting to phpBBHacks.com, as I don't submit here, due to reasons undefined.
I've Been Banned!
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

@Antony: I will submit it today to phpbbhacks and hope it will get reviewed and give a GO (my last submission of another MOD is not successful and I don't know the reason)

@deny: The MAX thing is something I write for a friend of mine, it's not going to be included in the MOD package. It does work on him and me and others, strangely, there are a few people that couldn't implement this extra add-on. I suspect it's because of the position of the add-on script. I have them tested on modded phpBB, not fresh board, so couldn't tell if position matters or not. You might need to figure out that bit by yourself, or if someone else fix it

~Mac
deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Contact:

Strange

Post by deny »

It is really strange.I'm not php expert but i really can't see why it don't works in viewprofile.php because it works smothly in viewtopic.php!!!
And the princip is same.

viewtopic_body.tpl use these variables from viewtopic.php to get things working:

Code: Select all

"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, 
"POSTER_LEVEL_CLASSNAME" => $level_classname, 
"POSTER_LEVEL_SKILLRATIO" => $level_skillratio, 

and then call it with

Code: Select all

POSTER_LEVEL; POSTER_LEVEL_SKILLRATIO; POSTER_LEVEL_CLASSNAME etc...

but profile_view_body.tpl is unable to call almost same variables (with different name) from usercp_viewprofile.php:

Code: Select all

'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, 
'LEVEL_CLASSNAME' => $level_classname, 
'LEVEL_SKILLRATIO' => $level_skillratio, 
where then profile_view_body.tpl must call it with

Code: Select all

 LEVEL; LEVEL_SKILLRATIO; LEVEL_CLASSNAME etc

Really don't understand why it does not works???Is is almost same with different names for variables in different files!??
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

Thanks, for submitting.

The last update of level_mod.php should have removed the non-positive value bug.

As no-one is bothering top confirm this or deny it. I am counting it as done, due to lack of co-operation.

I thank, you all for testing it and anyone who wishes to continue it is free to, my work is done. Thank you.

Antony Bailey aka Rapid Dr3am.
I've Been Banned!
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

level_mod.php has a little script to check if the page is usercp_viewprofile.php or viewtopic.php in the vary beginning, so even the variable name is different in those 2 files, level_mod.php should take care of that. If there is no way to fix this, you might want to try pasting the code from level_mod.php into usercp_viewprofile.php and viewtopic.php (just like the original HP/MP/EXP Mod by Jon Borzilleri in page 1)

Code: Select all

// Are we in profile or viewtopic? 

$trash = $_SERVER['SCRIPT_NAME']; 
$lpos = strrpos($trash,"/") + 1; 
$rpos = strpos($trash, ".php"); 
$trash = substr($trash,$lpos,($rpos-$lpos)); 

if ($trash == 'profile') { 
   $profileversion = true; 
} else { 
   $profileversion = false; 
} 

if ($profileversion) { 
   if($profiledata['user_posts'] < 1) { 
      $level_level = 0; 
   } else { 
      $level_level = floor( pow( log10( $profiledata['user_posts'] ), 3 ) ) + 1; 
   } 
} else { 
   if($postrow[$i]['user_posts'] < 1) { 
      $level_level = 0; 
   } else { 
      $level_level = floor( pow( log10( $postrow[$i]['user_posts'] ), 3 ) ) + 1; 
   } 
} 
~Mac
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

Antony wrote: I thank, you all for testing it and anyone who wishes to continue it is free to, my work is done. Thank you.

Well, that goes the same as me, whoever wish to pick this up and develop further is most welcome by me.

Thanks to all the original authors and Daz (graphic).

~Mac
deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Contact:

.

Post by deny »

I tried but without any luck!!
It is in fact simple problem and only visible if someone click on profile from the user but...
Thanks anyway for trying to fix it!!
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Re: .

Post by Antony »

deny wrote: I tried but without any luck!!
It is in fact simple problem and only visible if someone click on profile from the user but...
Thanks anyway for trying to fix it!!


I have been trying to fix the non-positive value.

Nothing more, is that fixed yes or no?

With the updated code i posted nothing else/
I've Been Banned!
Locked

Return to “[2.0.x] MODs in Development”