MyBB Community Forums

Full Version: help me
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
i do not know were to post this but here it is if its in the wrong forum move it to were it has to be

function topic_edit_message_activate()
{
	require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
	find_replace_templatesets('postbit_editedby', '#{\$post[\'editedprofilelink\']}.)</span>#', '{\$post[\'editedprofilelink\']}. {\$lang->reason_edit} {\$post[\'editmessage\']})</span>');
}

function topic_edit_message_deactivate()
{
	require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
	find_replace_templatesets('postbit_editedby', '# {\$lang->reason_edit} {\$post[\'editmessage\']}#', '', 0);
}

can some one tell me what wrong with that as when i install plugin it give a error page loads to fast for me to get it but it seems to delete all the contents of the template postbit_editedby.
And that's for what MyBB version ? 1.4 ?
Oh sorry 1.4.
function topic_edit_message_activate()
{
	require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
	find_replace_templatesets("postbit_editedby", '#'.preg_quote('{$post[\'editedprofilelink\']}').'#', '{\$lang->reason_edit} {\$post[\'editedprofilelink\']}');
}

function topic_edit_message_deactivate()
{
	require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
	find_replace_templatesets("postbit_editedby", '#'.preg_quote('{$lang->reason_edit}').'#', '',0);
} 

function topic_edit_message($post)
{
	global $mybb, $lang;
	$lang->reason_edit = $lang->sprintf($lang->reason_edit, $post['editmessage']);
}

And in your langfile use
$l['reason_edit'] = "Edit Reason: {1}"; 

Hopefully it helps you a lil; the activate/deactivate function works; just tested them.
do not know it jsut shows (This post was last modified: Today 12:10 PM by Edit Reason: {1} skippy.)
You do have to work a lil' on the function topic_edit_message($post) ...
Check if there's a editmessage; if not ... don't show the $lang->reason_edit ...
Okay i have been doing a bit of fixing and adding but the one thing i can not get to work is $lang->reason_edit = $lang->sprintf($lang->reason_edit, $post['editmessage']);

is just shows Reason: {1} or Reason:

its like $post is not getting added or used some how.
Hmz; can you attach your pluginfile ?
okay sure
- Where did you add that language variable ( reason_edit ) ?
- Did you create a new language file for one sentence ? =/
- How do you add the editmessage ? I don't see a box; or anything where you can enter a reason when you edit a post;
Pages: 1 2