Serge Markitanenko | 1 Dec 14:26
Picon

The mystery with search in SPIP

Greeting,

as we work in Ukraine for Ukraine & Russian market. Most of our websites are in cyrillic.
And there is a mystery with search result in Russian language.

Search works perfectly in private space, but totally could not found anything if we submit
the search form via public interface. Of course the search string should be typed in cyrillic.  

The search works well in 1.9.xx branch, but doen't in 2.x.x.
And the same with  SPIP 3 beta. I did bug report year or two ago.

We did own search module for public part of the site for our needs.
But what could be the source of the mystery? Is any idea or solution?

Best regards,
Serge
Fil | 1 Dec 15:23
Favicon
Gravatar

Re: The mystery with search in SPIP

Hi Serge,

I'm pretty sure it comes from this line in inc/recherche :

   $recherche = trim(translitteration($recherche));

which converts the request into ascii… most useful to remove
accentuated characters, but probably a killer for cyrillic as your
content is not in ascii

do you work with the fulltext plugin or with the "native" spip search?

On Thu, Dec 1, 2011 at 2:26 PM, Serge Markitanenko
<serge.markitanenko@...> wrote:
> Greeting,
>
> as we work in Ukraine for Ukraine & Russian market. Most of our websites are
> in cyrillic.
> And there is a mystery with search result in Russian language.
> Search works perfectly in private space, but totally could not found
> anything if we submit
> the search form via public interface. Of course the search string should be
> typed in cyrillic.
> The search works well in 1.9.xx branch, but doen't in 2.x.x.
> And the same with  SPIP 3 beta. I did bug report year or two ago.
> We did own search module for public part of the site for our needs.
> But what could be the source of the mystery? Is any idea or solution?
> Best regards,
> Serge
> _______________________________________________
> spip-en@... - http://listes.rezo.net/mailman/listinfo/spip-en
>
>

--

-- 
Fil
Picon

Re: The mystery with search in SPIP

Hello to all!
I was trying to overcome this problem.

I'm pretty sure it comes from this line in inc/recherche :

  $recherche = trim(translitteration($recherche));

which converts the request into ascii… most useful to remove
accentuated characters, but probably a killer for cyrillic as your
content is not in ascii

You are right about using translitteration. I removed this line and replaced it with:
    include_spip('inc/filtres');
    $recherche = corriger_caracteres($recherche);
    $recherche = unicode_to_utf_8(html2unicode(charset2unicode($recherche)));
In this way I wanted to fix problem with cyrillic characters.
In addition I did the same with highlighted things in next to lines:
? preg_match_all($preg, translitteration_rapide($t[$champ]), $regs, PREG_SET_ORDER)
                        : preg_match($preg, translitteration_rapide($t[$champ]))

Eventually my search engine started to work with cyrillic characters. But one problem left - it works in case sensitive manner, and I don't know how to fix that.
Any ideas?
Jonas Wagner | 13 Dec 00:16
Picon
Picon

umlauts in passwords result in blank page

Dear SPIP team,

today, I used SPIP for the first time. As a diligent user, one of the 
first things I did was to change my password. I noted that if my 
password contains an umlaut (e.g. ü, u with trema), the password is not 
changed and a blank page is displayed instead. I would expect instead 
that my password is changed, and some confirmation displayed. Non-ASCII 
characters in passwords should provide no problem, especially for an 
application that makes internationalization a priority.

A second issue is that I haven't find a way to post a proper bug report 
on your website; hence the message to the mailing list.

Best,
Jonas
denisb | 13 Dec 07:19
Favicon
Gravatar

Re: umlauts in passwords result in blank page

Le 13/12/11 00:16, Jonas Wagner a écrit :
> Non-ASCII
> characters in passwords should provide no problem, especially for an
> application that makes internationalization a priority.

all is fine for me with 'totoü' as pasword on SPIP 2.1.12

> A second issue is that I haven't find a way to post a proper bug report
> on your website; hence the message to the mailing list.

yes. not easy to find it : http://core.spip.org/account/register

