Change Topic Title Link to redirect to search that title

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)
Scam Warning
Locked
User avatar
Tarantino
Registered User
Posts: 608
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Change Topic Title Link to redirect to search that title

Post by Tarantino » Wed May 27, 2015 4:44 pm

Hi there,

on phpBB3 by default on viewtopic the Topic Title Link redirects to the topic itself, and for me it doesn't makes sense and its useless. So what I wanted to acheive is to change that link, to another.
I want to redirect not for itself but for a search, where it will search his own title.

Example: http://i.imgur.com/4uzMslL.png
If I clicked on that URL, it would search by "Preventing Spam in phpBB3", like this:

Code: Select all

https://www.phpbb.com/community/search.php?keywords=Preventing+Spam+in+phpBB3&terms=all&author=&sc=1&sf=titleonly&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search 
How can I do that?

Best Regards
Last edited by Oyabun1 on Wed May 27, 2015 9:06 pm, edited 1 time in total.
Reason: Moved from 3.0.x Support forum

User avatar
AmigoJack
Registered User
Posts: 5105
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by AmigoJack » Thu May 28, 2015 7:07 am

Tarantino wrote:its useless
No. Topics are displayed by either requesting a post (viewtopic.php?p=14090301) or by requesting a topic (viewtopic.php?f=72&t=2318381). In the first case I still don't know the topic ID. And both things are entities: posts can be moved (hence reside in another topic), whereas topics are literally just that.
Tarantino wrote:

Code: Select all

keywords=Preventing+Spam+in+phpBB3
Are you aware that you are just searching for keywords and not for the entire topic title as phrase? Based on the used search engine titles like "hey" will most likely result in no search results at all, since too common words are excluded.

Also I don't understand what you wanted to illustrate with your picture.
The worst thing about censorship is ███████████

User avatar
Tarantino
Registered User
Posts: 608
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by Tarantino » Fri May 29, 2015 12:16 am

I was talking on viewtopic. Not on viewforum. Just to be clear.
And I know that the link to a Topic can be by requesting a post or topic. That is not the question here.

My image above is from a topic of this phpBB forum: viewtopic.php?f=46&t=2122696

Imagine that you click on that page on "Preventing Spam in phpBB3" title (where I've the red dot on the image)
You can see that the link is "viewtopic.php?f=46&t=2122696#p12961708"

But I want that link to be search.php?keywords=Preventing+Spam+in+ ... mit=Search

With that, if I clicked I would be redirect to a search result of that title. (The same as going to search.php and serach by the title: http://i.imgur.com/w791OEJ.png)

I hope to be more clear on what I was asking now.

Best Regards

User avatar
Lumpy Burgertushie
Registered User
Posts: 63647
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by Lumpy Burgertushie » Fri May 29, 2015 1:35 am

my question is , what is the point of that? if you do a search for that exact title you would just wind up where you started.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

User avatar
AmigoJack
Registered User
Posts: 5105
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by AmigoJack » Fri May 29, 2015 5:50 am

Tarantino wrote:Not on viewforum
Did never mention or associate that.
Tarantino wrote:(where I've the red dot on the image)
There are two dots. The upper one is the topic title, which links to the topic in whole, the lower one is the post subject, which links to the post.
Tarantino wrote:the link is "https://www.phpbb.com/community/viewtopic.php?f=46&t=2122696#p12961708"
Neither topic title nor post subject have this URI - you might want to check that yourself in this very topic.
Tarantino wrote:I want that link to be
author=&sc=1 ch=300 submit=Search
Those parameters aren't needed - why do you want them?
The worst thing about censorship is ███████████

User avatar
Tarantino
Registered User
Posts: 608
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by Tarantino » Fri May 29, 2015 2:08 pm

There are two dots. The upper one is the topic title, which links to the topic in whole, the lower one is the post subject, which links to the post.
I know, you can choose one of them, for me its equal. I would adapt the solution and apply to "Topic Description MOD". Where I've a topic description and it will search by that description. It's the same logic.

I just want to know how to create that URL for the search...
Neither topic title nor post subject have this URI - you might want to check that yourself in this very topic.
I've just copy past... http://i.imgur.com/jCqWjlg.png
Those parameters aren't needed - why do you want them?
I've no idea if it's necessary, I've copy past the URL after the manual search...

User avatar
AmigoJack
Registered User
Posts: 5105
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by AmigoJack » Mon Jun 01, 2015 6:40 am

Tarantino wrote:for me its equal
As you wish. However, my code will only affect the topic title, not the first displayed post's subject: open /viewtopic.php and find:

Code: Select all

    'U_VIEW_TOPIC'             => $viewtopic_url,
Change to:

Code: Select all

    /*** 2015-06-01 BEGIN AmigoJack
        https://www.phpbb.com/community/viewtopic.php?f=72&t=2318381 ***/
    /*'U_VIEW_TOPIC'             => $viewtopic_url,*/
    'U_VIEW_TOPIC'=> append_sid( "{$phpbb_root_path}search.$phpEx", "terms=all&sr=topics&sf=titleonly&sk=t&sd=d&st=0&keywords=". urlencode( $topic_data['topic_title'] ) ),
    /*** 2015-06-01 END ***/
Tested.
Tarantino wrote:I would adapt the solution and apply to "Topic Description MOD".
Good luck with that one, as the MOD doesn't tweak the board search in the first place.
The worst thing about censorship is ███████████

User avatar
Tarantino
Registered User
Posts: 608
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Change Topic Title Link to redirect to search that title

Post by Tarantino » Mon Jun 01, 2015 1:34 pm

Thank you! It solved my problem!

I create a similar one:

Code: Select all

'U_VIEW_TDESC' 			=> append_sid( "{$phpbb_root_path}search.$phpEx", "terms=all&sr=topics&sf=titleonly&sk=t&sd=d&st=0&keywords=". urlencode( $topic_data['topic_desc'] ) ),
and then on html:

Code: Select all

<!-- IF TOPIC_DESC --><p><a href="{U_VIEW_TDESC}">{TOPIC_DESC}</a></p><!-- ENDIF -->
It's working like a charm.

And I've already fixed the search of that MOD :) Some user has solved that for me.

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 27 guests