Page 1 of 1
Search Results Layout coordination
Posted: Fri Sep 08, 2006 9:36 pm
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?
Re: Search Results Layout coordination
Posted: Sat Sep 09, 2006 12:33 am
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
Posted: Sat Sep 09, 2006 4:42 am
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.
Posted: Sat Sep 09, 2006 1:25 pm
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
Posted: Sat Sep 09, 2006 4:26 pm
by bdconnolly
Grazie.
BC
Posted: Sat Sep 09, 2006 4:49 pm
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.
Posted: Sat Sep 09, 2006 7:02 pm
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
Posted: Sun Sep 10, 2006 12:41 am
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>'),
Posted: Mon Sep 11, 2006 4:57 pm
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.