Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search plugin (I18N)
Okay, I know where the problem is for me. I use the I18N plugin and have every page twice once in English and once in German. I've set the English page to private and it is correctly not found with I18N search for the English pages but the translated German page is found for the German page search.

The translated page is not accessible if I click on the search result but it is shown in the search result. So the translated page is automatically private if the original page is private (there is no setting for page access for a translated page), but the I18N search seems not to see that the translated page is also private.
Reply
Hello! Thanks Martin for your awesome plugins!
My question is: is there a way to output a scaled and cropped version of the images using the component for a custom rendering of search results, similar to how it's implemented for the display of special pages as a search result?
Reply
I'm new here for GetSimple, it looks good!

I try to put the plugin into the sidebar, to place
PHP Code:
<?php get_search_form(array('slug'=>'search''showTags'=>0)); ?>
below in the script.

After that I see nothing in my site, what do I wrong?

PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:             sidebar.inc.php
* @Package:        GetSimple
* @Action:        Innovation theme for GetSimple CMS
*
*****************************************************/
?><aside id="sidebar">

    <div class="section" id="socialmedia" >
        <h2>Connect</h2>
        <div class="icons">
            
            <!-- Social Media URLs are set within this theme's settings plugin -->
            <?php if (defined('FACEBOOK')) { ?>
                <a href="<?php echo FACEBOOK?>"><img src="<?php get_theme_url(); ?>/assets/images/facebook.png" /></a>
            <?php ?>
            <?php if (defined('TWITTER')) { ?>
                <a href="<?php echo TWITTER?>"><img src="<?php get_theme_url(); ?>/assets/images/twitter.png" /></a>
            <?php ?>
            <?php if (defined('LINKEDIN')) { ?>
                <a href="<?php echo LINKEDIN?>"><img src="<?php get_theme_url(); ?>/assets/images/linkedin.png" /></a>
            <?php ?>
            
            <img src="<?php get_theme_url(); ?>/assets/images/break.png" />
            
            <!-- addthis popup - you can add your username if you want analytics: http://www.addthis.com/help/customizing-addthis -->
            <div class="addthis_toolbox" style="display:inline;width:24px;" >
                <a href="//www.addthis.com/bookmark.php?v=250" class="addthis_button_compact"><img src="<?php get_theme_url(); ?>/assets/images/share.png" /></a><br>
                        </div>
            <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script>
        </div>
    </div>
        
    <!-- wrap each sidebar section like this -->
    <div class="section">
        <?php get_component('sidebar');    ?>
    
    
    </div>

       [b] <div>
        <?php get_search_form(array('slug'=>'search''showTags'=>0)); ?>
        </div>[/b] 
</aside>
Reply
after following tags comments Disqus create such a link
Code:
http://getsimplecms.ru/plaginy-dlya-getsimple-cms/plagin-<span class="mark">gs</span>-blog/
Reply
(2013-07-19, 18:54:19)Oleg06 Wrote: after following tags comments Disqus create such a link
Code:
http://getsimplecms.ru/plaginy-dlya-getsimple-cms/plagin-<span class="mark">gs</span>-blog/

If you have "Mark search terms" switched on, all occurences of the search word will be marked. However, this should not happen inside a tag (e.g. href) or within a JS script. Without seeing the full page HTML without and with search term marking, I don't know what the problem is.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I see now the search plugin in de sidebar.
But when I put in a search text from a page then he says not found...

Where and what I have to put a command so that he can find text from a article, text from a page?

For me is difficult to use the examples which are displayed by the search tool...
Reply
(2013-07-19, 21:19:38)theet Wrote: I see now the search plugin in de sidebar.
But when I put in a search text from a page then he says not found...

Where and what I have to put a command so that he can find text from a article, text from a page?

For me is difficult to use the examples which are displayed by the search tool...

What did you change?
Assuming you have a page search containing the content
Code:
(% searchform %)
(% searchresults %)
Does searching on it work?
What is the URL of the search result page? It should have a parameter words=....
If you search from the sidebar, you should have the same URL.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
sorry for the panic, I tried all browsers and even I can not imagine how this could turn out three times in a row one of my commentators
Reply
What did you change?
Assuming you have a page search containing the content
Code:
(% searchform %)
(% searchresults %)
Does searching on it work?
What is the URL of the search result page? It should have a parameter words=....
If you search from the sidebar, you should have the same URL.
[/quote]

Of course, I had to made a search page... I didn't realize this...
Now it works perfect... Thanks!
Reply
I've noticed that the RSS search only works with Fancy URLs enabled, is that intentional?

Problem is that the guid and link in the RSS feed are using & if Fancy URLs is not enabled. With htmlspecialchars for these fields in rss.php it works. Second problem without Fancy URL is the link that is created to get to the RSS feed gets an index.php?id= in the link and that leads to a page not found error if the link is clicked. I've seen some questions in this thread regarding the link problem.

The problem of found translated private pages for news search still remains. You can look at it here on the English page the news "TV-Browser 3.3.1 (Beta 1)" is not listed (because it's a private page) but here on the German page it is listed but if you click on it you get a page not found error (I guess because it is also private).
Reply
Well I've fixed the problem of the private search results with inserting the following code in indexer.class.php line 211:
Code:
else if(strrpos($filename,'_') === strlen($filename)-7) {
            $defaultFile = substr($filename,0,strlen($filename)-7).'.xml';
            
            if(is_file(GSDATAPAGESPATH . $defaultFile)) {
                $defaultPagedata = getXML(GSDATAPAGESPATH . $defaultFile);
                $private = (string) $defaultPagedata->private;
                if ($private == 'Y') continue;
            }
        }

But I'm not sure if it really is a problem of the I18N Search plugin or maybe a problem of the I18N plugin because the private entry in the translated xml file is empty.
Reply
I'm using "get_i18n_search_results" inside my template, can someone please tell me how to disable the language from being displayed in the URL? ie: domain.com/slug/lang=en

I've seen in the forums and the documentation that you can use i18n=0 if you're calling the search form from a page (% searchresults i18n=0 %) but I can't seem to make it work from inside a template.

[Image: screengrab.jpg]
Reply
Hi everybody!

First of all, I'd like to thank mvlcek for his excellent plugins and the rest of you for the quick and valuable responses.

Here is the question: is there a way how to output search results in random order?
I've found one thread here: http://get-simple.info/forums/showthread.php?tid=3210 but it seems that it randomize only displayed results (and I need to select three random results from the whole DB, not only to shuffle three already selected results ...)

Second mention is here: http://get-simple.info/forums/showthread...2#pid35642 but it's a bit complicated and hacky. (But I think I can use it, if there wouldn't be anything better).

Thanks
Reply
Hopefully this is a cleaner and easier to understand way of doing what I mentioned before (again, using return_i18n_search_results, since its purpose is for custom outputs)

PHP Code:
<?php
  
// total number of results
  
$total 5;
  
  
// change parameters (except $max) to ones relevant to your search)
  
$search return_i18n_search_results($tags=null$words=null$first=0$max=999$order=null$lang=null);
  
  
// apply this function as many times as you want to throughly shuffle the results
  
shuffle($search['results']);
  
  
// now limit the results to the max number
  
$search['results'] = array_slice($search['results'], 0$total);
  
  
// loop through each result and output as desired
  
foreach ($search['results'] as $result) {
    
// output
  
}
?>
Reply
Easier to read, but you should use $_varname if using inline assignments in the args, as they are still in the global scope and will overwrite any global vars. Or wrap it inside your own function.

Too bad these functions do not take arrays or objs as args.
array(
'tags' => null,
'words' => null,
...
)
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
Point taken. It's mainly like that just for the sake of readability so that people understand the purpose of each variable (usually I'd just stick the value in).

Although (just so I'm cleared up on this) - if said code were plugged into a component, those variables would only be in the local scope of the component, right?

TB: On your last point, funnily enough the get_i18n_search_results function does take its arguments like that.

TB2: Isn't it slightly non-standard to use the $_ prefix on non-superglobals like $_POST, $_GET, $_SERVER etc...? I know that it's common practice in other programming languages, but it looks slightly confusing to me having both super globals and locals with it.
Reply
Yes components are anonymous. I guess you could use any prefix, _ is a definition typically used to indicate methods in classes as private etc. so it kind of relates. Used alot in langs without private methods and php4. Plus globals are always upper case or should be.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
(2013-08-01, 01:40:22)Angryboy Wrote: Hopefully this is a cleaner and easier to understand way of doing what I mentioned before (again, using return_i18n_search_results, since its purpose is for custom outputs)

Oh yes, this one is a bit easier. I tried it and works just fine!
Thanks a lot
Reply
Hey guys,

Im using the Twitter Bootstrap theme and am trying to include the default search form given in the bootstrap documentation:

<form class="navbar-search pull-left">
<input type="text" class="search-query" placeholder="Search">
</form>

any ideas on how I can link this to the I18N search function? I dont want to use the default I18N search field..

Thanks in advance for your help Smile

Oliver
Reply
(2013-08-06, 05:55:18)goredon0 Wrote: Im using the Twitter Bootstrap theme and am trying to include the default search form given in the bootstrap documentation:

<form class="navbar-search pull-left">
<input type="text" class="search-query" placeholder="Search">
</form>

any ideas on how I can link this to the I18N search function? I dont want to use the default I18N search field..

The form's action must be the URL of a search result page (i.e. a page that has (% searchresults %) on it) and the name of the input field must be words.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-05-12, 05:15:21)mvlcek Wrote: I18N Search version 2.11:
  • Supports ordering the search result by any (custom) field, use order:+field or order:-field, where field is the element name in the page's xml file (@hameau)

E.g. order:+menuOrder will sort the results like in the menu. This works only, if all search results have the same parent page, otherwise the sorting is unpredictable.

E.g. order:+title will sort the results by title. This will probably only work correctly for english titles.

Can you add this to your "Search Result Settings" help text. I was wanting this functionality and found it in the forum, but I did look at the help text first.
Reply
(2013-08-06, 06:33:18)mvlcek Wrote:
(2013-08-06, 05:55:18)goredon0 Wrote: Im using the Twitter Bootstrap theme and am trying to include the default search form given in the bootstrap documentation:

<form class="navbar-search pull-left">
<input type="text" class="search-query" placeholder="Search">
</form>

any ideas on how I can link this to the I18N search function? I dont want to use the default I18N search field..

The form's action must be the URL of a search result page (i.e. a page that has (% searchresults %) on it) and the name of the input field must be words.

Thanks for your quick reply! Would it be possible for you to run me through the steps on how to do this? As you see Im a slight noobie.. but definitely wanting to learn more about GS CMS Smile Thanks!
Oliver
Reply
Martin! I'm always impressed with your plugins. Thanks!!! Goredon0 why not use the standard I18N search? Its seems pretty rich. You can just style it up. Smile Anyway good luck and thanks again Martin!
Reply
(2013-08-06, 08:45:59)goredon0 Wrote:
(2013-08-06, 06:33:18)mvlcek Wrote:
(2013-08-06, 05:55:18)goredon0 Wrote: Im using the Twitter Bootstrap theme and am trying to include the default search form given in the bootstrap documentation:

<form class="navbar-search pull-left">
<input type="text" class="search-query" placeholder="Search">
</form>

any ideas on how I can link this to the I18N search function? I dont want to use the default I18N search field..

The form's action must be the URL of a search result page (i.e. a page that has (% searchresults %) on it) and the name of the input field must be words.

Thanks for your quick reply! Would it be possible for you to run me through the steps on how to do this? As you see Im a slight noobie.. but definitely wanting to learn more about GS CMS Smile Thanks!
Oliver

Create a page with the content (% searchresults %) somewhere on it. Save, and get its full URL link.

Then give the form's ACTION attribute the full url of your search results page

Code:
<form class="navbar-search pull-left" action="http://domain.com/link/to/search/page">

Then give the text input's NAME attribute the value 'words:

Code:
<input type="text" class="search-query" placeholder="Search" name="words">

Then save.

You can put in a submit button after the input value too, but hitting ENTER after filling the input field will trigger the search.
Reply
Hello All,

I'm using GetSimple now for a couple of days and i'm trying to use het Search I18N plugin. Works very good.
But still have a question. I want the search field in the right top of my page instead of the sidebar. Is this possible if yes how?

Regards
Reply




Users browsing this thread: 8 Guest(s)