Il 16/01/2011 22:10, Fabrizio Rota ha scritto:
Una cosa semplice semplice come trovarsi scritto "letto 15 volte" in calce agli articoli, piuttosto che "scaricato" 47 volte per i files (per i files c'è questo http://plone.org/products/niteoweb.downloadcounter che non ho provato ancora, ma spero non sia di quelli che "mette alla prova" lo ZODB come si dice nei forum.....).

 lo fa alla grande:

def increase_download_count(file):
    """Increases download count integer on a File."""
    if hasattr(file, 'download_count'):
        file.download_count += 1


## Script (Python) "at_download"
##title=Download a file keeping the original uploaded filename
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath

from niteoweb.downloadcounter import increase_download_count
increase_download_count(context)

if traverse_subpath:
    field = context.getWrappedField(traverse_subpath[0])
else:
    field = context.getPrimaryField()
return field.download(context)


notare l'orribile:

field = context.getWrappedField(traverse_subpath[0])

  :-o


Sarà pure una cosa inutile ma.... a me non dispiacerebbe.... addirittura me l'aspettavo già pronta..... la sono andata a cercare tra le impostazioni della pagina. Invece non mi pare sia così, nemmeno in Plone 4, e nemmeno nel 4.1 (leggendo le caratteristiche presunte).

Pazienza.

faber

Il giorno 16 gennaio 2011 20:38, Luca Fabbri <[email protected] <mailto:[email protected]>> ha scritto:

    2011/1/16 Fabrizio Rota <[email protected]
    <mailto:[email protected]>>:
    > Dimenticavo...... Sulla questione "hit counter" ho provato a
    chiedere in
    > IRC. La risposta è arrivata velocissima: "cerca prima di
    chiedere, non farci
    > perdere tempo, niente bla-bla". Accidenti!
    > LA mia nonna diceva: "chiedere è lecito, rispondere è cortesia".
    > Avrei preferito non avere risposte!
    > Lasciatemi almeno condividere lo sfogo.....
    >

    Molto, molto poco professionale una simile risposta. Piuttosto è
    meglio ignorare un commento che una simile risposta!

    Domanda: che cosa ti manca che non sia nel log HTTP di Zope/Apache?


    > faber
    >
    > Il giorno 16 gennaio 2011 17:16, Fabrizio Rota
    <[email protected] <mailto:[email protected]>> ha
    > scritto:
    >>
    >> Proprio così... e sul forum internazionale c'erano certi flames....
    >> Io capisco che Plone funziona con lo ZODB che ha i suoi pregi e
    i suoi
    >> .... difetti....
    >> Ma come si è arrivati a salvare i files sul filesystem come
    standard per
    >> Plone 4, spero pure si arrivi ad avere come standard la
    possibilità di
    >> salvare qualcosina sui database relazionali, senza dover
    aggiungere prodotti
    >> esterni che magari ti lasciano a piedi durante le migrazioni.
    >> So che sono scarso io.... ma per alcune cose comincio a
    guardare verso
    >> Drupal.
    >>
    >> faber
    >>
    >> Il giorno 16 gennaio 2011 12:31, SauZheR <[email protected]
    <mailto:[email protected]>> ha scritto:
    >>>
    >>> attenzione ai counter dinamici. Questo si traduce in una
    scrittura su
    >>> Zodb ogni volta che la pagina viene vista. con buona pace dei
    >>> meccanismi di cache. In caso di alto traffico cominciano i
    problemi.
    >>>
    >>> bye
    >>>
    >>> Il 15 gennaio 2011 10:13, Fabrizio Rota
    <[email protected] <mailto:[email protected]>> ha
    >>> scritto:
    >>> > Ho guardato un po' nei forum internazionali di Plone..... La
    questione
    >>> > del
    >>> > counter non è per nulla banale.....
    >>> >
    >>> > Il giorno 15 gennaio 2011 08:44, Fabrizio Rota
    >>> > <[email protected] <mailto:[email protected]>> ha
    >>> > scritto:
    >>> >>
    >>> >> Grazie. Cercavo però qualcosa che mostrasse il numero di
    letture
    >>> >> direttamente in calce all'articolo, senza andare ad
    agganciare ogni
    >>> >> volta
    >>> >> google analytics.
    >>> >> Per il content type "file" ho trovato il prodotto giusto,
    per il resto
    >>> >> non
    >>> >> ancora.
    >>> >> Mi fa così strano vedere che a Plone manca questa
    caratteristica!
    >>> >> a presto
    >>> >>
    >>> >> 2011/1/15 Vito Falco <[email protected]
    <mailto:[email protected]>>
    >>> >>>
    >>> >>> Ciao
    >>> >>> ho intravisto nella lista dei prodotti addizionali di
    plone, un
    >>> >>> portlet
    >>> >>> che si aggancia al googleAnalitycs installabile sul sito.
    >>> >>> Immagino, ma non l'ho mai utilizzato, che possa fare anche
    quello che
    >>> >>> dici tu.
    >>> >>> Vito
    >>> >>>
    >>> >>> 2011/1/12 Fabrizio Rota <[email protected]
    <mailto:[email protected]>>
    >>> >>>>
    >>> >>>> C'è qualcosa di affidabile che conti le letture di un
    articolo o lo
    >>> >>>> scaricamento di un file e lo mostri nella pagina stessa?
    >>> >>>>
    >>> >>>>
    >>> >>>> --
    >>> >>>> Faber
    >>> >>>> --------------------
    >>> >>>> "Life is what happens to you while you're busy making
    other plans" -
    >>> >>>> J.
    >>> >>>> Lennon
    >>> >>>>
    >>> >>>> “If you think education is expensive, try ignorance” - D. Bok
    >>> >>>>
    >>> >>>> _______________________________________________
    >>> >>>> Plone-IT mailing list
    >>> >>>> [email protected] <mailto:[email protected]>
    >>> >>>> http://lists.plone.org/mailman/listinfo/plone-it
    >>> >>>> http://www.nabble.com/Plone---Italy-f21728.html
    >>> >>>
    >>> >>>
    >>> >>>
    >>> >>> --
    >>> >>> http://appuntiplone.wordpress.com (IT) -
    >>> >>> http://notasdeplone.wordpress.com (ES)
    >>> >>> "Design is the method of putting form and content
    together. Design,
    >>> >>> just
    >>> >>> as art, has multiple definitions; there is no single
    definition.
    >>> >>> Design can
    >>> >>> be art. Design can be aesthetics. Design is so simple,
    that's why it
    >>> >>> is so
    >>> >>> complicated." by Paul Rand
    >>> >>>
    >>> >>> _______________________________________________
    >>> >>> Plone-IT mailing list
    >>> >>> [email protected] <mailto:[email protected]>
    >>> >>> http://lists.plone.org/mailman/listinfo/plone-it
    >>> >>> http://www.nabble.com/Plone---Italy-f21728.html
    >>> >>
    >>> >>
    >>> >>
    >>> >> --
    >>> >> Fabrizio
    >>> >> --------------------
    >>> >> "Life is what happens to you while you're busy making other
    plans" -
    >>> >> J.
    >>> >> Lennon
    >>> >>
    >>> >> “If you think education is expensive, try ignorance” - D. Bok
    >>> >
    >>> >
    >>> >
    >>> > --
    >>> > Fabrizio
    >>> > --------------------
    >>> > "Life is what happens to you while you're busy making other
    plans" - J.
    >>> > Lennon
    >>> >
    >>> > “If you think education is expensive, try ignorance” - D. Bok
    >>> >
    >>> > _______________________________________________
    >>> > Plone-IT mailing list
    >>> > [email protected] <mailto:[email protected]>
    >>> > http://lists.plone.org/mailman/listinfo/plone-it
    >>> > http://www.nabble.com/Plone---Italy-f21728.html
    >>> >
    >>>
    >>>
    >>>
    >>> --
    >>>   bye
    >>> SauZheR
    >>> ************************************
    >>> l'iterazione è umana...
    >>> la ricorsione, Divina!
    >>> ************************************
    >>> reply to: sauzher AT gmail DOT com
    >>> _______________________________________________
    >>> Plone-IT mailing list
    >>> [email protected] <mailto:[email protected]>
    >>> http://lists.plone.org/mailman/listinfo/plone-it
    >>> http://www.nabble.com/Plone---Italy-f21728.html
    >>
    >>
    >>
    >> --
    >> Fabrizio
    >> --------------------
    >> "Life is what happens to you while you're busy making other
    plans" - J.
    >> Lennon
    >>
    >> “If you think education is expensive, try ignorance” - D. Bok
    >
    >
    >
    > --
    > Fabrizio
    > --------------------
    > "Life is what happens to you while you're busy making other
    plans" - J.
    > Lennon
    >
    > “If you think education is expensive, try ignorance” - D. Bok
    >
    > _______________________________________________
    > Plone-IT mailing list
    > [email protected] <mailto:[email protected]>
    > http://lists.plone.org/mailman/listinfo/plone-it
    > http://www.nabble.com/Plone---Italy-f21728.html
    >



    --
    -- luca
    _______________________________________________
    Plone-IT mailing list
    [email protected] <mailto:[email protected]>
    http://lists.plone.org/mailman/listinfo/plone-it
    http://www.nabble.com/Plone---Italy-f21728.html




--
Fabrizio
--------------------
"Life is what happens to you while you're busy making other plans" - J. Lennon

“If you think education is expensive, try ignorance” - D. Bok


_______________________________________________
Plone-IT mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

_______________________________________________
Plone-IT mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

Rispondere a