MyBB Community Forums

Full Version: edited by the moderators team
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
how can i make instead of edited by tsakalos when i edit posts to have something like edited by the moderators team no matter which moderator has done the edit ?
Heloo there

In Admin CP> Templates > Modify / Delete > Expand > Postbit tempaltes > postbit_editedby

replace the code by this

<p align="right"><span class="smalltext">$post[editnote] the moderation Team.</span></p>


regards

zaher1988, that modification would affect all edits, not just moderator edits.

Maybe you could do a simple mod like this in the makepostbit() function...
PHP Code:
<?php 
if($post['edituid'] != $post['uid']) {
����eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby_mod")."\";");
} else {
����eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");
}
(If the user who edited the post is not the user who created the post, it must have been a moderator, so display a new custom template (like the one zaher1988 posted) instead of the default one)
owshhhhhhh Confused !! hehe i didn't thought of the other edites Confused !!

sorry
can u be more specific ? make it more clear
I don't have a test board set up at the moment, so I can't give you very specific instructions, but I'll try. If you have any specific questions, just ask. Smile

First create a new template called "postbit_editedby_mod" containing the HTML that zaher1988 posted. Then modify the makepostbit() function in "inc/functions_post.php".

Find... (around line 622 in the latest release)
eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");
Replace with... the code that I posted earlier.
heloo there

i'm just to draw some attention !! umm i think WDZ is using the old php codeSmile
but i have tried it , and the new code is like

in inc/functions_post.php

find this code

if($post['edituid'] != "" && $post['edittime'] != "" && $post['editusername'] != "")
		{
			$post['editdate'] = mydate($mybb->settings['dateformat'], $post['edittime']);
			$post['edittime'] = mydate($mybb->settings['timeformat'], $post['edittime']);
			$post['editnote'] = sprintf($lang->postbit_edited, $post['editdate'], $post['edittime']);
			eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");
		} 

this is the code he's talking about

however i followed his steps, but it show the normal user name instead

regards
[Image: msn_dunno.gif]

The code I posted was copied directly from functions_post.php in mybb_1_01.zip, so it's not "old." Also, it's the only thing you should replace. Just that one line.
Sorry, i'm sorry u know what happend

i thought u meant this
PHP Code:
<?php 
if($post['edituid'] != $post['uid']) {
as this

PHP Code:
<?php 
if($post['edituid'] != "" && $post['edittime'] != "" && $post['editusername'] != "")

but no, as i read the posts again, i found it!! , replace the old EVAL by the whole code u have provided.Smile

i'm gonna test it now

---------------------------------

Edit

Ok look up guys

one thing should be edited in WDZ code

the replacing code should be
PHP Code:
<?php 
if($post['edituid'] != $post['editusername']) {
���� eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby_mod")."\";");
} else {
���� eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");
}

not
PHP Code:
<?php 
if($post['edituid'] != $post['uid']) {
eval(
"\$post['editedmsg'] = \"".$templates->get("postbit_editedby_mod")."\";");
} else {
���� eval("\$post['editedmsg'] = \"".$templates->get("postbit_editedby")."\";");
}

if u see the $post['uid'] should be $post['editusername']

and dont miss to add the new template by going to Admin CP > Templates > Modify / Delete > expand

at the top , u will find Add template name it as wdz said , postbit_editedby_mod

and put my provided code!!

one more point !! make sure not to miss have 2 } at the end of the script ur adding, coz u might miss that.

and now that;s working and tested Smile

regards
zaher1988 Wrote:
if($post['edituid'] != $post['editusername']) {
Huh? Sorry, but that doesn't make any sense to me.

edituid is a User ID number
editusername is a User Name

Obviously they're never going to be equal. If I'm wrong about this, then please explain why...
Pages: 1 2 3