WordPress.org

Plugin Directory

Changeset 622294


Ignore:
Timestamp:
11/07/12 21:17:49 (18 months ago)
Author:
MattyRob
Message:

Enable TINYLINK for digests and fix error handling bug

Location:
subscribe2/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • subscribe2/trunk/ReadMe.txt

    r620639 r622294  
    335335* Fixed bug in the display of compulsory categories in the Settings page 
    336336* Add option to manually send emails to All Registered Users and Public Subscribers - proposed by TigWeb 
     337* Enable TinyURL link shortening for Digest Notification Emails if {TINYLINK} is present in the Email Template 
     338* Fixed bug in TinyURL error handling and fallback when link generation fails 
    337339 
    338340= Version 8.5 by Matthew Robinson = 
  • subscribe2/trunk/admin/settings.php

    r618821 r622294  
    258258        echo "<dt><b>{TABLELINKS}</b></dt><dd>" . __("a list of post titles followed by links to the atricles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n"; 
    259259        echo "<dt><b>{PERMALINK}</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n"; 
    260         echo "<dt><b>{TINYLINK}</b></dt><dd>" . __("the post's permalink after conversion by TinyURL<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n"; 
     260        echo "<dt><b>{TINYLINK}</b></dt><dd>" . __("the post's permalink after conversion by TinyURL", 'subscribe2') . "</dd>\r\n"; 
    261261        echo "<dt><b>{DATE}</b></dt><dd>" . __("the date the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n"; 
    262262        echo "<dt><b>{TIME}</b></dt><dd>" . __("the time the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n"; 
  • subscribe2/trunk/classes/class-s2-core.php

    r614696 r622294  
    265265        if ( strstr($string, "{TINYLINK}") ) { 
    266266            $tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->get_tracking_link($this->permalink))); 
    267             if ( $tinylink !== 'Error' || $tinylink != false ) { 
     267            if ( $tinylink !== 'Error' && $tinylink != false ) { 
    268268                $tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>"; 
    269269                $string = str_replace("{TINYLINK}", $tlink, $string); 
     
    15531553            $message_posttime .= "\r\n"; 
    15541554 
    1555             $tablelinks .= "\r\n" . $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
    1556             $message_post .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
    15571555            $message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n"; 
    1558             $message_posttime .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
     1556            if ( strstr($mailtext, "{TINYLINK}") ) { 
     1557                $tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->get_tracking_link(get_permalink($post->ID)))); 
     1558                if ( $tinylink !== 'Error' && $tinylink !== false ) { 
     1559                    $tablelinks .= "\r\n" . $tinylink . "\r\n"; 
     1560                    $message_post .= $tinylink . "\r\n"; 
     1561                    $message_posttime .= $tinylink . "\r\n"; 
     1562                } else { 
     1563                    $tablelinks .= "\r\n" . $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
     1564                    $message_post .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
     1565                    $message_posttime .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n"; 
     1566                } 
     1567            } 
     1568 
    15591569            if ( strstr($mailtext, "{CATS}") ) { 
    15601570                $post_cat_names = implode(', ', wp_get_object_terms($post->ID, $s2_taxonomies, array('fields' => 'names'))); 
Note: See TracChangeset for help on using the changeset viewer.