Display Full Post - Search Users Posts

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
profKroy
Registered User
Posts: 141
Joined: Sun Feb 14, 2016 2:39 pm

Display Full Post - Search Users Posts

Post by profKroy » Tue Nov 05, 2019 4:02 pm

Is there are modification (to the code perhaps) or setting in the ACP that I can make that will allow for the full display of a user's post when I click on "Search user’s posts" in their profile, instead of just seeing truncated results? That would be helpful to my workflow. Thank you.
Are you a skilled extension developer? I need an extension developed right now. Here are the general specs. Please PM me if interested.

User avatar
EA117
Registered User
Posts: 1081
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Display Full Post - Search Users Posts

Post by EA117 » Tue Nov 05, 2019 4:48 pm

There is not already a setting where you can make that the default when clicking on "Search user's posts" from their profile display. You may already realize that "show the entire post" is an option in the Advanced Search, as "Return first xxx characters" which defaults to "first 300 characters." So that option does exist, but simply isn't the default.

You could change the "Search user's posts" link in the code, or you could actually cause the same result by just editing your style's template for the User Control Panel, in order to invoke this existing "do not limit the number of characters displayed" option in the search results. Which ever way you do it, the intention is to change the URL invoked from:

https://www.phpbb.com/community/search.php?author_id=1534991&sr=posts

to:

https://www.phpbb.com/community/search.php?author_id=1534991&sr=posts&ch=-1

Meaning append the "&ch=-1" to the end of the current URL, to specify that "all available" characters should be displayed, and not just the first 300.

To change it in the style, on the page seen when invoking memberlist.php?mode=viewprofile&u=1534991, find your style's memberlist_view.html template, and where you see the line:

Code: Select all

		<dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
add the additional search parameter as a hard-coded option in the href= value specified by the template:

Code: Select all

		<dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}&ch=-1">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
You could of course do something different than that, such as leaving the existing link as-is but making an additional link after it such as a hard-coded English "(show full posts)" or similar which gives the alternative link. Whatever change you make, be sure and purge the cache from ACP in order to see the effect of the change.

Code: Select all

		<dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a> (<a href="{U_SEARCH_USER}&ch=-1">show full posts</a>)</strong><!-- ENDIF -->

profKroy
Registered User
Posts: 141
Joined: Sun Feb 14, 2016 2:39 pm

Re: Display Full Post - Search Users Posts

Post by profKroy » Thu Nov 07, 2019 6:25 am

Awesome. Thanks for this. I use the forum as a teaching tool, so it's helpful to see full posts in order to evaluate the posts my students have authored.
Are you a skilled extension developer? I need an extension developed right now. Here are the general specs. Please PM me if interested.

Post Reply

Return to “phpBB Custom Coding”