kamran Mir Hazar | 25 Dec 12:13
Picon
Favicon

Article break in several pages

Hello, 
Is there any plugin to break an article in more than one page without creating several articles?
Here is an example: 
http://www.nytimes.com/2011/12/25/business/bourbons-all-american-roar.html?ref=global-home
Thanks
Kamran

Serge Markitanenko | 27 Dec 10:59
Picon

Re: Article break in several pages

Greeting,
the most simple way - break the articles by yourself using models +
writing the JQuery script.
You could contact me after 03/01/2012 and I will try to help you.

Second way - the spip site http://www.spipmedia.net have the same
article break as you wish.
You could learn their source code by yourself - just view the source of
http://www.spipmedia.net/squelettes/sommaire.html
http://www.spipmedia.net/squelettes/article.html

Best regards,
Serge Markitanenko
http://www.voltairestudio.com

2011/12/25 kamran Mir Hazar <kamran_mirhazar@...>:
> Hello,
> Is there any plugin to break an article in more than one page without
> creating several articles?
> Here is an example:
> http://www.nytimes.com/2011/12/25/business/bourbons-all-american-roar.html?ref=global-home
> Thanks
> Kamran
>
>
> _______________________________________________
> spip-en@... - http://listes.rezo.net/mailman/listinfo/spip-en
>
Gilles VINCENT | 27 Dec 12:05
Picon
Gravatar

Re: Article break in several pages

Hi,

the filter used in spipmedia reminds me this old contribution :
http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

it creates a filter that can be used like this
<BOUCLE_(ARTICLES){id_article}>
[(#TEXTE*|decouper_en_page{#ID_ARTICLE}|propre)]
</BOUCLE_>
And the next/prev uri are generated like standard article pages.

I've just tested it on SPIP 2.1.12

Here is a copy more or less translated of the filter that you must add to mes_fonctions.php :
source : http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

/*
 *   +----------------------------------+
 *    Nom du Filtre : decouper_en_page                                              
 *   +----------------------------------+
 *    Date : Vendredi 6 juin 2003
 *    Auteur :  "gpl"  : gpl-6SQNBOJVynlAfugRpC6u6w@public.gmane.org 
 *              Aurelien PIERARD : aurelien.pierard-A05WjiLMj4L1KXRcyAk9cg@public.gmane.orger-ministre.gouv.fr
 *   +-------------------------------------+
 *    Fonctions de ce filtre :
 *        Il sert a presenter un article sur plusieurs pages 
 *   +-------------------------------------+
 * 
 * Pour toute suggestion, remarque, proposition d'ajout
 * reportez-vous au forum de l'article :
 * http://www.uzine.net/spip_contrib/article.php3?id_article=62
*/


function decouper_en_page($text,$id_article) {
        $nextart = $_GET['artsuite'];
       
        if (empty($nextart)) $nextart = 0;
   
        // page split (separator : "-----")       
        $page = split('-----', $text);
        // Total pages number
        $num_pages = count($page);

        // If only one page, or at the result of a seach, return everything.
        if ($num_pages == 1 || !empty($var_recherche) || $nextart < 0 || $nextart > $num_pages) {
            // Add anchors to <h3>
            $text = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $text);
            $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $text);
            $res =count($array);
            $i =1;
            $text=$array[0];
            while($i<$res){
                $text=$text.$i.$array[$i];
                $i++;
            }
            return $text;
        }

        $p_prec = $nextart - 1;
        $p_suiv = $nextart + 1;
        $uri_art = generer_url_entite($id_article, "article");
        $uri_art .= strpos($uri_art, '?') ? '&' : '?';

        // Add anchors to <h3>
        $page[$nextart] = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $page[$nextart]);
        $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $page[$nextart]);
        $res =count($array);
        $i =1;
        $page[$nextart]=$array[0];
        while($i<$res){
            $page[$nextart]=$page[$nextart].$i.$array[$i];
            $i++;
        }
        // Pagination
        switch (TRUE) {
            case ($nextart == 0):
                $previous = "";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
            case ($nextart == ($num_pages-1)):
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "";
                break;
            default:
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
        }
   
        for ($i = 0; $i < $num_pages; $i++) {
            $j = $i;
            if ($i == $nextart) {
                $actual .= " <strong>" . ++$j . "</strong> ";
            }
            else {
                $actual .= " <a href='" . $uri_art . "artsuite=$i'>" . ++$j . "</a> ";
            }
        }

        // Here, you can customize
        $result .= $page[$nextart];
        $result .= "<div class='pagination' style='text-align:center'>pages : $previous $actual $next</div>";
        return $result;
}
// FIN du Filtre decouper_en_page





