MCP Snippet: Search user posts in user notes

Support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

MCP Snippet: Search user posts in user notes

Postby RMcGirr83 » 22 Mar 2010, 18:58

The following snippet will allow a moderator to view a users posts when they are viewing a users notes within the MCP.

Currently the users post count will display with no link being presented to view that users posts (eg, see pic).

Untitled.png


So let's make it a link

OPEN

includes/mcp/mcp_notes.php

Find This may be a partial find and not the whole line

Code: Select all

'POSTS'            => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,


Add before Add these lines on a new blank line before the preceding line(s) to find

Code: Select all

         'U_SEARCH_POSTS'   => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '',   



OPEN

styles/xxx/template/mcp_notes_user.html

Find This may be a partial find and not the whole line

Code: Select all

{POSTS}


Replace with Replace the preceding lines with the following

Code: Select all

<!-- IF U_SEARCH_POSTS --><a href="{U_SEARCH_POSTS}">{POSTS}</a><!-- ELSE -->{POSTS}<!-- ENDIF -->


and that's it. The post count will now be a link to the users posts displayed via search.
You do not have the required permissions to view the files attached to this post.

DoYouSpeakWak
New member
New member
Posts: 37
Joined: 14 Oct 2010, 09:40

Re: MCP Snippet

Postby DoYouSpeakWak » 22 Mar 2010, 19:05

Nice one, good idea and thanks

juango
New member
New member
Posts: 9
Joined: 03 Jul 2012, 02:27

Re: MCP Snippet: Search user posts in user notes

Postby juango » 17 Jul 2012, 14:03

very cool snippet, thanks!


Return to “Modders MOD support”

Who is online

Users browsing this forum: Ahrefs [Bot], CommonCrawl [Bot] and 0 guests