Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search plugin (I18N)
mvlcek Wrote:
Code:
<?php if (@$_REQUEST['words']) { ?>
You searched for the term(s) '<?php echo htmlspecialchars($_REQUEST['words']); ?>'
<?php } ?>
Thanks a bunch, works like a mvlcek plugin. ;-)

mvlcek Wrote:If you need in in the content of a page, you can use the DynPages plugin to include this code in a component.
Wouldn't go anywhere without that plugin anyway.
Reply
mvlcek Wrote:
polyfragmented Wrote:Is there a direct URL for the search in which I can include search terms?

As you can see by looking at the search form, it is: http://my.site/search-result-page?words=searchtems
Even with Fancy URLs on I should've made the connection. Ouch. Thanks.
Reply
I18N Search version 1.3:
  • does not index private pages
  • allows you to show links without language parameter, even if you use the I18N plugin: (% searchresults i18n:0 %) - do not use underscores in your slug names.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
anyone knows how use an image as a submit button with I18N Search plugin?
Reply
lulo Wrote:anyone knows how use an image as a submit button with I18N Search plugin?

Don't use (% searchform %), but create the form manually (in the page or on the template):
Code:
<form action="http://my.site/my-search-result-page/" method="POST" class="search">
  <input type="text" name="words" value=""/>
  <input type="image" src="my-submit-image.gif" name="search">
</form>
The only important points are that you change the action to the url of your search result page - the page with (% searchresults %) - and that the search terms are entered in a field named words.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi everybody, hi mvlcek too,
Search plugin is in my opinion needed when a site is more than 30+-pages.
But! If someone is adding news, or something similar, in a different place such as "News", or in custom fields, search plugin have to be able to search such places. Pixelstudio one page template made a great work. They made instead of custom fields another pages.
GS is the greatest CMS I've ever seen (and beleve me I have tested more then 100 of them), but with little improvemet iti will be invinsible. This is the ability to search through the news, and the custom fields.
But to beat WP and Joomla is more then a good thing, it's a proof, that there is someone who really thinks free.
At last I'll say, to mvlcek - you' re doing a very great job.
P.S. As usual I am drunk and I can't say exactly what I want to say.
Reply
ragou Wrote:Hi everybody, hi mvlcek too,
Search plugin is in my opinion needed when a site is more than 30+-pages.
But! If someone is adding news, or something similar, in a different place such as "News", or in custom fields, search plugin have to be able to search such places.
...
GS is the greatest CMS I've ever seen (and beleve me I have tested more then 100 of them), but with little improvemet iti will be invinsible. This is the ability to search through the news, and the custom fields.

In my opinion every content - and this includes news and blogs - should be saved as page. Then the standard mechanisms for plugins like embedding google maps or image galleries - or indexing for search - will work, regardless of the type of content.

As regards searching custom fields: I'm working on it.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I find the tag list feature very useful. Especially when normal user can maintain it pretty easy.
But I have a question. Tags are printed as normal text, and supposing I'd want to display every tag as a link to search result, where page containing such tags, and words in content would be listed, how could I achieve it ?

I suppose I'd have to link to page with search results and use tags from the list as params.


edit: a sidequestion
get_i18n_tags(), and return_i18n_tags() show all tags. Is there a way to disable listing tags defined for currently visited page ?
Addons: getsimple theme, Online Visitors, Notepad
Reply
yojoe Wrote:I find the tag list feature very useful. Especially when normal user can maintain it pretty easy.
But I have a question. Tags are printed as normal text, and supposing I'd want to display every tag as a link to search result, where page containing such tags, and words in content would be listed, how could I achieve it ?

I suppose I'd have to link to page with search results and use tags from the list as params.

yes, look at i18n_search/tags.php and output an <a href="/my-search-result-page?tags=the-tag" ...> instead of the <span ...>.

yojoe Wrote:edit: a sidequestion
get_i18n_tags(), and return_i18n_tags() show all tags. Is there a way to disable listing tags defined for currently visited page ?

