Search Results Layout coordination

Discussion corner for Developers of Serendipity.
Post Reply
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Search Results Layout coordination

Post by bdconnolly »

This is more a estetic. I am looking to make three things looks like they belong together. I trying to tweak search results output.

Code: Select all

No Entries Found for Query Proctor
No entries to print

Found 0 static pages:

Search results for comments:
Can someone help me get it all to look like line 2, i.e. Found x static pages?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Search Results Layout coordination

Post by garvinhicking »

Hi!

I think all of that output can be found in the "content.tpl" template file; it involves constants from the language files as well whcih you might need to have a look at.

Some of the output is coming from the staticpage *.tpl files (plugin_staticpage_searchresults or sth like that).

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

we're close. I got them to look alike. Now I'd like them to somewhat behave alike.
No Entries Found for Query Procter

Found 1 static pages:

Search results for comments:
To read:
Found x entries for query "whatever"

Found x static pages

Found x comments that matched your query
Just need to locate where it generates the first and the third.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
Found x entries for query "whatever"
Created by s9y core in the include/genpage.inc.php file
Found x static pages
Created by the staticpage event plugin plus the plugin_staticpage_search...tpl file
Found x comments that matched your query
Created by the 'search comments' event plugin and its template file.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

Grazie.

BC
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

spoke a hair too soon.

Okay...

This: @define('YOUR_SEARCH_RETURNED_BLAHBLAH', 'Your search for %s returned %s results.');

Produces this: Your search for test returned 9 results.

How can I flip it to output: Found 9 results in your search for test.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I don't know it by heart, but the php.net docoumentation on sprintf says you can use something like $1%s and $2%s or something like that to indicate the variable output order...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

lang en line 79

Code: Select all

@define('YOUR_SEARCH_RETURNED_BLAHBLAH', 'Found %s entries that match the search criteria "%s".');
genpage.inc line 88

Code: Select all

'content_message'      => sprintf(YOUR_SEARCH_RETURNED_BLAHBLAH, '<span class="searchterm">' . serendipity_getTotalEntries() . '</span>', '<span class="searchresults">' . $serendipity['GET']['searchTerm'] . '</span>'),
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

From http://us3.php.net/manual/en/function.sprintf.php:

Code: Select all

@define('YOUR_SEARCH_RETURNED_BLAHBLAH', 'Found %2$s entries that match your search criteria "%1$s".');
Then you don't need to modify any code.
Judebert
---
Website | Wishlist | PayPal
Post Reply