Plugin Directory

Changeset 1340465


Ignore:
Timestamp:
02/01/2016 09:09:35 AM (10 years ago)
Author:
websima
Message:

Update to Channeller 1.3.3

Location:
channeller-telegram-channel-administrator/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • channeller-telegram-channel-administrator/trunk/channeller.php

    r1339911 r1340465  
    22/**
    33 * @package Websima Telegram Channel
    4  * @version 1.3.2
     4 * @version 1.3.3
    55 */
    66/*
     
    99Description: Send Text, URL and photo from Wordpress to Telegram Channel using Telegram bot API.
    1010Author: Websima Creative Agency
    11 Version: 1.3.2
     11Version: 1.3.3
    1212Author URI: http://websima.com
    1313*/
     
    7575}
    7676
     77function truncate_channeller($text,$limit){
     78    $excerpt = $text;
     79    if (strlen ($excerpt) > $limit) {
     80        $the_str = mb_substr($excerpt, 0, $limit);
     81    } else {
     82        $the_str = $excerpt;
     83    }
     84    return $the_str;
     85 }
    7786function channeller_admin_styles() {
    7887
  • channeller-telegram-channel-administrator/trunk/includes/ch-notification-metabox.php

    r1335646 r1340465  
    4343            }
    4444        }
     45        if (!$options['tchannel_groups'] == '') {
    4546        echo '<br/>';
    4647        printf(__( 'Send to Groups', 'tchannel' ));
     
    5859            <?php
    5960            }
    60         }
     61        }           
     62        }
     63
    6164    ?>
    6265    </p>
     
    7881
    7982
    80     <p class="textboxchannel"<?php if($selected == 'contenttext' ) {echo ' style="display:none;"';} ?>>
     83    <p class="textboxchannel"<?php if(!$selected == 'customtext' ) {echo ' style="display:none;"';} ?>>
    8184        <label for="tchannel_text" style="display: block;"><?php printf(__( 'Custom Message', 'tchannel' )); ?></label>
    8285        <textarea style="width: 99%;"rows="3" onkeyup="countChar(this)" name="tchannel_text" id="tchannel_text"><?php echo $text; ?></textarea>
  • channeller-telegram-channel-administrator/trunk/includes/ch-publishsend.php

    r1335646 r1340465  
    1818           $message = $url.chr(10).get_post_meta ($post_ID,'tchannel_text',true);
    1919       }
    20        
     20       $image = 'no';
    2121        $media =  get_post_meta ($post_ID,'tchannel_media',true);
    2222        if ($media == 'featured') {
     
    2525            $image = get_post_meta ($post_ID,'tchannel_image',true);
    2626        } elseif ($media == 'noimage') {
    27             $image == '';
     27            $image = 'no';
    2828        }
    2929   
    3030    $options = get_option( 'tchannel_settings' );
    3131    $token = $options['tchannel_text_token'];
    32         if (!$image=='') {
    33             $logger =  $message.' <br />image:'.$image;
    34            
     32        if ($image == 'no') {
     33                $chat_id = $channel;
     34                channeller_sendmessagebot ($chat_id,$message,$message);
     35        } else {
     36                $logger =  $message.' <br />image:'.$image;
    3537                $chat_id = $channel;
    3638                channeller_sendphoto($chat_id, $message, $image,$logger);
    37          
    38         } else {
    39                 $chat_id = $channel;
    40                 channeller_sendmessagebot ($chat_id,$message,$message);
    4139        }
    4240}
  • channeller-telegram-channel-administrator/trunk/includes/ch-send-functions.php

    r1337812 r1340465  
    1919    $mime_type = finfo_file($finfo, $photo);
    2020    $chatter = get_site_option( $chat_id );
     21    $caption = truncate_channeller ($caption , 200);
    2122    $fields = array(
    2223        'chat_id' => $chatter,
     
    5556    $options = get_option( 'tchannel_settings' );
    5657    $token = $options['tchannel_text_token'];
     58    $message = truncate_channeller ($message , 3000);
    5759    if ($token) {
    5860    $url = 'https://api.telegram.org/bot'.$token.'/sendMessage';
  • channeller-telegram-channel-administrator/trunk/readme.txt

    r1337814 r1340465  
    55Requires at least: 3.0.1
    66Tested up to: 4.4.1
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575
    7676== Changelog ==
     77= 1.3.3 =
     78Limit image captions to 200 characters and messages to 3000 characters
     79
    7780= 1.3.2 =
    7881Supports Html Tags in Messages including a, b, strong, code, em and pre
Note: See TracChangeset for help on using the changeset viewer.