Display articles via 2 keywords

I’m trying to display the articles with 2 different keyword.
The main matter that keywords could be defined or undefined - see the links:

/rubrique7&id_mot1=9
/rubrique7&id_mot1=9&id_mot2=11
/rubrique7&id_mot2=11

/rubrique7

I’m trying to do this via

<BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>

</BOUCLE_list>

But this work correct only if all two mots are difined.

Is any ideas?

Thanks in advance

Serge

Le 30/03/2012 12:15, Serge Markitanenko a écrit :

I'm trying to display the articles with 2 different keyword.
The main matter that keywords could be defined or undefined - see the links:

/rubrique7&id_mot1=9
/rubrique7&id_mot1=9&id_mot2=11
/rubrique7&id_mot2=11
/rubrique7

I'm trying to do this via

<BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>
....
</BOUCLE_list>

But this work correct only if all two mots are difined.

Is any ideas?

You'd be better of preparing an array variable before
that would contain 0, 1 or 2 mots values,
and testing IN #GET{the_array}

Or read once more the documentation of the IN critere :

"It is similarly possible to pass an array as an argument (from SPIP 1.9 onwards).

This can be an array defined by an #ARRAY tag or perhaps an array originating from a #ENV**{my_post} tag.

If #ENV{my_post} is an array (originating perhaps from form entries where the name attribute ends in ), and if the analysis filters have been deactivated by adding a double asterisk to this tag, then each element of the array will be considered as an argument for IN, SPIP applying the security filters to each of them in turn [1]."

So if you choose to use such urls :

> /rubrique7&id_mot=9
> /rubrique7&id_mot=9&id_mot=11
> /rubrique7&id_mot=11
> /rubrique7

