Plugin Directory

Changeset 1673372


Ignore:
Timestamp:
06/08/2017 01:50:55 PM (9 years ago)
Author:
botosubdev
Message:

shortcode updated for customization

Location:
botosub/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • botosub/trunk/botosub.php

    r1669465 r1673372  
    44Plugin URI: https://www.botosub.com/
    55Description: Send Newsletters directly to Facebook Messenger users
    6 Version: 1.0
     6Version: 1.1
    77Author: Botosub Dev
    88License:     GPL2
     
    2929    register_setting('bs_botosub_options', 'botosub_switch_color');
    3030    register_setting('bs_botosub_options', 'botosub_plugin_type');
     31    register_setting('bs_botosub_options', 'botosub_sc_title');
     32    register_setting('bs_botosub_options', 'botosub_sc_title_color');
     33    register_setting('bs_botosub_options', 'botosub_sc_desc');
     34    register_setting('bs_botosub_options', 'botosub_sc_desc_color');
     35    register_setting('bs_botosub_options', 'botosub_sc_bg_color');
     36    register_setting('bs_botosub_options', 'botosub_sc_img');
    3137}
    3238
     
    106112            </tr>
    107113            <tr valign="top">
    108                 <th scope="row">Text</th>
    109                 <td>
     114                <!-- bar -->
     115                <th class="botosub_bar_class" scope="row">Text</th>
     116                <td class="botosub_bar_class">
    110117                    <input type="text" name="botosub_text" style="width:70%;" placeholder="<?php echo $botosub_newsletter_text; ?>" value="<?php echo get_option('botosub_text'); ?>" />
    111118                </td>
    112119
    113120                <th class="botosub_bar_class" scope="row">Text Color</th>
    114                 <td class="botosub_bar_class"><input class="bar_input" type="text" name="botosub_text_color" placeholder="#ffffff"
     121                <td class="botosub_bar_class"><input type="text" name="botosub_text_color" placeholder="#ffffff"
    115122                           value="<?php echo get_option('botosub_text_color'); ?>"/></td>
    116123               
     124                <!-- scode -->
     125                <th class="botosub_scode_class" scope="row">Title</th>
     126                <td class="botosub_scode_class">
     127                    <input type="text" name="botosub_sc_title" style="width:70%;" placeholder="<?php echo $botosub_newsletter_text; ?>" value="<?php echo get_option('botosub_sc_title'); ?>" />
     128                </td>
     129               
     130                <th class="botosub_scode_class" scope="row">Title Color</th>
     131                <td class="botosub_scode_class"><input type="text" name="botosub_sc_title_color" placeholder="#333"
     132                           value="<?php echo get_option('botosub_sc_title_color'); ?>"/></td>
     133
     134            </tr>
     135            <tr valign="top">
     136               
     137                <!-- bar -->
     138                <th class="botosub_bar_class" scope="row">Text Style</th>
     139                <td class="botosub_bar_class">
     140                    <input type="text" name="botosub_text_style" style="width:70%;" placeholder="font-weight:bold; padding-right: 10px;" value="<?php echo get_option('botosub_text_style'); ?>" />
     141                </td>
     142                <th class="botosub_bar_class" scope="row">Switch Color</th>
     143                <td class="botosub_bar_class">
     144                    <input type="text" name="botosub_switch_color" placeholder="#000" value="<?php echo get_option('botosub_switch_color'); ?>" />
     145                </td>
     146               
     147                <!-- scode -->
     148                <th class="botosub_scode_class" scope="row">Description</th>
     149                <td class="botosub_scode_class">
     150                    <input type="text" name="botosub_sc_desc" style="width:70%;" value="<?php echo get_option('botosub_sc_desc'); ?>" />
     151                </td>
     152               
     153                <th class="botosub_scode_class" scope="row">Description Color</th>
     154                <td class="botosub_scode_class"><input type="text" name="botosub_sc_desc_color" placeholder="#333"
     155                           value="<?php echo get_option('botosub_sc_desc_color'); ?>"/></td>
     156            </tr>
     157            <tr valign="top">
     158                <!-- bar -->
     159                <th class="botosub_bar_class" scope="row">Background Color</th>
     160                <td class="botosub_bar_class"><input type="text" name="botosub_box_bg_color" placeholder="#fed136"
     161                           value="<?php echo get_option('botosub_box_bg_color'); ?>"/></td>
     162               
     163                <!-- scode -->
     164                <th class="botosub_scode_class" scope="row">Background Color</th>
     165                <td class="botosub_scode_class">
     166                    <input type="text" name="botosub_sc_bg_color" placeholder="#ffffff" style="width:70%;" value="<?php echo get_option('botosub_sc_bg_color'); ?>" />
     167                </td>
     168
    117169                <th class="botosub_scode_class" scope="row">Shortcode</th>
    118170                <td class="botosub_scode_class"><span style="margin-bottom: 20px; font-size: 21px; font-weight: 300; line-height: 1.4;">[botosub_newsletters]</span></td>
    119171            </tr>
    120             <tr valign="top">
    121                 <th class="botosub_bar_class" scope="row">Text Style</th>
    122                 <td class="botosub_bar_class">
    123                     <input class="bar_input" type="text" name="botosub_text_style" style="width:70%;" placeholder="font-weight:bold; padding-right: 10px;" value="<?php echo get_option('botosub_text_style'); ?>" />
    124                 </td>
    125                 <th class="botosub_bar_class" scope="row">Switch Color</th>
    126                 <td class="botosub_bar_class">
    127                     <input class="bar_input" type="text" name="botosub_switch_color" placeholder="#000" value="<?php echo get_option('botosub_switch_color'); ?>" />
    128                 </td>
    129             </tr>
    130             <tr valign="top">
    131                 <th class="botosub_bar_class" scope="row">Background Color</th>
    132                 <td class="botosub_bar_class"><input class="bar_input" type="text" name="botosub_box_bg_color" placeholder="#fed136"
    133                            value="<?php echo get_option('botosub_box_bg_color'); ?>"/></td>
     172
     173            <tr valign="top">
     174
     175                <!-- scode -->
     176                <th class="botosub_scode_class" scope="row">Image URL</th>
     177                <td class="botosub_scode_class">
     178                    <input type="text" name="botosub_sc_img" placeholder="" style="width:70%;" value="<?php echo get_option('botosub_sc_img'); ?>" />
     179                </td>
     180
    134181            </tr>
    135182        </table>
     
    246293
    247294
    248     <!-- Botosub - Newsletters From Messenger Chatbot -->
     295    <!-- Botosub - SWITCH -->
    249296    <div class="botosub-plugin-outer <?php echo $plugin_class ?> ">
    250297        <div id="botosub-plugin" class="botosub-plugin-style" style="background: <?php
     
    284331}
    285332
    286 
     333// SHORTCODE
    287334function botosub_letter_shortcode_init() {
    288335    // Add Shortcode
    289336    function botosub_letter_shortcode( $atts , $content = null ) {
    290337
    291         // PLUGIN TEXT
    292         $myOption = (get_option('botosub_text') == FALSE) ? $botosub_newsletter_text : get_option('botosub_text');
    293 
    294         $div = "<div style='margin: 20px 0; border-radius: 16px; padding: 20px 20px; border: 1px solid #ccc!important;'>
    295             <span style='font-size: 1.2em; text-align: center; display: block; margin-bottom: 20px;'>
    296                     " . $myOption . "
    297                 </span>
    298             <div class='fb-messengermessageus' style='display:block; text-align:center;'
    299                  messenger_app_id='627891880745321'
    300                  page_id=" . get_option('botosub_page_id') . "
    301                  color='blue'
    302                  size='large' >
     338        $botosub_newsletter_text = "Subscribe to our Newsletters from Messenger Chatbot!";
     339        // PLUGIN TITLE
     340        $myOption = (get_option('botosub_sc_title') == FALSE) ? $botosub_newsletter_text : get_option('botosub_sc_title');
     341        $sc_title_color = (get_option('botosub_sc_title_color') == FALSE) ? "" : "color:" . get_option('botosub_sc_title_color') . ";";
     342        $sc_desc = (get_option('botosub_sc_desc') == FALSE) ? "" : get_option('botosub_sc_desc');
     343        $sc_desc_color = (get_option('botosub_sc_desc_color') == FALSE) ? "" : "color:" . get_option('botosub_sc_desc_color') . ";";
     344        $sc_bg_color = (get_option('botosub_sc_bg_color') == FALSE) ? "" : "background-color:" . get_option('botosub_sc_bg_color') . ";";
     345
     346        $sc_img = (get_option('botosub_sc_img') == FALSE) ? "" : "<img src='" . get_option('botosub_sc_img') . "' style='display:inline-block; max-height:158px; float:left;'>";
     347
     348
     349        $div = "<div style='border-radius: 16px; padding: 20px 20px; border: 1px solid #ccc!important; text-align:center; overflow:auto; height:200px;" . $sc_bg_color . "'>" . $sc_img . "
     350            <div style='display:table-cell; vertical-align:middle; line-height:normal; height:158px;'>
     351                <span style='font-size: 1.2em; text-align: center; display: block; margin-bottom: 10px; " . $sc_title_color . "'>
     352                        " . $myOption . "
     353                    </span>
     354                    <span style='margin-bottom:10px; display:block; " . $sc_desc_color . "'>" . $sc_desc . "</span>
     355                <div class='fb-messengermessageus' style='display:block; text-align:center;'
     356                     messenger_app_id='627891880745321'
     357                     page_id=" . get_option('botosub_page_id') . "
     358                     color='blue'
     359                     size='large' >
     360                </div>
    303361            </div>
    304362        </div>";
  • botosub/trunk/readme.txt

    r1670063 r1673372  
    44Requires at least: 3.1
    55Tested up to: 4.7.5
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    59592. Users receive your newsletter from your FB page as a private message.
    60603. Bottom Bar Botosub Plugin
     614. Shortcode for Botosub Plugin
    6162
    6263== Changelog ==
     64
     65= 1.1 =
     66
     67* Shortcode updated for customization
    6368
    6469= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.