Search for your particular post in a topic

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)
Anti-Spam Guide
Locked
User avatar
Surreal09
Registered User
Posts: 52
Joined: Mon Mar 02, 2009 9:44 pm

Search for your particular post in a topic

Post by Surreal09 » Mon Jul 05, 2010 10:03 pm

I can see when you go to: http://www.phpbb.com/community/search.p ... =egosearch you are able to view all the topics you have posted in. But there is no way for you to jump to your post directly from that search page.

My suggestion is make it so you can go directly to your post which would be great as there are some topics that have over 400+ replies and I don't have time to go through every page just to find my post and the next few replies.

Would this be hard to do?

Skinny Vinny
Registered User
Posts: 230
Joined: Tue Dec 01, 2009 7:10 pm

Re: Search for your particular post in a topic

Post by Skinny Vinny » Tue Jul 06, 2010 3:23 pm

You mean, something like the links that already exists for every user on their profiles? For example, yours is http://www.phpbb.com/community/search.p ... 5&sr=posts

You could esaily add a 'My Posts' type of link targeting the search script.
Simply insert the user id into the url.

If you mean to have shortcuts on the viewtopic page to jump to their posts on that topic, that would require a mod. So yes, it's possible.

User avatar
Surreal09
Registered User
Posts: 52
Joined: Mon Mar 02, 2009 9:44 pm

Re: Search for your particular post in a topic

Post by Surreal09 » Tue Jul 06, 2010 8:02 pm

Skinny Vinny wrote:You mean, something like the links that already exists for every user on their profiles? For example, yours is http://www.phpbb.com/community/search.p ... 5&sr=posts

You could esaily add a 'My Posts' type of link targeting the search script.
Simply insert the user id into the url.

If you mean to have shortcuts on the viewtopic page to jump to their posts on that topic, that would require a mod. So yes, it's possible.
Yeah I was wondering if one could be made for the viewtopic page, instead of just going to the first or last post.

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: Search for your particular post in a topic

Post by 4_seven » Tue Jul 06, 2010 8:11 pm

But there is no way for you to jump to your post directly from that search page.
as Skinny Vinny means? pls. be more precise.
Current Mods | Mod Base | php(BB) programming | No help via PM

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: Search for your particular post in a topic

Post by 4_seven » Tue Jul 06, 2010 8:16 pm

take a look of this:
http://www.phpbb.com/community/viewtopi ... #p12805655
may this is what u want..
Current Mods | Mod Base | php(BB) programming | No help via PM

Skinny Vinny
Registered User
Posts: 230
Joined: Tue Dec 01, 2009 7:10 pm

Re: Search for your particular post in a topic

Post by Skinny Vinny » Tue Jul 06, 2010 10:55 pm

Actually, I just manually added a topic id to check if that functionality already exists in phpBB..... and it does. I suspected that it might, but had never seen it used. You'd think it would be common.

Check it here: http://www.phpbb.com/community/search.p ... &t=2096676

I don't have time to do it right this second (leaving for the night), but it would be very easy to add a link to the viewtopic body template file, just insert the user id and topic id into the url. Not even a mod, it's just adding a link to the template.

I do not recommend having the results prefetched and incorporated to the output on viewtopic, but that could be done too. Again, I don't recommend doing it that way. If you must, dear lord cache it.

This would be handy for many on large multi page topics.
I'll be incorporating it into my template work.
Glad you requested it :)


The 'skip to my last post' mod of 4 seven is a great idea, too.

Skinny Vinny
Registered User
Posts: 230
Joined: Tue Dec 01, 2009 7:10 pm

Re: Search for your particular post in a topic

Post by Skinny Vinny » Wed Jul 07, 2010 9:22 pm

Not as simple as adding a line to the template, but I made it so it's pretty close. The user id of the viewer isn't available to the template. That's a shame, because it could be used so many ways. So I pair the additional line to the template with a simple hook that adds {SVMODS_USER_ID} to the values available to the template.

I also have the function in the hook add a {L_SEARCH_SELF_TOPIC} value (default text is set in the function, you can edit it). Ideally you would want to add SEARCH_SELF_TOPIC to each of your available language files. If you only use english, and 'Find your posts in this topic' is sufficient... you don't need to change anything.

In the viewtopic_body.html template file, find

Code: Select all

	<!-- IF PAGINATION or TOTAL_POSTS -->
		<div class="pagination">
Afterwards, add

Code: Select all

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN --><a href="{S_SEARCHBOX_ACTION}&author_id={SVMODS_USER_ID}">{L_SEARCH_SELF_TOPIC}</a> &bull;  <!-- ENDIF -->
Download the hook file at:
http://svmods.com/download/hook_svmods_ ... mplate.zip
Unzip and upload the file to your includes/hooks directory, and purge the cache from the admin screens index. That should do it. Link will be right side above topic with pagination.

Locked

Return to “[3.0.x] MOD Requests”