Quote:
Originally Posted by kh99
I think this would be easiest, if just changing the postbit display is enough. There's a minor complication in that the posts number is formatted as a string and the original integer is not saved, so there's no easy way to recalculate it after that. But what you might do is create a plugin using hook postbit_display_start and create your own "adjusted posts" value in $post, then edit your postbit (or postbit_legacy) to use the new value.
For example, if your non-user-editable field is field7, then maybe the plugin code is:
Code:
$post['adjusted_posts'] = vb_number_format($post['posts'] + $post['field7']);
Then in the postbit template, change {vb:raw post.posts} to {vb:raw post.adjusted_posts}.
But IIRC, the profile field has to at least be publicly readable or else you'll find $post['field7'] will be empty.
|
Holy hell, that was so easy...
You are my hero!
--------------- Added [DATE]1404440906[/DATE] at [TIME]1404440906[/TIME] ---------------
That worked just fine, but now I'm trying to add that same post count to the sidebar on the member profile sidebar.
In 'memberinfo_block_ministats', there is the code:
<dl class="stats">
<dt>{vb:rawphrase total_posts}</dt>
<dd> {vb:raw prepared.posts}</dd>
</dl>
I am trying to get the adjusted_posts value previously calculated to show here as well.
I tried using the same code using the 'member_build_blocks_start' hook, and changing 'prepared.posts' to 'post.adjusted_posts', but it didn't work.
What was I supposed to do differently?
Thanks!