MyBB Community Forums

Full Version: The infamous HP / MP / EXP Mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
I apologize, I forgot to add them to the archive...

Here you go. Just upload the images folder.
http://symphonicheaven.com/forum/showthr...77#pid2677

My postbit template is like this...

<tr>
<td class="trow_sep" width="100%" valign="top" nowrap="nowrap"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a><div align="left" style="float:left;">{$post['useravatar']}
</div><div align="left" style="float:left; padding-left:10px;"><table><tr><td>

<table cellpadding="3" cellspacing="3">
 <tr>
  <td><strong><span class="largetext">{$post['onlinestatus']} {$post['profilelink']}<br /></span><span class="smalltext">{$post['usertitle']}</span></strong></td>
  <td><span class="smalltext">HP: {$hp} / {$maxhp}</span><table width="60" class="rpg1"  cellspacing="0" align="center"><tr><td class="rpg2" nowrap="nowrap"><img alt="{$post['username']}'s HP" src="images/rpg/bhg.gif" width="{$hpf}%" height="8" /><img alt="{$post['username']}'s HP" src="images/rpg/bhb.gif" width="1" height="8" /></td></tr></table></td>
  <td><span class="smalltext">MP: {$mp} / {$maxmp}</span><table width="60" class="rpg1" cellspacing="0" align="center"><tr><td class="smalltext" nowrap="nowrap"><img alt="{$post['username']}'s MP" src="images/rpg/bmg.gif" width="{$mpf}%" height="8" /><img alt="{$post['username']}'s MP" src="images/rpg/bmb.gif" width="1" height="8" /></td></tr></table></td>
  <td><span class="smalltext">EXP: {$ep}% </span><table width="60" class="rpg1" cellspacing="0" align="center"><tr><td class="rpg2" nowrap="nowrap"><img alt="{$post['username']}'s EXP" src="images/rpg/bxg.gif" width="{$ep}%" height="8" /><img alt="{$post['username']}'s EXP" src="images/rpg/bxb.gif" width="1" height="8" /></td></tr></table></td>
 </tr>
</table>
{$post['medals']}</td>
</tr></table>
</div>
<div align="right" style="float:right;">
<span class="smalltext">
{$post['userstars']}{$post['groupimage']}
<p></p>Total Posts: {$post['postnum']}
<br />{$post['user_myps']}
<br /><span class="smalltext">Level: {$showlevel}</span>
</div>
</span>
</td></tr><tr>
<td class="trow1" width="100%" valign="top">
<table width="100%">
<tr><td class="trow">$post[posturl] $post[icon]<span class="smalltext"><strong>$post[subject]</strong></span><hr />
<div id="pid_{$post['pid']}">
<p>
{$post['message']}
</p>
</div>
{$post['attachments']}
{$post['signature']}

<div style="text-align: right; vertical-align: bottom;">
<span class="smalltext">{$post['postdate']} {$post['posttime']}</span> <br />
{$post['editedmsg']}
{$post['iplogged']}
</div>
</td></tr>
</table>
</td>
</tr>
<td class="trow_sep" width="100%" valign="middle" height="18">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr valign="bottom">
        <td align="left"><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span></td>
        <td align="right"><span class="smalltext">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}</span></td>
    </tr>
    </table>
</td>
</tr>
</table>
<p></p>
<table border="0" cellspacing="1" cellpadding="4" class="tborder" style="clear: both;">

So it seems that if {$post['user_details']} isn't in the postbit template, the script can't find the correct data to fill in the stats. Anything I can do to remedy this?
I'm assuming you have the plugin activated?

If not then it won't be able to get the stats.

For custom postbits like that you need to activate it, remove the HTML for the stats from the plugin, and insert it yourself to your postbit template.

I'll do some testing (since I have a similar postbit on my live site) in a bit and post the results.
Ryan Ashbrook Wrote:I'm assuming you have the plugin activated?

If not then it won't be able to get the stats.

For custom postbits like that you need to activate it, remove the HTML for the stats from the plugin, and insert it yourself to your postbit template.

I'll do some testing (since I have a similar postbit on my live site) in a bit and post the results.

Yep, it's activated. And that's what I did --- I removed the HTML and inserted it. I did a search+replace in Notepad++ to get rid of the \ marks (since those go away normally when MyBB installs a plugin).

I know it's working if I insert the user_details part, since that's apparently getting information from the Master template. I can't just edit that one, since I already have an edited postbit template.
I'm assuming that is it, however, I will do my best to fix this.

It'll be hard though, because I have a Horizontal Postbit and all of the user information is still contained in postbi_author_user.

However, I'll copy my template over to Localhost and do some tests after I finish checking my websites.


EDIT: Ok, doing some testing I think I've found that your theory is partially correct.

The variables created inside the plugin can't be accessed outside of it, I think. That's my guess.

Your postbit is weird but, please, try this:

In the plugin file find:

$post['user_details'] = "{$post['user_details']}<br /><br /><span class=\"smalltext\">Level: {$showlevel}</span><br />
<span class=\"smalltext\">HP: {$hp} / {$maxhp}</span>
	<table width=\"60\" class=\"rpg1\"  cellspacing=\"0\" align=\"center\">
		<tr> 
			<td class=\"rpg2\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s HP\" src=\"images/rpg/bhg.gif\" width=\"{$hpf}%\" height=\"8\" /><img alt=\"{$post['username']}'s HP\" src=\"images/rpg/bhb.gif\" width=\"1\" height=\"8\" /></td>
		</tr>
	</table>
