par hasard

Hi, alll

I'm trying to use the critere "par hasard" in a boucle inside an
'inc-file' (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn't pick "par hasard"... when I bring the same
code to the article, it works. It it really like this?

Thank you
tereza

Hi,

Maybe it’s the cache of the file.Are you on SVN or spip1.9.2 ?

On Wed, May 28, 2008 at 2:08 PM, Tereza Loparic <telopa@gmail.com> wrote:

Hi, alll

I’m trying to use the critere « par hasard » in a boucle inside an
‹ inc-file › (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn’t pick « par hasard »… when I bring the same
code to the article, it works. It it really like this?

Thank you
tereza


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

I'm trying to use the critere "par hasard" in a boucle inside an
'inc-file' (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn't pick "par hasard"...

It should just depend on the #CACHE{} period
of your included file.

peace

-- Fil

Shouldn't it work if you simply empty the spip-cache?

Simon

Fil a écrit :

I'm trying to use the critere "par hasard" in a boucle inside an
'inc-file' (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn't pick "par hasard"...
    
It should just depend on the #CACHE{} period
of your included file.

peace

-- Fil

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

#CACHE{0} is enough

On Wed, May 28, 2008 at 2:52 PM, Simon Schneebeli <simon.schneebeli@okko.org> wrote:

Shouldn’t it work if you simply empty the spip-cache?

Simon

Fil a écrit :

I’m trying to use the critere « par hasard » in a boucle inside an
‹ inc-file › (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn’t pick « par hasard »…

It should just depend on the #CACHE{} period
of your included file.

peace

– Fil


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


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

But don't you loose the whole advantage (less server load) of the cache of you put #CACHE{0}?

Simon

Gilles Vincent a écrit :

#CACHE{0} is enough

On Wed, May 28, 2008 at 2:52 PM, Simon Schneebeli <simon.schneebeli@okko.org <mailto:simon.schneebeli@okko.org>> wrote:

    Shouldn't it work if you simply empty the spip-cache?

    Simon

    Fil a écrit :
    >> I'm trying to use the critere "par hasard" in a boucle inside an
    >> 'inc-file' (<INCLURE{fond=inc-file}>). But the article selected is
    >> always the same, it doesn't pick "par hasard"...
    >>
    >
    > It should just depend on the #CACHE{} period
    > of your included file.
    >
    > peace
    >
    > -- Fil
    >
    > _______________________________________________
    > spip-en@rezo.net <mailto:spip-en@rezo.net> -
    http://listes.rezo.net/mailman/listinfo/spip-en
    >

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

But don't you loose the whole advantage (less server load) of the cache of
you put #CACHE{0}?

{par hasard} means "use a random order each time you compute the page".

if you want to change each time, then you lose the benefits of the cache, yes.

-- Fil

On Wed, May 28, 2008 at 3:43 PM, Simon Schneebeli <simon.schneebeli@okko.org> wrote:

But don’t you loose the whole advantage (less server load) of the cache of you put #CACHE{0}?

The server overload shouldn’t be important if you reduce the included template to the smallest possible (for ex. only calculates the random loop)
Only this template will be computed at each hit

Simon

Gilles Vincent a écrit :

#CACHE{0} is enough

On Wed, May 28, 2008 at 2:52 PM, Simon Schneebeli <simon.schneebeli@okko.org mailto:[simon.schneebeli@okko.org](mailto:simon.schneebeli@okko.org)> wrote:

Shouldn’t it work if you simply empty the spip-cache?

Simon

Fil a écrit :

I’m trying to use the critere « par hasard » in a boucle inside an
‹ inc-file › (<INCLURE{fond=inc-file}>). But the article selected is
always the same, it doesn’t pick « par hasard »…

It should just depend on the #CACHE{} period
of your included file.

peace

– Fil


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 mailto:[spip-en@rezo.net](mailto:spip-en@rezo.net) -

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

Simon Schneebeli wrote:

Shouldn't it work if you simply empty the spip-cache?

do something like:

inc-file.html:
#CACHE{0}
<BOUCLE_x(ARTICLES) {0,1} {par hasard}>
<INCLUDE{fond=inc-file-inner} {id_article}>
</BOUCLE_x

Pierre