Hope it helps,


.Gilles
---

On Tue, Dec 27, 2011 at 10:59 AM, Serge Markitanenko <serge.markitanenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Greeting,
the most simple way - break the articles by yourself using models +
writing the JQuery script.
You could contact me after 03/01/2012 and I will try to help you.

Second way - the spip site http://www.spipmedia.net have the same
article break as you wish.
You could learn their source code by yourself - just view the source of
http://www.spipmedia.net/squelettes/sommaire.html
http://www.spipmedia.net/squelettes/article.html

Best regards,
Serge Markitanenko
http://www.voltairestudio.com


2011/12/25 kamran Mir Hazar <kamran_mirhazar-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>:
> Hello,
> Is there any plugin to break an article in more than one page without
> creating several articles?
> Here is an example:
> http://www.nytimes.com/2011/12/25/business/bourbons-all-american-roar.html?ref=global-home
> Thanks
> Kamran
>
>
> _______________________________________________
> spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en
>
_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en

kamran Mir Hazar | 28 Dec 05:29
Picon
Favicon

Re: Article break in several pages

Thanks,
I do not have file mes_fonctions.php in my SPIP. Shall I create it under squelettes directory? 
Kamran

From: Gilles VINCENT <gilles.vincent-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Serge Markitanenko <serge.markitanenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kamran Mir Hazar <kamran_mirhazar-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>; spip-en <spip-en-JM9gtpQu/Ho@public.gmane.org>
Sent: Tuesday, December 27, 2011 12:05 PM
Subject: Re: [Spip-en] Article break in several pages

Hi,

the filter used in spipmedia reminds me this old contribution :
http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

it creates a filter that can be used like this
<BOUCLE_(ARTICLES){id_article}>
[(#TEXTE*|decouper_en_page{#ID_ARTICLE}|propre)]
</BOUCLE_>
And the next/prev uri are generated like standard article pages.

I've just tested it on SPIP 2.1.12

Here is a copy more or less translated of the filter that you must add to mes_fonctions.php :
source : http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

/*
 *   +----------------------------------+
 *    Nom du Filtre : decouper_en_page                                              
 *   +----------------------------------+
 *    Date : Vendredi 6 juin 2003
 *    Auteur :  "gpl"  : gpl-6SQNBOJVynlAfugRpC6u6w@public.gmane.org 
 *              Aurelien PIERARD : aurelien.pierard <at> sig.premier-ministre.gouv.fr
 *   +-------------------------------------+
 *    Fonctions de ce filtre :
 *        Il sert a presenter un article sur plusieurs pages 
 *   +-------------------------------------+
 * 
 * Pour toute suggestion, remarque, proposition d'ajout
 * reportez-vous au forum de l'article :
 * http://www.uzine.net/spip_contrib/article.php3?id_article=62
*/


function decouper_en_page($text,$id_article) {
        $nextart = $_GET['artsuite'];
       
        if (empty($nextart)) $nextart = 0;
   
        // page split (separator : "-----")       
        $page = split('-----', $text);
        // Total pages number
        $num_pages = count($page);

        // If only one page, or at the result of a seach, return everything.
        if ($num_pages == 1 || !empty($var_recherche) || $nextart < 0 || $nextart > $num_pages) {
            // Add anchors to <h3>
            $text = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $text);
            $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $text);
            $res =count($array);
            $i =1;
            $text=$array[0];
            while($i<$res){
                $text=$text.$i.$array[$i];
                $i++;
            }
            return $text;
        }

        $p_prec = $nextart - 1;
        $p_suiv = $nextart + 1;
        $uri_art = generer_url_entite($id_article, "article");
        $uri_art .= strpos($uri_art, '?') ? '&' : '?';

        // Add anchors to <h3>
        $page[$nextart] = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $page[$nextart]);
        $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $page[$nextart]);
        $res =count($array);
        $i =1;
        $page[$nextart]=$array[0];
        while($i<$res){
            $page[$nextart]=$page[$nextart].$i.$array[$i];
            $i++;
        }
        // Pagination
        switch (TRUE) {
            case ($nextart == 0):
                $previous = "";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
            case ($nextart == ($num_pages-1)):
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "";
                break;
            default:
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
        }
   
        for ($i = 0; $i < $num_pages; $i++) {
            $j = $i;
            if ($i == $nextart) {
                $actual .= " <strong>" . ++$j . "</strong> ";
            }
            else {
                $actual .= " <a href='" . $uri_art . "artsuite=$i'>" . ++$j . "</a> ";
            }
        }

        // Here, you can customize
        $result .= $page[$nextart];
        $result .= "<div class='pagination' style='text-align:center'>pages : $previous $actual $next</div>";
        return $result;
}
// FIN du Filtre decouper_en_page





