WordPress.org

Plugin Directory

Changeset 640814


Ignore:
Timestamp:
12/17/12 22:15:44 (16 months ago)
Author:
ozh
Message:

Sync trunk back in track. Something like this.

Location:
yourls-wordpress-to-twitter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • yourls-wordpress-to-twitter/trunk/inc/core.php

    r640172 r640814  
    117117     
    118118    $short = wp_ozh_yourls_get_new_short_url( $url, $post_id, $keyword ); 
    119      
    120     // Tweet short URL ? 
    121     if ( !wp_ozh_yourls_tweet_on( $post->post_type ) ) { 
    122         return; 
    123     } 
    124  
    125     if ( !get_post_custom_values( 'yourls_tweeted', $post_id ) ) { 
    126         // Not tweeted yet 
    127         $tweet = wp_ozh_yourls_maketweet( $short, $post->post_title, $post_id ); 
    128         if ( wp_ozh_yourls_send_tweet( $tweet ) ) 
    129             update_post_meta($post_id, 'yourls_tweeted', 1); 
    130     } 
    131119     
    132120} 
     
    374362} 
    375363 
    376 // Send tweet on... $type = 'post' or 'page' or any custom post type, returns boolean 
    377 function wp_ozh_yourls_tweet_on( $type ) { 
    378     global $wp_ozh_yourls; 
    379  
    380         if ( empty( $wp_ozh_yourls ) ) 
    381         $wp_ozh_yourls = get_option( 'ozh_yourls' ); 
    382  
    383     return ( isset( $wp_ozh_yourls['tweet_on_'.$type] ) && $wp_ozh_yourls['tweet_on_'.$type] == 1 ); 
    384 } 
    385  
    386364// Determine which service to use. Return string 
    387365function wp_ozh_yourls_service() { 
  • yourls-wordpress-to-twitter/trunk/inc/options.php

    r640172 r640814  
    284284        $type_label = $post_type->labels->singular_name; 
    285285     
    286     $account = wp_ozh_yourls_get_twitter_screen_name(); 
    287      
    288286    // Too early, young Padawan 
    289287    if ( $status != 'publish' ) { 
     
    304302    echo ' 
    305303    <input type="hidden" id="yourls_post_id" value="'.$id.'" /> 
    306     <input type="hidden" id="yourls_shorturl" value="'.$shorturl.'" /> 
    307     <input type="hidden" id="yourls_twitter_account" value="'.$account.'" />'; 
     304    <input type="hidden" id="yourls_shorturl" value="'.$shorturl.'" />'; 
    308305     
    309306    echo '<p><strong>' . __( 'Short URL', 'wp-ozh-yourls' ) . '</strong></p>'; 
  • yourls-wordpress-to-twitter/trunk/readme.txt

    r640174 r640814  
    77Stable tag: 1.6.1 
    88 
    9 Use YOURLS (a free GPL URL shortener service) or another public service (tinyURL...) to create short URLs of your posts, or for your BuddyPress groups and users 
     9Use YOURLS (a free GPL URL shortener service) to create short URLs of your posts, or for your BuddyPress groups and users 
    1010 
    1111== Description == 
  • yourls-wordpress-to-twitter/trunk/res/yourls.js

    r398045 r640814  
    33jQuery(document).ready(function($){ 
    44 
    5     $('#div_h3_twitter, #div_h3_wordpress, #div_h3_buddypress').css('display','none'); 
    6      
    75    $('#advanced_template').css('display','none'); 
    86    $('#toggle_advanced_template') 
     
    119        .click(function(){$('#advanced_template').toggle(500);}); 
    1210     
    13     // Toggle setting sections 
    14     $('.h3_toggle').click(function(){ 
    15         var target = 'div_'+$(this).attr('id'); 
    16         if( $('#'+target).css('display') == 'none' ) { 
    17             $('.div_h3').slideUp(); 
    18             $('.h3_toggle').removeClass('expanded').addClass('folded'); 
    19             $('#'+target).slideDown(); 
    20             $(this).removeClass('folded').addClass('expanded'); 
    21         } else { 
    22             $('.h3_toggle').removeClass('expanded').addClass('folded'); 
    23             $(this).removeClass('folded').addClass('expanded'); 
    24         } 
    25     }); 
    26          
    2711    // stuff for the divs that have to toggle with their select element. 
    2812    $('.y_toggle').each(function(){ 
     
    4226        }); 
    4327    })   
    44      
    45     // Twitter sample copy 
    46     $('.tw_msg_sample').click(function(){ 
    47         $('#tw_msg').val($(this).html()); 
    48     }); 
    4928     
    5029    // Sanitize Windows paths 
Note: See TracChangeset for help on using the changeset viewer.