PROZONE powered by Tophost
  Home   Forum   Regolamento Help Login Registrati   *
Statistiche
Utenti
Utenti Totali: 1707
Ultimo utente: xal
Statistiche
Posts Totali: 29470
Topics Totali: 3404
Online Oggi: 51
Presenze Massime Online: 559
(23 Luglio 2008, 14:24:28)
Utenti Online
Utenti: 0
Visitatori: 50
Totale: 50
Siti amici
Design & Multimedia

Dire e Fare il blog che ti aiuta

Wordpress
Pagine: [1]
 
Autore Topic: wordpress vivistats widget  (Letto 1525 volte)
marco76tv
Utente
***
Posts: 46


wordpress vivistats widget
« il: 5 Gennaio 2009, 09:35:31 »

io uso vivistats voi cosa usate ?

Codice:
    <?php
    
/*
    Plugin Name: Vivistats Widget
    Plugin URI: http://forum.myflashxml.it/plugins-f198/vivistats-widget-t71564.html
    Description: vivistats sidebar widget.
    Author: Marco Sottana
    Version: 0.1
    Author URI: http://forum.myflashxml.it

        My Widget is released under the GNU General Public License (GPL)
        http://www.gnu.org/licenses/gpl.txt

        This is a WordPress plugin (http://wordpress.org) and widget
        (http://automattic.com/code/widgets/).
    */

    // We're putting the plugin's functions in one big function we then
    // call at 'plugins_loaded' (add_action() at bottom) to ensure the
    // required Sidebar Widget functions are available.



    
function widget_vivistats_init() {

        
// Check to see required Widget API functions are defined...
        
if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
            return; 
// ...and if not, exit gracefully from the script.

        // This function prints the sidebar widget--the cool stuff!
        
function widget_vivistats($args) {
        
$number=0;
            
// $args is an array of strings which help your widget
            // conform to the active theme: before_widget, before_title,
            // after_widget, and after_title are the array keys.
            
extract($args);

            
// Collect our widget's options, or define their defaults.
            
$options get_option('widget_vivistats');
            
//$title = empty($options['title']) ? 'My Widget' : $options['title'];
            //$text = empty($options['text']) ? 'Hello World!' : $options['text'];
             
$title attribute_escape($options[$number]['title']);
             
$code attribute_escape($options[$number]['code']);

             
// It's important to use the $before_widget, $before_title,
             // $after_title and $after_widget variables in your output.
            
echo $before_widget;
            echo 
$before_title $title $after_title;
              
            echo 
'<!-- inizio codice vivistats.com -->'.chr(13);
        echo 
'<script type="text/javascript" language="JavaScript" src="http://count.vivistats.com/laser.asp?CountId='.$code.'"></script>'.chr(13);
        echo 
'<noscript>'.chr(13);
        echo 
'<a href="http://it.vivistats.com/"><img src="http://count.vivistats.com/laser.asp?CountId='.$code.'&js=off" border="0" alt="contatore sito web"></a>'.chr(13);
       echo 
'</noscript>'.chr(13);
       echo 
'<!-- fine codice vivistats.com -->'.chr(13);

           
    
//        echo $code."";
    //        echo $text;
            
echo $after_widget;
        }


        
    function 
widget_vivistats_control() {
       
$number=0;
       
$options $newoptions get_option('widget_vivistats');
       if ( !
is_array($options) )
          
$options $newoptions = array();
       if ( 
$_POST["widget_vivistats-$number"] ) {
          
$newoptions[$number]['title'] = strip_tags(stripslashes($_POST["widget_vivistats-$number"]));
          
$newoptions[$number]['code'] = strip_tags(stripslashes($_POST["widget_vivistats-code-$number"]));
          }
       if ( 
$options != $newoptions ) {
          
$options $newoptions;
          
update_option('widget_vivistats'$options);
       }
       
$title attribute_escape($options[$number]['title']);
       
$code attribute_escape($options[$number]['code']);
    
?>

    <p><label for="advertising_widget-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="widget_vivistats-<?php echo $number?>" name="widget_vivistats-<?php echo $number?>" type="text" value="<?php echo $title?>" /></label></p>
    <p><label for="advertising_widget-code"><?php _e('Code:'); ?> <input style="width: 250px;" id="widget_vivistats-code-<?php echo $number?>" name="widget_vivistats-code-<?php echo $number?>" type="text" value="<?php echo $code?>" /></label></p>
    <input type="hidden" id="widget_vivistats-submit-<?php echo "$number"?>" name="widget_vivistats-submit-<?php echo "$number"?>" value="1" />
    <?php
    
}


        
// This registers the widget. About time.
        
register_sidebar_widget('Vivistats Widget''widget_vivistats');

        
// This registers the (optional!) widget control form.
        
register_widget_control('Vivistats Widget''widget_vivistats_control');
    }

    
// Delays plugin execution until Dynamic Sidebar has loaded first.
    
add_action('plugins_loaded''widget_vivistats_init');
    
?>



Loggato
Pagine: [1]
 
 
Salta a:  

Oggetto Iniziato da Risposte Visto Ultimo Post
Tophost: Infrastruttura Blade Center IBM « 1 2 » Tophost 20 11825 Ultimo Post 8 Agosto 2008, 11:43:34
da daniele4home
E' bello sentirsi amati.... « 1 2 ... 11 12 » Tophost 172 54426 Ultimo Post 2 Febbraio 2008, 14:25:45
da Diavolo_Rosso
Guida A Mod_rewrite (parte 1) « 1 2 3 4 5 » doGmaI 68 48831 Ultimo Post 14 Ottobre 2009, 16:42:18
da sOoN
Di Tophost, traffico intenso e assistenza Jhack 10 3690 Ultimo Post 1 Agosto 2008, 19:36:11
da Diavolo_Rosso
Rinnovo Dominio Tophost estmodusinrebus 5 2114 Ultimo Post 17 Novembre 2005, 18:41:39
da estmodusinrebus
Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC
Traduzione Italiana a cura di SMItalia

TinyPortal v0.9.8 © Bloc
XHTML 1.0 Valido! CSS Valido!


Ultima visita di Google a questa pagina Ieri alle 04:05:37