Hope it helps,


.Gilles
---
On Tue, Dec 27, 2011 at 10:59 AM, Serge Markitanenko <serge.markitanenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Greeting,
the most simple way - break the articles by yourself using models +
writing the JQuery script.
You could contact me after 03/01/2012 and I will try to help you.

Second way - the spip site http://www.spipmedia.net have the same
article break as you wish.
You could learn their source code by yourself - just view the source of
http://www.spipmedia.net/squelettes/sommaire.html
http://www.spipmedia.net/squelettes/article.html

Best regards,
Serge Markitanenko
http://www.voltairestudio.com


2011/12/25 kamran Mir Hazar <kamran_mirhazar-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>:
> Hello,
> Is there any plugin to break an article in more than one page without
> creating several articles?
> Here is an example:
> http://www.nytimes.com/2011/12/25/business/bourbons-all-american-roar.html?ref=global-home
> Thanks
> Kamran
>
>
> _______________________________________________
> spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en
>
_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en



Gilles VINCENT | 28 Dec 10:39
Picon
Gravatar

Re: Article break in several pages

Hi,

On Wed, Dec 28, 2011 at 5:29 AM, kamran Mir Hazar <kamran_mirhazar-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:
Thanks,
I do not have file mes_fonctions.php in my SPIP. Shall I create it under squelettes directory? 

Yes.
Under squelettes directory or at the root directory.

This is a php file, so it must at least start with "<?php " to be valid
(and eventually ends with " ?>")

.Gilles

 
Kamran

From: Gilles VINCENT <gilles.vincent-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Serge Markitanenko <serge.markitanenko <at> gmail.com>
Cc: kamran Mir Hazar <kamran_mirhazar <at> yahoo.com>; spip-en <spip-en-JM9gtpQu/Ho@public.gmane.org>
Sent: Tuesday, December 27, 2011 12:05 PM
Subject: Re: [Spip-en] Article break in several pages

Hi,

the filter used in spipmedia reminds me this old contribution :
http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

