[Request] Search threads started by

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
cacc
Registered User
Posts: 20
Joined: Sat Nov 11, 2006 5:13 pm
Location: Toronto, Ontario
Contact:

[Request] Search threads started by

Post by cacc »

This is a vbulletin feature that I had in PHPBB2, but I have not seen anyone make for PHPBB3 yet. I don't know enough about programming php to be able to accomplish this, but if anyone out there can it would be much appreciated.

Basically, in the user profile, a link right below "Search user’s posts" that would show all the threads that were started by that user. Using the "Advanced Search" function it is possible to type the author's name and then choose "First post of topics only" to get these results. I was wondering if in the new system it was possible to make a count and quick button in the profile to do this.
cacc
Registered User
Posts: 20
Joined: Sat Nov 11, 2006 5:13 pm
Location: Toronto, Ontario
Contact:

Re: [Request] Search threads started by

Post by cacc »

With some help from the guys over at http://lithiumstudios.org I have this part figured out so far. I have included the code changes below just for those who are looking for something similar. Now I have another question that might be a little bit more intensive and seems to require some editing of the database itself...

What I want to do is also be able to have the number of posts started by the way that there is the number of posts. From what I have found so far, in memberlist.php, there is an SQL query bringing in user_posts on line 159 (the line numbers might be off from your because I do have some mods in place). This is a running count of the number of posts a person has made. To bring in the number of posts started by a user, there seems to not be an easy way to do it, and I am guessing that a lot more files will need to be edited because it would have to automatically update the database every time someone starts a new thread. If this is easy or you know how to do this off the top of your head, please let me know. If it is harder that easy, don't worry about it.

Now onto my code changes. So far I have just added it to the profile view of a user...

Open /memberlist.php
Find

Code: Select all

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

Code: Select all

		'U_SEARCH_USER_FIRST'	=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=topics&sf=firstpost") : '',
Open /language/en/memberlist.php
Find

Code: Select all

	'SEARCH_USER_POSTS'		=> 'Search user’s posts',
After add

Code: Select all

	'SEARCH_USER_POSTS_FIRST'		=> 'Search threads started by user',
Open /styles/prosilver/template/memberlist_view.html
Find

Code: Select all

			<dt>{L_TOTAL_POSTS}:</dt> <dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF --></dd>
In-line find

Code: Select all

</dd>
Before add

Code: Select all

<br /><strong><a href="{U_SEARCH_USER_FIRST}">{L_SEARCH_USER_POSTS_FIRST}</a></strong>
Locked

Return to “[3.0.x] MOD Requests”