Пример #1
0
 function nccsf_action_links($links, $file)
 {
     $pro_version = nccsf_product_info('pro_version_url');
     static $this_plugin;
     if (!$this_plugin) {
         $this_plugin = plugin_basename(__FILE__);
     }
     if ($file == $this_plugin) {
         $settings_link = '<a href="' . site_url('wp-admin/admin.php?page=') . nccsf_product_info('settings_page_slug') . '">' . 'Settings' . '</a>';
         if ($pro_version != '') {
             $settings_link .= ' | <a target="_blank" href="' . $pro_version . '">' . 'Pro Version' . '</a>';
         }
         $links = array_merge(array($settings_link), $links);
     }
     return $links;
 }
Пример #2
0
function nccsf_coming_soon_page()
{
    date_default_timezone_set(get_option('timezone_string'));
    $current_user = wp_get_current_user();
    if (is_user_logged_in()) {
        if (current_user_can('manage_options')) {
            echo '';
        } elseif (in_array($current_user->ID, nccsf_top('site_access'))) {
            echo '';
        } else {
            require_once nccsf_product_info('product_dir') . '/themes/theme.php';
            die;
        }
    } else {
        require_once nccsf_product_info('product_dir') . '/themes/theme.php';
        die;
    }
}
Пример #3
0
<?php

