WordPress.org

Plugin Directory

Changeset 545322


Ignore:
Timestamp:
05/17/12 11:31:54 (6 years ago)
Author:
mahnunchik
Message:

Settings description added. Widget width fixed.

Location:
yotru/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • yotru/trunk/options.php

    r542482 r545322  
    99 
    1010<tr valign="top"> 
    11 <th scope="row">Api key:</th> 
    12 <td><input type="text" name="yotru_api_key" value="<?php echo get_option('yotru_api_key'); ?>" /></td> 
     11    <td colspan="2"> 
     12        <?php _e('Please, register on Yotru.com website and obtain API key. You could register <a href="http://yotru.com/#register">here</a>.', 'text_domain') ?> 
     13    </td> 
     14</tr> 
     15<tr valign="top"> 
     16    <th scope="row"> 
     17        Api key: 
     18    </th> 
     19    <td> 
     20        <input type="text" name="yotru_api_key" placeholder="<?php _e('Paste Yotru API key here', 'text_domain') ?>" value="<?php echo get_option('yotru_api_key'); ?>" /> 
     21    </td> 
    1322</tr> 
    1423 
  • yotru/trunk/readme.txt

    r543965 r545322  
    44Requires at least: 2.7 
    55Tested up to: 3.3.2 
    6 Stable tag: 0.1.3 
     6Stable tag: 0.1.4 
    77 
    88Yotru plugin for WordPress. The serious problem faced by e-tailer is a lack of trust. Yotru is allows you to solve the trust problem. Yotru do it using visitors' social relations and positive word of mouth. As a result, conversion rate improves and sales increases. 
  • yotru/trunk/yotru-widget.php

    r542482 r545322  
    2323     */ 
    2424    public function widget($args, $instance) { 
    25          
     25 
    2626        extract($args); 
    2727        $title = apply_filters('widget_title', $instance['title']); 
     
    3030        if (!empty($title)) 
    3131            echo $before_title . $title . $after_title; 
    32         echo '<div style="width:'.$instance['width'].'px;" id="yo-root"></div>'; 
     32        echo '<div style="width:'.$instance['width'].'px; overflow: hidden; position: relative;" id="yo-root"></div>'; 
    3333        echo $after_widget; 
    3434    } 
     
    6565        ?> 
    6666        <p> 
    67             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>  
     67            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> 
    6868            <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> 
    6969        </p> 
    7070        <p> 
    71             <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:'); ?></label>  
     71            <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:'); ?></label> 
    7272            <input class="widefat" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="number" value="<?php echo esc_attr($width); ?>" /> 
    7373        </p> 
  • yotru/trunk/yotru.php

    r543965 r545322  
    44Plugin URI: https://github.com/mahnunchik/wp-yotru 
    55Description: Yotru plugin for WordPress 
    6 Version: 0.1.3 
     6Version: 0.1.4 
    77Author: Eugeny Vlasenko 
    88Author URI: http://about.me/vlasenko 
     
    2626 
    2727function options_page_yotru() { 
    28   include(WP_PLUGIN_DIR.'/yotru/options.php');   
     28  include(WP_PLUGIN_DIR.'/yotru/options.php'); 
    2929} 
    3030 
     
    4242function yotru(){ 
    4343    $api_key = get_option('yotru_api_key'); 
    44     $post = get_post(); 
     44    global $post; 
     45 
     46    if ( empty($post) ) 
     47        return false; 
    4548?> 
    4649<script type="text/javascript" src="http://widget.yotru.com/yotru.js"></script> 
     
    7477} 
    7578 
    76 if (!is_admin()) { 
    77     add_action('wp_footer', 'yotru'); 
     79function yotru_js_scripts_on_init(){ 
     80    if ( ! is_admin() ) { 
     81        add_action('wp_footer', 'yotru'); 
     82        wp_enqueue_script('jquery'); 
     83    } 
    7884} 
    7985 
    80 include(WP_PLUGIN_DIR.'/yotru/yotru-widget.php');   
     86add_action('init', 'yotru_js_scripts_on_init'); 
     87 
     88 
     89include(WP_PLUGIN_DIR.'/yotru/yotru-widget.php'); 
    8190 
    8291add_action('wp_print_styles', 'yotru_stylesheet'); 
    8392add_filter( 'the_content', 'yotru_button' ); 
    8493 
     94// Adds link to settings page on plugins page 
     95add_filter( 'plugin_action_links', 'yotru_settings_link', 10, 2 ); 
     96 
     97function yotru_settings_link($links, $file) 
     98{ 
     99    if ($file == plugin_basename('yotru/yotru.php')) 
     100    { 
     101        $links[] = '<a href="options-general.php?page=yotru">' . __('Settings', 'text_domain') . '</a>'; 
     102    } 
     103 
     104    return $links; 
     105} 
Note: See TracChangeset for help on using the changeset viewer.