MyBB Community Forums

Full Version: add a new postbit button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to add a new postbit button so that it appears on the postbit bar.

I've created a template "postbit_facebook"

I've added

$l['postbit_facebook'] = "Share this post on Facebook";

to global.lang.php file.

I've also edited the postbit template so that it looks like

{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_rep']}{$post['button_find']}{$post['button_facebook']} 


but it's not showing?

I think it may be something to do with these which i can't find.

<td class="trow1 post_buttons {$unapproved_shade}">
<div class="author_buttons float_left">

Also, i've added the {$post['button_facebook']} into the postbit but i've not assigned it any values, but i don't know where to add them.

Any ideas?
Just add the code for the button in the postbit template instead, saves messing around.
What's the alternative, proper method?

I don't mend the messing, the template would look messy it's long code.
And what PHP are you using to tell it that $post['button_facebook'] is supposed to show the postbit_facebook template...??
This is the problem that i've hit, i don't know where to add it.

I've tried searching for the existing ones, such a button_find but i don't know where they're located.
In ./inc/functions_post.php you need to add:
eval("\$post['button_facebook'] = \"".$templates->get("postbit_facebook")."\";");
I'd add it to a plugin rather than editing a file, look at how I did it with this: http://mods.mybb.com/view/return-to-top-postbit-button
@AJS Thank you, did the job. Smile

@Matt I don't know how to create plugins yet. Sad