Plugin Directory

Changeset 227955


Ignore:
Timestamp:
04/12/2010 03:27:30 PM (16 years ago)
Author:
Haotik
Message:

Widgeting on twitter counter v.0.2

Location:
protwitter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protwitter/trunk/admin/protwitter_options.php

    r226150 r227955  
    11<?php
    2     if($_POST['protwitter_hidden'] == 'Y') {
     2    if(isset($_POST['protwitter_hidden']) && ($_POST['protwitter_hidden'] == 'Y')) {
    33        //Form data sent
    44        $twitter_id = $_POST['protwitter_twitter_id'];
  • protwitter/trunk/admin/protwitter_twitter_counter.php

    r226150 r227955  
    11<?php
    2     if($_POST['protwitter_hidden'] == 'Y') {
     2    if(isset($_POST['protwitter_hidden']) && ($_POST['protwitter_hidden'] == 'Y')) {
    33        //Form data sent
    4 
    5         //$twitter_id = $_POST['protwitter_twitter_id'];
    6         //update_option('protwitter_twitter_id', $twitter_id);
    7 
    8 
    9 
    104        $template_id = $_POST['protwitter_template_id'];
    115        update_option('protwitter_template_id', $template_id);
  • protwitter/trunk/protwitter.php

    r226149 r227955  
    55Description: Profesional plugin for your twitter
    66Author: Haotik
    7 Version: 0.1.0 beta
     7Version: 0.2
    88Author URI: http://www.haotik.ro [romanian]
    99*/
     10
    1011
    1112
     
    99100}
    100101
     102error_reporting(E_ALL);
     103add_action("widgets_init", array('ProTwitter_Counter', 'register'));
     104register_activation_hook( __FILE__, array('ProTwitter_Counter', 'activate'));
     105register_deactivation_hook( __FILE__, array('ProTwitter_Counter', 'deactivate'));
     106
     107class ProTwitter_Counter {
     108    function activate(){
     109    $data = array( 'title' => 'Twitter Counter');
     110    if ( ! get_option('ProTwitter_Counter')){
     111      add_option('ProTwitter_Counter' , $data);
     112    } else {
     113      update_option('ProTwitter_Counter' , $data);
     114    }
     115  }
     116  function deactivate(){
     117    delete_option('ProTwitter_Counter');
     118    }
     119  function control(){
     120         $data = get_option('ProTwitter_Counter');
     121  ?>
     122  <p><label>Title: <input name="ProTwitter_Counter_title" type="text" value="<?php echo $data['title']; ?>" /></label></p>
     123  <?php
     124    if (isset($_POST['ProTwitter_Counter_title'])){
     125          $data['title'] = attribute_escape($_POST['ProTwitter_Counter_title']);
     126          update_option('ProTwitter_Counter', $data);
     127    }
     128        protwitter_counter_display();
     129  }
     130  function widget($args){
     131        $data = get_option('ProTwitter_Counter');
     132        $title = ($data['title']=='')?'Twitter Counter':$data['title'];
     133    echo $args['before_widget'];
     134    echo $args['before_title'] . $title . $args['after_title'];
     135    protwitter_counter_display();
     136    echo $args['after_widget'];
     137  }
     138  function register(){
     139    register_sidebar_widget('Twitter Counter', array('ProTwitter_Counter', 'widget'));
     140    register_widget_control('Twitter Counter', array('ProTwitter_Counter', 'control'));
     141  }
     142}
     143
    101144?>
  • protwitter/trunk/readme.txt

    r226149 r227955  
    66Requires at least: 2.3
    77Tested up to: 2.9.2
    8 Stable tag: 0.1
     8Stable tag: 0.2
    99
    1010Allow you to have a lot of twitter options on your blog.
     
    2727
    2828= I install and activate the plugin but Twitter Counter don't apear on my page =
    29 You must put in your theme in sidebar.php the following code:
     29Go in Admin Panel -> Apperance -> Widgets -> Twitter Counter and drag and drop to your sidebar.
     30Or put in your theme in sidebar.php the following code:
    3031<?php if (function_exists('protwitter_counter_display')) protwitter_counter_display(); ?>
    31 Wigdget version comming soon.
    3232
    3333== Screenshots ==
     
    3939== Changelog ==
    4040
     41= 0.2 =
     42* Adding widgeting to Twitter Counter.
     43
    4144= 0.1 =
    4245* First version of ProTwitter.
    4346
    4447== Upgrade Notice ==
     48
     49= 0.2 =
     50Adding widgeting to Twitter Counter.
    4551
    4652= 0.1 =
Note: See TracChangeset for help on using the changeset viewer.