MyBB Community Forums

Full Version: {$post['pid']} not showing me the correct post id.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I've been spending the past 2 weeks working on a custom theme with tons of new features. I'm pretty close to finishing, but I got stuck on this while working on my Quick Mod Tool.

Whenever I try to test the deleting function it never gives me the right post id.

Here are some images to give a good idea of what I mean.
It's a rather wide image so I linked it.
The status bar shows it wants to delete post# 46, the thing is, neither of the two posts in that thread have a pid of 46, and it shows the pid as #46 no matter what post I use my mod tool on.

Here are the parts of code that involve that particular function.
Templates -> Post Bit -> postbit_iplogged_hiden (I replaced the IP thing with my mod tool so it only shows for moderators)
<span id="delpost" style="display: none;">
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="tid" value="{$tid}" />
<input type="hidden" name="modtype" value="inlinepost" />
<div style="padding: 5px; border: 1px solid #FFF3BA; background-color: #FFF8DD;" width="100%" valign="middle">
<div style="float: right;">
<a href="#cancel" onclick="UnTip()"><sup>[X]</sup></a>
</div>
<b><small>Moderator Tools</small></b><br /><br />
<sup>
Are you sure you want to delete this post?<br />
{$post['button_quickdelete']}
</sup
</div>
</form>
</span>

Templates -> Post Bit -> postbit_quickdelete
<script type="text/javascript">
document.write('<a href="javascript:Thread.deletePost({$post['pid']});"><center>[Delete Post]<\/center><\/a>');
</script>

I would really appreciate some help with this matter, thanks a bunch.
Hi,

Your code works fine for me here.

Do you, perhaps, have any conflicting plugins/code modifications?
ZiNgA BuRgA Wrote:Hi,

Your code works fine for me here.

Do you, perhaps, have any conflicting plugins/code modifications?
No Plugins, I pretty much code everything myself, but I think some modification I made to a few php files might have had something to do with it. It might have been the javascript library I used for the tooltips. I'll check some stuff and report back.