
The output can be modified via smarty.
Garvin: Something like this don't exist yet? If that's true, shall I add this to spartacus?
Download: http://www.onli-blogging.de/uploads/ser ... 1.1.tar.gz
I really like this, since it sets the search results page apart from the usual lists of entries, making it very clear to users that it actually is a search results page.onli wrote:Something like this don't exist yet? If that's true, shall I add this to spartacus?
I think there's also the issue that currently, this (I already tested itgarvinhicking wrote:Putting it in the core wouldn't also be too bad, but I wonder what we do with people that don't install the quicksearch plguin because they use a template where the search button is implemented?
Just my two cents, but I like that ideagarvinhicking wrote:Maybe it would be best to submit a hidden input field that tells the template view=short or view=full, so that anyone witha custom template could also emit that hidden config field...
Think that's a good idea. But it would mean that the event-plugin had to be installed - or would you really want to change genpage.inc.php for that?Maybe it would be best to submit a hidden input field that tells the template view=short or view=full, so that anyone witha custom template could also emit that hidden config field...
Code: Select all
diff -Nur serendipity-nightly/include/genpage.inc.php /var/www/include/genpage.inc.php
--- serendipity-nightly/include/genpage.inc.php 2009-05-28 10:34:52.000000000 +0200
+++ /var/www/include/genpage.inc.php 2010-03-31 23:06:23.000000000 +0200
@@ -98,7 +98,8 @@
$serendipity['smarty']->assign(
array(
'content_message' => sprintf(YOUR_SEARCH_RETURNED_BLAHBLAH, '<span class="searchterm">' . $serendipity['GET']['searchTerm'] . '</span>', '<span class="searchresults">' . serendipity_getTotalEntries() . '</span>'),
- 'searchresult_results' => true
+ 'searchresult_results' => true,
+ 'searchresult_fullentry' => $serendipity['GET']['fullentry']
)
);
Code: Select all
diff -Nur serendipity-nightly/include/plugin_internal.inc.php /var/www/include/plugin_internal.inc.php
--- serendipity-nightly/include/plugin_internal.inc.php 2010-01-13 13:28:55.000000000 +0100
+++ /var/www/include/plugin_internal.inc.php 2010-03-31 23:01:19.000000000 +0200
@@ -368,19 +368,37 @@
$propbag->add('description', SEARCH_FOR_ENTRY);
$propbag->add('stackable', false);
$propbag->add('author', 'Serendipity Team');
- $propbag->add('version', '1.0');
+ $propbag->add('version', '1.1');
+ $propbag->add('configuration', array('fullentry'));
$propbag->add('groups', array('FRONTEND_ENTRY_RELATED'));
}
+ function introspect_config_item($name, &$propbag)
+ {
+ switch($name) {
+ case 'fullentry':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', SEARCH_FULLENTRY);
+ $propbag->add('description', '');
+ $propbag->add('default', true);
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+
function generate_content(&$title)
{
global $serendipity;
$title = $this->title;
+ $fullentry = serendipity_db_bool($this->get_config('fullentry', true));
?>
<form id="searchform" action="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['indexFile']; ?>" method="get">
<div>
<input type="hidden" name="serendipity[action]" value="search" />
+ <input type="hidden" name="serendipity[fullentry]" value="<?php echo $fullentry ?>" />
<input alt="<?php echo QUICKSEARCH; ?>" type="text" id="serendipityQuickSearchTermField" name="serendipity[searchTerm]" size="13" />
<input class="quicksearch_submit" type="submit" value=">" alt="<?php echo QUICKSEARCH; ?>" name="serendipity[searchButton]" title="<?PHP echo GO; ?>" style="width: 2em;" />
</div>
Code: Select all
{if $searchresult_results and not $searchresult_fullentry}
{$entry.body|strip_tags|truncate:200}
{else}
{$entry.body}
{/if}
Great, I committed it. Do you have a proposal for the language string "SEARCH_FULLENTRY"?onli wrote:As far as I know, only for additional_plugins. Which is fine for me