it creates a filter that can be used like this
<BOUCLE_(ARTICLES){id_article}>
[(#TEXTE*|decouper_en_page{#ID_ARTICLE}|propre)]
</BOUCLE_>
And the next/prev uri are generated like standard article pages.

I've just tested it on SPIP 2.1.12

Here is a copy more or less translated of the filter that you must add to mes_fonctions.php :
source : http://www.spip-contrib.net/Decouper-un-article-en-plusieurs

/*
 *   +----------------------------------+
 *    Nom du Filtre : decouper_en_page                                              
 *   +----------------------------------+
 *    Date : Vendredi 6 juin 2003
 *    Auteur :  "gpl"  : gpl-6SQNBOJVynlAfugRpC6u6w@public.gmane.org 
 *              Aurelien PIERARD : aurelien.pierard-A05WjiLMj4KqPVlgewlOEi/IejrXlDKSUNw490ZoPkc@public.gmane.org
 *   +-------------------------------------+
 *    Fonctions de ce filtre :
 *        Il sert a presenter un article sur plusieurs pages 
 *   +-------------------------------------+
 * 
 * Pour toute suggestion, remarque, proposition d'ajout
 * reportez-vous au forum de l'article :
 * http://www.uzine.net/spip_contrib/article.php3?id_article=62
*/


function decouper_en_page($text,$id_article) {
        $nextart = $_GET['artsuite'];
       
        if (empty($nextart)) $nextart = 0;
   
        // page split (separator : "-----")       
        $page = split('-----', $text);
        // Total pages number
        $num_pages = count($page);

        // If only one page, or at the result of a seach, return everything.
        if ($num_pages == 1 || !empty($var_recherche) || $nextart < 0 || $nextart > $num_pages) {
            // Add anchors to <h3>
            $text = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $text);
            $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $text);
            $res =count($array);
            $i =1;
            $text=$array[0];
            while($i<$res){
                $text=$text.$i.$array[$i];
                $i++;
            }
            return $text;
        }

        $p_prec = $nextart - 1;
        $p_suiv = $nextart + 1;
        $uri_art = generer_url_entite($id_article, "article");
        $uri_art .= strpos($uri_art, '?') ? '&' : '?';

        // Add anchors to <h3>
        $page[$nextart] = preg_replace("|\{\{\{(.*)\}\}\}|U","<a id=\"sommaire_#NB_TITRE_DE_MON_ARTICLE#\"></a>$0", $page[$nextart]);
        $array = explode("#NB_TITRE_DE_MON_ARTICLE#" , $page[$nextart]);
        $res =count($array);
        $i =1;
        $page[$nextart]=$array[0];
        while($i<$res){
            $page[$nextart]=$page[$nextart].$i.$array[$i];
            $i++;
        }
        // Pagination
        switch (TRUE) {
            case ($nextart == 0):
                $previous = "";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
            case ($nextart == ($num_pages-1)):
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "";
                break;
            default:
                $previous = "<a href='" . $uri_art . "artsuite=" . $p_prec . "'>&lt;&lt;</a>";
                $next = "<a href='" . $uri_art . "artsuite=" . $p_suiv . "'>&gt;&gt;</a>";
                break;
        }
   
        for ($i = 0; $i < $num_pages; $i++) {
            $j = $i;
            if ($i == $nextart) {
                $actual .= " <strong>" . ++$j . "</strong> ";
            }
            else {
                $actual .= " <a href='" . $uri_art . "artsuite=$i'>" . ++$j . "</a> ";
            }
        }

        // Here, you can customize
        $result .= $page[$nextart];
        $result .= "<div class='pagination' style='text-align:center'>pages : $previous $actual $next</div>";
        return $result;
}
// FIN du Filtre decouper_en_page





Hope it helps,


.Gilles
---
On Tue, Dec 27, 2011 at 10:59 AM, Serge Markitanenko <serge.markitanenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Greeting,
the most simple way - break the articles by yourself using models +
writing the JQuery script.
You could contact me after 03/01/2012 and I will try to help you.

Second way - the spip site http://www.spipmedia.net have the same
article break as you wish.
You could learn their source code by yourself - just view the source of
http://www.spipmedia.net/squelettes/sommaire.html
http://www.spipmedia.net/squelettes/article.html

Best regards,
Serge Markitanenko
http://www.voltairestudio.com


2011/12/25 kamran Mir Hazar <kamran_mirhazar-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>:
> Hello,
> Is there any plugin to break an article in more than one page without
> creating several articles?
> Here is an example:
> http://www.nytimes.com/2011/12/25/business/bourbons-all-american-roar.html?ref=global-home
> Thanks
> Kamran
>
>
> _______________________________________________
> spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en
>
_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en




_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en



Gmane