it says you should be able tu use {id_mot IN #ENV{id_mot}}
or maybe {id_mot ?IN #ENV{id_mot}}
or rather {id_mot ?IN #ENV**{id_mot}} according on this documentation.

JLuc

I make an array in url, but I have the same matter, if I access the

/rubrique7

and use any of these boucles

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV{id_mot}>

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #GET{id_mot}>

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV**{id_mot}>

I see current sql query

AND (articles.id_rubrique = 7)

AND ((L1.id_mot IN (‹  ›)))

And as the result it display none (((

Is any other idea? Would be very gladfull )))

Best regards,
Serge

30 марта 2012 г. 16:35 пользователь JLuc <jluc@no-log.org> написал:

Le 30/03/2012 12:15, Serge Markitanenko a écrit :

I’m trying to display the articles with 2 different keyword.
The main matter that keywords could be defined or undefined - see the links:

/rubrique7&id_mot1=9
/rubrique7&id_mot1=9&id_mot2=11
/rubrique7&id_mot2=11
/rubrique7

I’m trying to do this via

<BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>

</BOUCLE_list>

But this work correct only if all two mots are difined.

Is any ideas?

You’d be better of preparing an array variable before
that would contain 0, 1 or 2 mots values,
and testing IN #GET{the_array}

Or read once more the documentation of the IN critere :

"It is similarly possible to pass an array as an argument (from SPIP 1.9 onwards).

This can be an array defined by an #ARRAY tag or perhaps an array originating from a #ENV**{my_post} tag.

If #ENV{my_post} is an array (originating perhaps from form entries where the name attribute ends in ), and if the analysis filters have been deactivated by adding a double asterisk to this tag, then each element of the array will be considered as an argument for IN, SPIP applying the security filters to each of them in turn [1]."

So if you choose to use such urls :

/rubrique7&id_mot=9
/rubrique7&id_mot=9&id_mot=11
/rubrique7&id_mot=11
/rubrique7

it says you should be able tu use {id_mot IN #ENV{id_mot}}
or maybe {id_mot ?IN #ENV{id_mot}}
or rather {id_mot ?IN #ENV**{id_mot}} according on this documentation.

JLuc


spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en

Le 02/04/2012 16:49, Serge Markitanenko a écrit :

I make an array in url, but I have the same matter, if I access the

    /rubrique7

there is no array in this url so the result is correct !

An url with a non empty array would possibly look like

/rubrique7?id_mot=12&id_mot=1

JLuc

and use any of these boucles

    <BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV{id_mot}>

    <BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #GET{id_mot}>

    <BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV**{id_mot}>

I see current sql query

    AND (articles.id_rubrique = 7)

    AND ((L1.id_mot IN ('')))

And as the result it display none (((

Is any other idea? Would be very gladfull )))

Best regards,
Serge

30 марта 2012 г. 16:35 пользователь JLuc <jluc@no-log.org <mailto:jluc@no-log.org>> написал:

    Le 30/03/2012 12:15, Serge Markitanenko a écrit :

        I'm trying to display the articles with 2 different keyword.
        The main matter that keywords could be defined or undefined - see the links:

        /rubrique7&id_mot1=9
        /rubrique7&id_mot1=9&id_mot2=11
        /rubrique7&id_mot2=11
        /rubrique7

        I'm trying to do this via

        <BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>
        ....
        </BOUCLE_list>

        But this work correct only if all two mots are difined.

        Is any ideas?

    You'd be better of preparing an array variable before
    that would contain 0, 1 or 2 mots values,
    and testing IN #GET{the_array}

    Or read once more the documentation of the IN critere :

    "It is similarly possible to pass an array as an argument (from SPIP 1.9 onwards).

    This can be an array defined by an #ARRAY tag or perhaps an array originating from a #ENV**{my_post} tag.

    If #ENV{my_post} is an array (originating perhaps from form entries where the name attribute ends in ), and if the
    analysis filters have been deactivated by adding a double asterisk to this tag, then each element of the array will
    be considered as an argument for IN, SPIP applying the security filters to each of them in turn [1]."

    So if you choose to use such urls :

     > /rubrique7&id_mot=9
     > /rubrique7&id_mot=9&id_mot=11
     > /rubrique7&id_mot=11
     > /rubrique7

    it says you should be able tu use {id_mot IN #ENV{id_mot}}
    or maybe {id_mot ?IN #ENV{id_mot}}
    or rather {id_mot ?IN #ENV**{id_mot}} according on this documentation.

    JLuc

    _______________________________________________
    spip-en@rezo.net <mailto:spip-en@rezo.net> -
    http://listes.rezo.net/mailman/listinfo/spip-en

Hi,
How to have a mobile version of a SPIP site?
Can I install a SPIP on separate directory using the same database that I have now and then install a theme like theme_jqtouch or Ipad CSS Layout?
Thank you
Kamran

right, but if I use { ?IN} criteria

the parameters had to omitted, right?

Is any way to create a boucle that would show the correct results for

/rubrique7 ( all articles)
/rubrique7&id_mot=1 ( all articles with id_mot=1)
/rubrique7&id_mot=1&id_mot=2 ( all articles with id_mot=1 and 2)
etc

I feel this is simply or impossible without php coding

Best regards,
Serge

2 апреля 2012 г. 19:05 пользователь JLuc <jluc@no-log.org> написал:

Le 02/04/2012 16:49, Serge Markitanenko a écrit :

I make an array in url, but I have the same matter, if I access the

/rubrique7

there is no array in this url so the result is correct !

An url with a non empty array would possibly look like

/rubrique7?id_mot=12&id_mot=1

JLuc

and use any of these boucles

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV{id_mot}>

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #GET{id_mot}>

<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV**{id_mot}>

I see current sql query

AND (articles.id_rubrique = 7)

AND ((L1.id_mot IN (‹  ›)))

And as the result it display none (((

Is any other idea? Would be very gladfull )))

Best regards,
Serge

30 марта 2012 г. 16:35 пользователь JLuc <jluc@no-log.org mailto:[jluc@no-log.org](mailto:jluc@no-log.org)> написал:

Le 30/03/2012 12:15, Serge Markitanenko a écrit :

I’m trying to display the articles with 2 different keyword.
The main matter that keywords could be defined or undefined - see the links:

/rubrique7&id_mot1=9
/rubrique7&id_mot1=9&id_mot2=11
/rubrique7&id_mot2=11
/rubrique7

I’m trying to do this via

<BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>

</BOUCLE_list>

But this work correct only if all two mots are difined.

Is any ideas?

You’d be better of preparing an array variable before
that would contain 0, 1 or 2 mots values,
and testing IN #GET{the_array}

Or read once more the documentation of the IN critere :

"It is similarly possible to pass an array as an argument (from SPIP 1.9 onwards).

This can be an array defined by an #ARRAY tag or perhaps an array originating from a #ENV**{my_post} tag.

If #ENV{my_post} is an array (originating perhaps from form entries where the name attribute ends in ), and if the
analysis filters have been deactivated by adding a double asterisk to this tag, then each element of the array will
be considered as an argument for IN, SPIP applying the security filters to each of them in turn [1]."

So if you choose to use such urls :

/rubrique7&id_mot=9
/rubrique7&id_mot=9&id_mot=11
/rubrique7&id_mot=11
/rubrique7

it says you should be able tu use {id_mot IN #ENV{id_mot}}
or maybe {id_mot ?IN #ENV{id_mot}}
or rather {id_mot ?IN #ENV**{id_mot}} according on this documentation.

JLuc


spip-en@rezo.net mailto:[spip-en@rezo.net](mailto:spip-en@rezo.net) -
http://listes.rezo.net/mailman/listinfo/spip-en


spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en

I did the subdomain for mobile version (e.x. m.domain.com)

with common database access
also I made symliks for IMG and plugins directories
put all mobile to squelletes directory
and put to .htaccess of domain.com 2 string for autodetecting of cell phone

RewriteCond %{HTTP_USER_AGENT} (?i:midp|mini|samsung|nokia|j2me|avant|docomo|novarra|palmos|palmsource|opwv|pda|mmp|blackberry|symbian|wireless|nokia|hand|mobi|phone|cdm|audio|samsung|HTC|mitsu|sagem|sony|alcatel|eric|NEC|philips|mmm|panasonic|sharp|wap|rover|pocket|benq|java|vox|amoi|bird|compal|voda|sany|kdd|dbt|sendo|sgh|gradi|dddi|moto|iphone|android)
RewriteRule ^(/)?$ http://m.domain.com/ [R=301]

Much better to put redirect code to index.php ( code it in php) becu\ause you couldn’t enter the domain.com from phone
htaccess would redirect you.

Best regards,
Serge

2 апреля 2012 г. 19:08 пользователь kamran Mir Hazar <kamran_mirhazar@yahoo.com> написал:

Hi,
How to have a mobile version of a SPIP site?
Can I install a SPIP on separate directory using the same database that I have now and then install a theme like theme_jqtouch or Ipad CSS Layout?
Thank you
Kamran


spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en

On Mon, Apr 2, 2012 at 6:08 PM, kamran Mir Hazar <kamran_mirhazar@yahoo.com> wrote:

Hi,
How to have a mobile version of a SPIP site?
Can I install a SPIP on separate directory using the same database that I have now and then install a theme like theme_jqtouch or Ipad CSS Layout?
Thank you

Kamran


spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en

Le 02/04/2012 18:22, Serge Markitanenko a écrit :

right, but if I use { ?IN} criteria
the parameters had to omitted, right?

Is any way to create a boucle that would show the correct results for

/rubrique7 ( all articles)
/rubrique7&id_mot=1 ( all articles with id_mot=1)
/rubrique7&id_mot=1&id_mot=2 ( all articles with id_mot=1 and 2)

Hmm for this last url the proposed solution would provide articles with either 1 or 2

proposes a solution using {doublon} to exclude non relevant articles
then displaying remaining articles ...
It uses the POUR loop that is in SPIP3 or in Bonux PLugin for SPIP2.
The code as is supposes the url includes 0, 1 or more motcle values
like
> /rubrique7 ( all articles)
> /rubrique7&motcle=1 ( all articles with id_mot=1)
> /rubrique7&motcle=1&motcle=2 ( all articles with id_mot=1 and 2)

So the code :

[(#REM) First loop displays selected keyword]
<B_motcleM>
<div class="cartouche">
<h1><:resultats_recherche:></h1>
<BOUCLE_motcleM(POUR) {tableau #ENV**{motcle}}>
<p class="soustitre">«&nbsp;<BOUCLE_multi(MOTS) {id_mot=#VALEUR}>#TYPE : #TITRE</BOUCLE_multi>&nbsp;»</p>
</BOUCLE_motcleM>
</div>
</B_motcleM>

[(#REM) Multi-criteres : Articles trouves ]
<BOUCLE_motcle(POUR) {tableau #ENV**{motcle}}>
  <BOUCLE_doublons(ARTICLES) {!id_mot=#VALEUR} {doublons} />
</BOUCLE_motcle>

<B_resultat>
<h2>#GRAND_TOTAL <:articles:></h2>
<div class="menu articles">
<ul>
  <BOUCLE_resultat(ARTICLES){doublons}>
  <li> [(#LOGO_ARTICLE|| style="color: #CA5200;">#URL_ARTICLE|image_reduire{150,100})]
       <h3><a href="#URL_ARTICLE">#TITRE</a></h3>
  </li>
  </BOUCLE_resultat>
</ul>
</div>
</B_resultat>
</B_motcle>