Home › Forum › Plugin e temi di WP › Plugin per voti e classifiche…
-
AutorePost
-
-
27 Dicembre 2006 alle 17:59 #2833AntinooPartecipante
Siccome vorrei aprire un nuovo blog in cui valutare (cioè dare un voto a) certi prodotti, sapete se per caso esiste un plugin che mi consentisse poi di “gestire” questi voti?
Ad es. un classico sarebbe una sorta di classifica dei prodotti migliori (cioè con punteggio più alto) nella sidebar.
In aggiunta o in alternativa, esiste un plugin che consente agli utenti di esprimere il proprio voto e, ovviamente, memorizzarlo nel db?
Grazie mille e buone feste.
A.
-
27 Dicembre 2006 alle 18:11 #42467AntinooPartecipante
Solo ora mi sono accorto che quando si scrive un post, c’è la possibilità di aggiungere un nuovo “campo personalizzato”, che può essermi utile. Non ho però poi capito come poter gestire tale campo/variabile: solo da codice PHP?
Se è cosà¬, la mia idea è quella di creare un piccolo plugin che inserisca alla fine di ogni post in via di pubblicazione il voto specificato: spero solo che esista un trigger per inserire il codice del mio plugin al momento della pubblicazione di un post. Non sono un esperto nel creare i plugin…
Grazie lo stesso,
Antinoo
-
28 Dicembre 2006 alle 2:06 #42469AntinooPartecipante
Giusto per informazione, ho risolto in modo abbastanza semplice, assegnando, tra gli altri, un nuovo campo (‘voto’) ed usando nel Loop questo semplice codice per recuperare il campo stesso:
$score = get_post_meta($post->ID, ‘voto’, true);
Per recuperare l’ID ho usato $post->ID perché the_ID() pare che non abbia un argomento per far solo restituire il valore, invece di mandarlo direttamente in output. Se fossi stato sicuro di quanto ho appena detto, avrei tentato di modificare la sezione:
http://www.wpitaly.it/wiki/Main/UsoCampiPersonalizzati#toc4
per eliminare il riferimento a the_ID(). Vedete voi più esperti se è il caso di toglierlo (nell’originale inglese, c’è solo $post->ID).
Saluti e buone feste.
Antinoo
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.