wordpress:disqusrecents
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wordpress:disqusrecents [2016/08/30 16:59] – gfsadministrator | wordpress:disqusrecents [2020/10/25 19:39] (current) – gfsadministrator | ||
---|---|---|---|
Line 6: | Line 6: | ||
>Come forse molti di voi sapranno già Disqus è un sistema di commenti per siti web, blog e comunità online che si integra perfettamente con i social network, permettendo infatti il login con il proprio utente Twitter, Facebook e non solo. La gestione dello spam, gli strumenti di moderazione e analisi, le notifiche mail, il pannello commenti e molto altro ancora è centralizzato per offrire a utilizzatori e possessori dei siti il massimo della praticità. Il fatto che vengano poi supportati tutti i principali browser da PC ed in parte quelli mobile per smartphone e tablet è un valore aggiunto non da poco. | >Come forse molti di voi sapranno già Disqus è un sistema di commenti per siti web, blog e comunità online che si integra perfettamente con i social network, permettendo infatti il login con il proprio utente Twitter, Facebook e non solo. La gestione dello spam, gli strumenti di moderazione e analisi, le notifiche mail, il pannello commenti e molto altro ancora è centralizzato per offrire a utilizzatori e possessori dei siti il massimo della praticità. Il fatto che vengano poi supportati tutti i principali browser da PC ed in parte quelli mobile per smartphone e tablet è un valore aggiunto non da poco. | ||
- | Ecco quindi il codice sorgente di cui vi parlo nell' | + | <WRAP center round alert 100%> |
+ | Attenzione, si tratta della versione nata nel 2014 e non più supportata. | ||
+ | </ | ||
- | <file php disqusrecents.php> | + | A partire dalla versione 0.8 del widget, ho preferito spostare su GitHub il codice, lo puoi trovare all' |
- | <?php | + | |
- | /* | + | |
- | Plugin Name: Disqus Recents Widget | + | |
- | Plugin URI: http://public.gfsolone.com/wiki/doku.php? | + | |
- | Description: | + | |
- | Version: 0.6 | + | |
- | Author: Gioxx | + | |
- | Author URI: http:// | + | |
- | License: CC BY-NC-SA 3.0 IT | + | |
- | */ | + | |
- | /* | + | Puoi segnalarmi qualsiasi anomalia tramite l'area commenti del blog. Se vuoi suggerire ulteriori modifiche |
- | Vedi dettaglio licenza di rilascio: http:// | + | |
- | Basato su Codex Wordpress: http:// | + | |
- | Grazie a: https:// | + | |
- | -2013- Gioxx (dev@gfsolone.com) | + | |
- | Ult. mod. 30/8/16 | + | |
- | 0.6- i contenuti vengono caricati da Disqus in HTTPS. Migliorato hint su DISQUS ID da inserire nel widget. | + | |
- | IL CONTENUTO DI QUESTO FILE PHP VIENE FORNITO AS-IS | + | |
- | + | ||
- | */ | + | |
- | + | ||
- | class DsqRecents_Widget extends WP_Widget { | + | |
- | /** | + | ===== Disqus |
- | * Register widget with WordPress. | + | |
- | */ | + | |
- | public function __construct() { | + | |
- | parent:: | + | |
- | ' | + | |
- | ' | + | |
- | array( ' | + | |
- | ); | + | |
- | } | + | |
- | /** | + | <WRAP center round info 100%> |
- | * Front-end display of widget. | + | Si tratta della versione 2020, quella attualmente supportata. |
- | * | + | </WRAP> |
- | * @see WP_Widget:: | + | |
- | * | + | |
- | * @param array $args | + | |
- | * @param array $instance Saved values from database. | + | |
- | */ | + | |
- | public function widget( $args, $instance ) { | + | |
- | extract( $args ); | + | |
- | $title = apply_filters( ' | + | |
- | $dsqid = apply_filters( ' | + | |
- | $dsqitems = apply_filters( ' | + | |
- | echo $before_widget; | + | È la nuova versione del plugin |
- | if ( ! empty( $title | + | Trovi il codice sorgente del plugin su Gist, all' |
- | echo $before_title | + | |
- | // echo __( ' | + | |
- | ?> | + | |
- | <!-- Blocco commenti Disqus --> | + | |
- | <div id=" | + | |
- | < | + | |
- | </ | + | |
- | <? | + | |
- | echo $after_widget; | + | |
- | } | + | |
- | /** | + | Per ogni domanda, dubbio, proposta, |
- | * Sanitize widget form values as they are saved. | + | |
- | * | + | |
- | * @see WP_Widget:: | + | |
- | * | + | |
- | * @param array $new_instance Values just sent to be saved. | + | |
- | * @param array $old_instance Previously saved values from database. | + | |
- | * | + | |
- | * @return array Updated safe values to be saved. | + | |
- | */ | + | |
- | public function update( $new_instance, | + | |
- | $instance = array(); | + | |
- | $instance[' | + | |
- | $instance[' | + | |
- | $instance[' | + | |
- | return $instance; | + | **#StaySafe** |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Back-end widget form. | + | |
- | * | + | |
- | * @see WP_Widget:: | + | |
- | * | + | |
- | * @param array $instance Previously saved values from database. | + | |
- | */ | + | |
- | public function form( $instance ) { | + | |
- | if ( isset( $instance[ ' | + | |
- | $title = $instance[ ' | + | |
- | } | + | |
- | else { | + | |
- | $title = __( ' | + | |
- | } | + | |
- | if ( isset( $instance[ ' | + | |
- | $dsqid = $instance[ ' | + | |
- | } | + | |
- | else { | + | |
- | $dsqid = __( ' | + | |
- | } | + | |
- | if ( isset( $instance[ ' | + | |
- | $dsqitems = $instance[ ' | + | |
- | } | + | |
- | else { | + | |
- | $dsqitems = __( ' | + | |
- | } | + | |
- | ?> | + | |
- | < | + | |
- | <!-- Titolo del widget --> | + | |
- | < | + | |
- | < | + | |
- | <!-- ID DISQUS: ID.disqus.com --> | + | |
- | < | + | |
- | < | + | |
- | <!-- Numero commenti da caricare --> | + | |
- | < | + | |
- | < | + | |
- | <br /><br /> | + | |
- | <a href=" | + | |
- | <a href=" | + | |
- | </ | + | |
- | <?php | + | |
- | } | + | |
- | + | ||
- | } // class Widget terminata | + | |
- | + | ||
- | // Registrazione del widget | + | |
- | add_action( ' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | Allo stato attuale non ci sono ulteriori aggiornamenti e l' | + |
wordpress/disqusrecents.1472569196.txt.gz · Last modified: 2016/08/30 16:59 by gfsadministrator