Jump to content

View new content as posts


StefanV

Recommended Posts

Posted

In 3.2.3 I was able to set minimum search word length to 0 and then access an URL like

http://forum.vamist.ro/index.php?app=core&module=search&do=search&andor_type=and&search_content=both&search_term=&search_app=forums&search_app_filters[forums][noPreview]=0

to have all posts in reverse chronological order. This page has become the most popular page in my community because it offers an easy way to see what's happening on the forum (much more useful than the default "view new content" function that only shows content grouped by thread). In 3.3.3 I can't have minimum search term smaller than 4 chars and I can't use that URL anymore. So I'm looking for another solution. Ideally, this would be an option in IPB itself and not a modification, but I doubt that IPS will include this in core if I'm the only one who's asking for it. So I'm asking here to see if there are other people who find this feature useful. And maybe we can also find an workaround for 3.3.3. The suport team had pointed out that commenting some code in /admin/sources/classes/search/engines/sql.php may allow the old URL to work again. But I've done that and it still doesn't work (I think that the check for empty keywords is in another method). And they can't help me further with this kind of modifications using the support system. The code is



/* remove < min char words */

		if ( substr_count( $search_term, '"' ) != 2 )

		{

			$_words		= explode( ' ', $search_term );

			$search_term = '';


			foreach( $_words as $_w )

			{

				if ( IPSText::mbstrlen( $_w ) >= $this->settings['min_search_word'] )

				{

					$search_term .= $_w . ' ';

				}

				else

				{

					$removedTerms[] = $_w;

				}

			}

		}


Posted

Although the support team is pointing me to /admin/sources/classes/search/engines/sql.php, I think that the behaviour is actually in /admin/applications/core/modules_public/search/search.php, but I'm not sure yet

Posted

I actually put this one as a bug..

http://community.invisionpower.com/tracker/issue-37857-cant-search-for-nothing-anymore/

Posted

@Dmacleo, it's not the same thing. Go to advanced search, enter some keywords, select 'display results as posts' and then click search to see how the result should be displayed. In 3.2.3 you could just leave the search field empty and the search engine was returning a full list of posts, but in 3.3.3 you always get no results if you don't specify a keyword to search for. The mod you're talking abut just displays a block, isn't it? It's not very usable... The search solution is much more flexible (you can also check Shigure's bug report too see that he's using the same function in a different way).

@Shigure, unfortunately IPS considers the old behaviour to be a bug and they fixed it in this new version. The bug report will probably be closed, but I'll be very glad if I'm wrong with this one... This feature is very important for me too and I would really want to see it back.

Posted

Finally, after digging in the source code I've found the modification and reactivated empty search queries (they do make sense, @Matt)

In /admin/applications/forums/extensions/search/engines/sql.php you need to search for



/* Search in titles */

/* Removed OR !($search_tags && $this->settings['tags_enabled']) ) as it was allowing a blank search if tags disabled which makes no sense - Matt */

and bellow replace


if ( $search_term )

with


if ( $search_term || $search_term == '')




I'm very disappointed by the way my request was handled by the IPS support team....

Posted

It's that an if statment? If yes, you can try something like

if( ($search_tags && $this->settings['tags_enabled']) || $search_tags == '')

But please note that I don't know what side effects this may have.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...