<span class=\"smalltext\">MP: {$mp} / {$maxmp}</span>
	<table width=\"60\" class=\"rpg1\" cellspacing=\"0\" align=\"center\">
		<tr> 
			<td class=\"smalltext\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s MP\" src=\"images/rpg/bmg.gif\" width=\"{$mpf}%\" height=\"8\" /><img alt=\"{$post['username']}'s MP\" src=\"images/rpg/bmb.gif\" width=\"1\" height=\"8\" /></td>
		</tr>
	</table>
<span class=\"smalltext\">EXP: {$ep}% </span> 
	<table width=\"60\" class=\"rpg1\" cellspacing=\"0\" align=\"center\">
		<tr> 
			<td class=\"rpg2\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s EXP\" src=\"images/rpg/bxg.gif\" width=\"{$ep}%\" height=\"8\" /><img alt=\"{$post['username']}'s EXP\" src=\"images/rpg/bxb.gif\" width=\"1\" height=\"8\" /></td>
		</tr>
	</table>";

And replace it with:

$post['medals'] =   "<td><span class=\"smalltext\">HP: {$hp} / {$maxhp}</span><table width=\"60\" class=\"rpg1\"  cellspacing=\"0\" align=\"center\"><tr><td class=\"rpg2\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s HP\" src=\"images/rpg/bhg.gif\" width=\"{$hpf}%\" height=\"8\" /><img alt=\"{$post['username']}'s HP\" src=\"images/rpg/bhb.gif\" width=\"1\" height=\"8\" /></td></tr></table></td>
  <td><span class=\"smalltext\">MP: {$mp} / {$maxmp}</span><table width=\"60\" class=\"rpg1\" cellspacing=\"0\" align=\"center\"><tr><td class=\"smalltext\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s MP\" src=\"images/rpg/bmg.gif\" width=\"{$mpf}%\" height=\"8\" /><img alt=\"{$post['username']}'s MP\" src=\"images/rpg/bmb.gif\" width=\"1\" height=\"8\" /></td></tr></table></td>
  <td><span class=\"smalltext\">EXP: {$ep}% </span><table width=\"60\" class=\"rpg1\" cellspacing=\"0\" align=\"center\"><tr><td class=\"rpg2\" nowrap=\"nowrap\"><img alt=\"{$post['username']}'s EXP\" src=\"images/rpg/bxg.gif\" width=\"{$ep}%\" height=\"8\" /><img alt=\"{$post['username']}'s EXP\" src=\"images/rpg/bxb.gif\" width=\"1\" height=\"8\" /></td></tr></table></td>
</tr>
</table>
{$post['medals']}";

Then add this under that:

$post['user_myps'] = "<br /><span class=\"smalltext\">Level: {$showlevel}</span>";

Then remove the following from your postbit template:

  <td><span class="smalltext">HP: {$hp} / {$maxhp}</span><table width="60" class="rpg1"  cellspacing="0" align="center"><tr><td class="rpg2" nowrap="nowrap"><img alt="{$post['username']}'s HP" src="images/rpg/bhg.gif" width="{$hpf}%" height="8" /><img alt="{$post['username']}'s HP" src="images/rpg/bhb.gif" width="1" height="8" /></td></tr></table></td>
  <td><span class="smalltext">MP: {$mp} / {$maxmp}</span><table width="60" class="rpg1" cellspacing="0" align="center"><tr><td class="smalltext" nowrap="nowrap"><img alt="{$post['username']}'s MP" src="images/rpg/bmg.gif" width="{$mpf}%" height="8" /><img alt="{$post['username']}'s MP" src="images/rpg/bmb.gif" width="1" height="8" /></td></tr></table></td>
  <td><span class="smalltext">EXP: {$ep}% </span><table width="60" class="rpg1" cellspacing="0" align="center"><tr><td class="rpg2" nowrap="nowrap"><img alt="{$post['username']}'s EXP" src="images/rpg/bxg.gif" width="{$ep}%" height="8" /><img alt="{$post['username']}'s EXP" src="images/rpg/bxb.gif" width="1" height="8" /></td></tr></table></td>
</tr>
</table>

INCLUDING the tr and table at the end, even though it is tied into your postbit template.

As well as this:

<br /><span class="smalltext">Level: {$showlevel}</span>

Try this and report back to me, and remember to backup both the plugin file and your postbit template before doing these, as they may not work.

What this should do, is automatically place the HTML in the postbit via HTML, and allow the variables being used to grab the right properties.

If it doesn't work then please, PM me, as it would seem I need to look into this a bit more. Smile

Note: This is only a fix for Soshite's forums, please do not apply these modifications to your forums, they are not a patch for a bug in the plugin, therefor, I will not support you if you make these changes and ask "Why doesn't it look right?"
The MYPS part needed to be in that second template call, but after that quick fix, it works like a charm. Smile

Big thanks for doing that for me. ^.^
Ahh ok, I seem to have forgot it. Toungue

But glad it worked for you. Smile
I'm looking in every template I can think of but I can't seem to find which one this plugin is located... I was assuming it would be in the postbit template but no dice. Sad
I never found the Find / Replace Templates function a reliable source to add things to the templates, I've simply had too many problems with it.

Therefor, the plugin search's for the post author info variable used to display the post author information.

In short, the HTML is contained inside the plugin.

Search for $post['user_details'] in the plugin file.
Awesome! Thanks! Big Grin
Pages: 1 2 3 4 5 6 7 8