There is no function to do this - why do you want to do this?
But you can do it like this:
Code:
$slug = return_page_slug();
$tags = return_i18n_tags();
$filtered_tags = array();
foreach ($tags as $tag => $urls) {
  if (!in_array($slug, $urls)) $filtered_tags[$tag] = $urls;
}
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
is there a way to get to show news by date?
http://chaga-mushroom.com/itineraries?setlang=ru
Code:
(% searchresults DATE_FORMAT:"%d.%m.%Y" tags:blog max:5 showLanguage:0 lang:ru order:reverseurl numWords:40 HEADER="" %)
Reply
Oleg06 Wrote:is there a way to get to show news by date?
http://chaga-mushroom.com/itineraries?setlang=ru
Code:
(% searchresults DATE_FORMAT:"%d.%m.%Y" tags:blog max:5 showLanguage:0 lang:ru order:reverseurl numWords:40 HEADER="" %)

Order by date: yes, use order:date (default) or order:created (if set by I18N Custom Fields plugin)
Show only news for a specific date: no.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
yojoe Wrote:I find the tag list feature very useful. Especially when normal user can maintain it pretty easy.
But I have a question. Tags are printed as normal text, and supposing I'd want to display every tag as a link to search result, where page containing such tags, and words in content would be listed, how could I achieve it ?

I suppose I'd have to link to page with search results and use tags from the list as params.

yes, look at i18n_search/tags.php and output an <a href="/my-search-result-page?tags=the-tag" ...> instead of the <span ...>.

yojoe Wrote:edit: a sidequestion
get_i18n_tags(), and return_i18n_tags() show all tags. Is there a way to disable listing tags defined for currently visited page ?

There is no function to do this - why do you want to do this?
But you can do it like this:
...

You're the man!

Tag cloud with links to search result is generated nicely.
But results aren't working flawlessly.
Reason: tags consisting of two or more words separated with space
e.g.: /serp?tags=phrase1 phrase2
are being parsed as: /serp?tags=phrase1%20phrase2
thus it leads to show no results
Urls with encoded (or special) chars are always a pain when it goes to processing them.
Do you think that adding a function which could switch "%20" to " " before initializing search function would solve this problem ?

Other minor question I have is about search result links.
They always contain ?lang=en|de|es|etc at the end.
Is there an additional argument for (% searchresults %) disabling the trailing ?lang= for links on serp ?
Something similar to showLanguage:0 - meant to disable showing page's language in serp.
Addons: getsimple theme, Online Visitors, Notepad
Reply
yojoe Wrote:Tag cloud with links to search result is generated nicely.
But results aren't working flawlessly.
Reason: tags consisting of two or more words separated with space
e.g.: /serp?tags=phrase1 phrase2
are being parsed as: /serp?tags=phrase1%20phrase2
thus it leads to show no results

It works for me, when entering it in the address bar and using these links:
http://mvlcek.bplaced.net/search/?tags=g...ion%20menu
http://mvlcek.bplaced.net/search/?tags=g...ation+menu

yojoe Wrote:Other minor question I have is about search result links.
They always contain ?lang=en|de|es|etc at the end.

