Adding the message content of the unapproved post to each row in MCP front page

Discussion forum for MOD Writers regarding MOD Development.
Locked
techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

Adding the message content of the unapproved post to each row in MCP front page

Post by techman41973 » Fri Dec 12, 2014 12:18 pm

On the MCP front page (mcp_front.html), it shows a list of unapproved posts with topic title, date of post and forum name.
I'd like to add the actual message inside the row box of each unapproved post to make it easier to decide if I want to approve or dissaprove.
I'm not sure how to modify mcp.php to extract this info from the database and send it to template mcp_front.html
I would appreciate some guidance.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51865
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Adding the message content of the unapproved post to each row in MCP front page

Post by Brf » Fri Dec 12, 2014 2:29 pm

If you click on a topic title there, it will take you to the post content.
It would stretch out that page pretty bad if it showed the content of every post, especially the long-winded spams we sometimes see.

techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

Re: Adding the message content of the unapproved post to each row in MCP front page

Post by techman41973 » Fri Dec 12, 2014 11:24 pm

Brf, understood. But I will be at a conference where I need to approve lots of posts from my mobile phone in minimal time, way too much clicking. I'd rather scroll through a few long winded posts if they pop up.
The front page allows me to simply click a check box to approve and disaprove.

Is there any way to what i'd like to do? Where i can include the message text in each row in the MCP front page.
I tried adding unapproved.message in mcp_front.html but this is was an undefined template variable.
Thanks

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51865
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Adding the message content of the unapproved post to each row in MCP front page

Post by Brf » Fri Dec 12, 2014 11:48 pm

You would need to add your own custom variable into includes/mcp/mcp_queue.php . See how the variable for the title is added.

techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

Re: Adding the message content of the unapproved post to each row in MCP front page

Post by techman41973 » Sun Dec 14, 2014 10:41 am

Thanks for the tip. Got it to work!

updated includes/mcp_front.php


added

Code: Select all

$message = $row['post_text'];
after

Code: Select all

 'SUBJECT'		=> ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
added

Code: Select all

 'MESSAGE'		=> $message,
added to SQL statement just above

Code: Select all

 p.post_text, 
updated template/mcp_front.html
added

Code: Select all

  <br />{unapproved.MESSAGE}
one last unresolved issue.
would like to strip bbcode, smileys

tried adding, but this didn't work.

Code: Select all


if ($row['bbcode_bitfield'])
{
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
$bbcode = new bbcode($row['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);}

$message = bbcode_nl2br($message);
$message = smiley_text($message);


Locked

Return to “[3.0.x] MOD Writers Discussion”