// General Settings
$nccsf_options['configuration'] = array(array('oid' => 'configuration_heading', 'oname' => 'Information', 'otype' => 'heading', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => 'Configuration'), array('oid' => 'plugin_status', 'oname' => 'Coming Soon Page', 'otype' => 'radio', 'oinfo' => 'Enable or Disable the Coming Soon Splash Page for this site.', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'site_access', 'oname' => 'Site Access', 'otype' => 'users', 'oinfo' => 'Select who else can access the site front-end even the coming soon page is enabled. <br /> 
                    Admin panel will be displayed as per the user role.', 'osuffix' => '', 'ovalue' => '', 'odefault' => array('0')), array('oid' => 'plugin_modules_heading', 'oname' => 'Modules', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Modules'), array('oid' => 'module_content', 'oname' => 'Custom Message', 'otype' => 'radio', 'oinfo' => '', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'module_countdown', 'oname' => 'Countdown Timer', 'otype' => 'radio', 'oinfo' => '', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'module_twitter_feeds', 'oname' => 'Twitter Feed', 'otype' => 'radio', 'oinfo' => '', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'module_social_media_icons', 'oname' => 'Social Media Icons', 'otype' => 'radio', 'oinfo' => '', 'omenu' => 'modules', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'module_contact_form', 'oname' => 'Contact Link', 'otype' => 'radio', 'oinfo' => '', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'), array('oid' => 'module_email_subscription', 'oname' => 'Email Subscriptions', 'otype' => 'radio', 'oinfo' => '', 'osuffix' => '', 'ovalue' => array('enable' => 'Enable', 'disable' => 'Disable'), 'odefault' => 'enable'));
// Branding
$nccsf_options['branding'] = array(array('oid' => 'branding_heading', 'oname' => 'Color Scheme', 'otype' => 'sub-heading', 'oinfo' => 'Hello', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Color Scheme'), array('oid' => 'color_scheme', 'oname' => 'Default Color Scheme', 'otype' => 'dropdown', 'oinfo' => '<p>Choose the default color scheme.</p><p><b>CUSTOM:</b> Update settings under Custom Color Scheme Options</p>', 'osuffix' => '', 'ovalue' => array('black' => 'Black', 'blue' => 'Blue', 'red' => 'Red', 'green' => 'Green', 'orange' => 'Orange', 'pink' => 'Pink', 'brown' => 'Brown', 'custom' => 'Custom'), 'odefault' => 'black'), array('oid' => 'logo_heading', 'oname' => 'Branding', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Logo'), array('oid' => 'logo_type', 'oname' => 'Logo Type', 'otype' => 'radio', 'oinfo' => 'Select if you want to show the logo as Text or Image', 'osuffix' => '', 'ovalue' => array('text_logo' => 'Text', 'image_logo' => 'Image', 'none' => 'None'), 'odefault' => 'image_logo'), array('oid' => 'logo_text', 'oname' => 'Logo Text', 'otype' => 'textbox', 'oinfo' => 'Type the text to be displayed as logo.', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Company Name'), array('oid' => 'logo_image', 'oname' => 'Logo Image', 'otype' => 'file', 'oinfo' => 'Upload the logo image (PNG file recommended)', 'osuffix' => '', 'ovalue' => '', 'odefault' => nccsf_product_info('product_url') . '/themes/images/logo.png'), array('oid' => 'custom_color_scheme_heading', 'oname' => 'Custom Color Scheme', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Custom Color Scheme'), array('oid' => 'custom_color_scheme', 'oname' => 'Background Color', 'otype' => 'color', 'oinfo' => 'Choose a custom color for background.', 'osuffix' => '', 'ovalue' => '', 'odefault' => '2679b1'), array('oid' => 'custom_link_color', 'oname' => 'Link Color', 'otype' => 'color', 'oinfo' => 'Choose a custom color for links on the coming soon page.', 'osuffix' => '', 'ovalue' => '', 'odefault' => '2277ea'));
// Information Page
$nccsf_options['modules'] = array(array('oid' => 'modules_heading', 'oname' => 'Page Content', 'otype' => 'heading', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => 'Page Content'), array('oid' => 'page_title', 'oname' => 'Page Title', 'otype' => 'textbox', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => 'Coming Soon'), array('oid' => 'page_content', 'oname' => 'Page Title', 'otype' => 'wysiwyg', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => "<h2>Our website is under-construction!</h2><p>We'll be up and running soon with our new and improved website.</p>"), array('oid' => 'countdown_heading', 'oname' => 'Countdown Timer', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => "Countdown Timer"), array('oid' => 'launch_date', 'oname' => 'Launch Date', 'otype' => 'date', 'oinfo' => 'Specify the date for the site to be launched.', 'osuffix' => '', 'ovalue' => '', 'odefault' => "31 Dec, 2011"), array('oid' => 'twitter_heading', 'oname' => 'Twitter Feed', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => "Twitter Feed"), array('oid' => 'twitter_handle', 'oname' => 'Twitter ID', 'otype' => 'textbox', 'oinfo' => 'Specify your twitter id to call the tweets.', 'osuffix' => '', 'ovalue' => '', 'odefault' => "netchillies"), array('oid' => 'email_subscription_heading', 'oname' => 'Email Subscriptions', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => "Email Subscriptions"), array('oid' => 'feedburner_id', 'oname' => 'Feedburner ID', 'otype' => 'textbox', 'oinfo' => 'Enter your feedburner ID to enable email subscriptions via feedburner.com.
                    <p>e.g. http://feeds.feedburner.com/<b>netchillies</b> | In this example <u>netchillies</u> is the ID.</p>', 'osuffix' => '', 'ovalue' => '', 'odefault' => "netchillies"), array('oid' => 'contact_form_heading', 'oname' => 'Contact', 'otype' => 'sub-heading', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => "Contact"), array('oid' => 'contact_email', 'oname' => 'Email Address', 'otype' => 'textbox', 'oinfo' => 'Enter your email address to be used for the Contact Us Link', 'osuffix' => '', 'ovalue' => '', 'odefault' => get_option('admin_email')));
// Information Page
$nccsf_options['info_page'] = array(array('oid' => 'item_info', 'oname' => 'Product Info', 'otype' => 'heading', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => 'Product Information'), array('oid' => 'item_type', 'oname' => 'Product Type', 'otype' => 'info', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => 'WordPress ' . nccsf_product_info('item_type')), array('oid' => 'item_name', 'oname' => 'Product Name', 'otype' => 'info', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => nccsf_product_info('item_name')), array('oid' => 'terms_of_use', 'oname' => 'License', 'otype' => 'info', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => '<p>This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.</p>'), array('oid' => 'pro_version', 'oname' => 'Premium Version', 'otype' => 'info', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => '<p>Check out the <a target="_blank" href="' . nccsf_product_info('pro_version_url') . '" title="">Premium Version </a> of this product.</p>'), array('oid' => 'localization', 'oname' => 'Localization', 'otype' => 'info', 'oinfo' => '', 'osuffix' => '', 'ovalue' => '', 'odefault' => '<p><a target="_blank" href="//http://www.netchillies.com/localize-plugins/" title="">Follow this tutorial </a> to translate this plug-in in your language'), array('oid' => 'help_and_support', 'oname' => 'Help &amp; Support', 'otype' => 'info', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => '<a target="_blank" href="http://www.netchillies.com/forums" title="">Support Forums</a> | <a  target="_blank" href="http://www.netchillies.com/contact" title="">Contact Us</a>'), array('oid' => 'special_offers', 'oname' => 'Special Offers', 'otype' => 'info-yellow', 'oinfo' => '', 'osuffix' => 'px', 'ovalue' => '', 'odefault' => '<p>Be notified of our special offers/discounts and Win a free license for any of our products every month.</p> 
                       <p>
                           <a href="https://www.facebook.com/NetChillies" target="_blank">Like us on Facebook</a> &bull; 
                           <a href="http://www.twitter.com/netchillies" target="_blank">Follow us on Twitter</a> &bull;
                           <a target="_blank" href="http://eepurl.com/bV_WT" title="">Join our mailing list</a>
                       </p>'));
Пример #4
0
 function nccsf_menu_fix()
 {
     echo '<style type="text/css">ul#adminmenu li.toplevel_page_' . nccsf_product_info('settings_page_slug') . ' .wp-first-item{display:none !important;} </style>';
 }
Пример #5
0
/themes/<?php 
echo $color_scheme;
?>
.css" media="screen" />

        <script type="text/javascript" src="<?php 
echo nccsf_product_info('extend_url');
?>
/themes/jquery.min.js"></script>
        <script type="text/javascript" src="<?php 
echo nccsf_product_info('extend_url');
?>
/themes/twitter.min.js"></script>

        <script type="text/javascript" src="<?php 
echo nccsf_product_info('extend_url');
?>
/themes/theme.js"></script>

        <?php 
if (nccsf_top('color_scheme') == 'custom') {
    $bg_color = nccsf_top('custom_color_scheme');
    $link_color = nccsf_top('custom_link_color');
    echo '
<style type="text/css">
body{background-color: #' . $bg_color . ';} 
a{color:#' . $link_color . ' !important;}
#email_subscription{background:#' . $bg_color . ' !important;} 
</style>
';
}
Пример #6
0
function nccsf_display_uninstall()
{
    global $wpdb;
    ?>

    <div id="nc-wrap" class="clearfix">
        <form action="" method="post">


    <?php 
    $uninstall_opt = '_site_' . sha1(nccsf_product_info('item_name'));
    if (isset($_POST['uninstall_db'])) {
        $options_table = nccsf_product_info('options_table_name');
        $wpdb->query("DROP TABLE {$options_table}");
        update_option($uninstall_opt, 1);
        $fw_message = '<span class="fw-message-success">' . __('Uninstall complete, You can de-activate this product now.', 'nccsf') . '</span>';
        echo $fw_message;
    }
    if (isset($_POST['reinstall_db'])) {
        delete_option($uninstall_opt);
        $location = site_url('wp-admin/admin.php?page=' . nccsf_product_info('settings_page_slug'));
        wp_redirect($location);
    }
    ?>

            <?php 
    if (get_option($uninstall_opt) == 1) {
        ?>

                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr class="fw-heading"><td colspan="2">
                <?php 
        _e("Re-Install", 'nccsf');
        echo ' &raquo; ' . nccsf_product_info('item_name');
        ?>
                        </td></tr>
                    <tr class="fw-info-white">
                        <td>
                            <?php 
        printf(__('Click Re-Install to activate this %s or <a href="%s" title="">deactivate</a>.', 'nccsf'), nccsf_product_info('item_type'), nccsf_product_info('deactivate_url'));
        ?>
                        </td>
                    </tr>
                    <tr class="fw-info-white red">
                        <td>
                            <input type="submit" name="reinstall_db" value="<?php 
        _e('Re-Install', 'nccsf');
        ?>
" class="button-secondary" /> &nbsp; 
                            <a href="<?php 
        echo site_url('wp-admin');
        ?>
" title=""><?php 
        _e('Cancel', 'nccsf');
        ?>
</a>
                        </td>
                    </tr>
                </table>

        <?php 
    } else {
        ?>

                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr class="fw-heading"><td colspan="2">
                <?php 
        _e("Uninstall", 'nccsf');
        echo ' &raquo; ' . nccsf_product_info('item_name');
        ?>
                        </th></tr>
                    <tr class="fw-info-white red">
                        <td>
                            <?php 
        _e('Are you sure? This will remove all saved settings.', 'nccsf');
        ?>
                        </td>
                    </tr>
                    <tr class="fw-info-white red">
                        <td>
                            <input type="submit" name="uninstall_db" value="<?php 
        _e('Uninstall', 'nccsf');
        ?>
" class="button-secondary fw-delete" /> &nbsp; 
                            <a href="#" title=""><?php 
        _e('Cancel', 'nccsf');
        ?>
</a>
                        </td>
                    </tr>
                </table>

    <?php 
    }
    ?>

        </form>

    </div>

            <?php 
}