It's i18n:0. But you should only use it if you have just one language and don't have slugs with underscore. Or you can remove the I18N plugin.
(I see that I haven't documented it in the search settings, only here)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
ohhh...day by day I find another flaw in hosting based on windows OS.
Under LAMP server search is working perfectly. I have to drop development under windows and use a VM with linux instead.
mucho gracias for a hint with i18n:0 also. Had to overlook this tip while browsing this thread.

btw. I have a feeling that somebody asked if i18n search works with newsmanager.
But after all adventures I migh have phantoms.
Addons: getsimple theme, Online Visitors, Notepad
Reply
I accidentally managed to bring in a short news, images of the full news.
Of course, not very good, but it works. Smile
slightly modified the plugin pages-excerpts.php
http://chaga-mushroom.com/0/news
why do not work with tags with spaces
http://chaga-mushroom.com/0/tager?tags=c...t%20system
Reply
Oleg06 Wrote:why do not work with tags with spaces
http://chaga-mushroom.com/0/tager?tags=c...t%20system

The plugin handles these as separat tags. Use _ instead of spaces in the URL:
http://chaga-mushroom.com/0/tager?tags=c...ent_system
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I wrote in the tags
Code:
getsimple, easy, content_management_system
and still does not work
Code:
?tags=content management system
Reply
Oleg06 Wrote:I wrote in the tags
Code:
getsimple, easy, content_management_system
and still does not work
Code:
?tags=content management system

Use spaces to separate tags:
http://chaga-mushroom.com/0/tager?tags=g...ent_system
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I put in the sidebar
Code:
<?php get_i18n_tags() ?>
Try clicking on the tag

http://chaga-mushroom.com/0/
Reply
what is this code in the links?
I could not identify where it is taken
Code:
news?__utma=153339114.820497025.1308082193.1312568201.1312650494.138&__utmz=153339114.1312650494.138.109.utmcsr%3Dgoogle|utmccn%3D(organic)|utmcmd%3Dorganic|utmctr%3Dchampignon+chaga&__cfduid=df174afd77aa454bfcadeb948f00205321312368739&GS_ADMIN_USERNAME=admin&e0c995ea252ec0af6b4de5e08b47309c89723641=7141e05523c940737f3fec7069ff4cfd6944bfbc&page=1
http://chaga-mushroom.com/0/news?__utma=...fbc&page=1
Reply
Oleg06 Wrote:what is this code in the links?
I could not identify where it is taken
Code:
news?__utma=153339114.820497025.1308082193.1312568201.1312650494.138&__utmz=153339114.1312650494.138.109.utmcsr%3Dgoogle|utmccn%3D(organic)|utmcmd%3Dorganic|utmctr%3Dchampignon+chaga&__cfduid=df174afd77aa454bfcadeb948f00205321312368739&GS_ADMIN_USERNAME=admin&e0c995ea252ec0af6b4de5e08b47309c89723641=7141e05523c940737f3fec7069ff4cfd6944bfbc&page=1

All but the last parameter (page) look like cookies (__utm* = Google Analytics, GS_ADMIN_USERNAME = GetSimple), but why they are in the URL I can't tell.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
in searchresults.php for some reason you do next and last links similar
Code:
if (@$i18n['NEXT_TEXT'] && $pageNum < $numpages-1) {
        $pagingHtml .= ' <span class="next"><a href="'.$pageUrl.($pageNum+2).'" title="'.htmlspecialchars(@$i18n['NEXT_TITLE']).'">&nbsp;'.htmlspecialchars(@$i18n['NEXT_TEXT']).'</a></span>';
      }
      if (@$i18n['LAST_TEXT'] && $pageNum < $numpages-1) {
        $pagingHtml .= ' <span class="next"><a href="'.$pageUrl.($pageNum+2).'" title="'.htmlspecialchars(@$i18n['LAST_TITLE']).'">&nbsp;'.htmlspecialchars(@$i18n['LAST_TEXT']).'</a></span>';
      }
Google's translation
Reply
mvlcek you here?
Reply
Just replace ($pageNum+2) by ($numpages) in the second block:
Code:
if (@$i18n['LAST_TEXT'] && $pageNum < $numpages-1) {
        $pagingHtml .= ' <span class="next"><a href="'.$pageUrl.($numpages).'" title="'.htmlspecialchars(@$i18n['LAST_TITLE']).'">&nbsp;'.htmlspecialchars(@$i18n['LAST_TEXT']).'</a></span>';
      }
I'm currently rewriting some parts of the search plugin and won't release a fix before I'm finished.

The new version will:
  • be able to index custom fields' contents
  • allow other plugins to index their own content
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Thanks for your help, your plugins are just super
Reply




Users browsing this thread: 2 Guest(s)
Free HDTV Channels Residential Solar Panels