function update($new_instance, $old_instance) { $instance = $old_instance; /* Strip tags (if needed) and update the widget settings. */ $instance['title'] = strip_tags($new_instance['title']); $instance['size'] = $new_instance['size']; $instance['style'] = $new_instance['style']; $instance['direction'] = $new_instance['direction']; $instance['css_images'] = $new_instance['css_images']; $instance['email_body_text'] = $new_instance['email_body_text']; // // setup icons sizes in a option $c->_allSites = ShareAndFollow::get_sites(); $args2 = array(); foreach ($c->_allSites as $item => $value) { if (strstr($value['service'], "share")) { if ($item != 'rss') { $args2[] = $item; } } } foreach ($args2 as $item) { $instance[$item] = $new_instance[$item]; $instance[$item . '_share_text'] = $new_instance[$item . '_share_text']; $instance[$item . '_popup_text'] = $new_instance[$item . '_popup_text']; } return $instance; }
<?php $c = new ShareAndFollow(); $cssOptions = $c->getCSSOptions(); $buildCss = ''; // start of CSS or head section build $printCSS = ''; if ($cssOptions['cssid'] == $c->_options['cssid'] && $c->_options['add_css'] == 'false') { $buildCss = $cssOptions['screen']; $printCSS = $cssOptions['print']; } else { if ($c->_options['add_css'] == 'true') { $buildCss .= "/* cssid=" . $c->_options['cssid'] . " */ \n"; $buildCss .= "/* WARNING!! this file is dynamicaly generated changes will */ \n"; $buildCss .= "/* be overwritten with every change to the admin screen. */ \n"; $buildCss .= "/* You can add css to this file in the admin screen. */ \n\n"; } function findLocation($location, $width) { switch ($location) { case '000': return $local = 0; break; case '00f': return $local = $width; break; case '333': return $local = $width * 2; break; case '666': return $local = $width * 3;
<?php if (is_admin() && is_user_logged_in() && current_user_can('install_plugins')) { $c = new ShareAndFollow(); $c->cache_warning_check(); if (isset($_POST['update_share-and-follow']) && isset($_POST['pnonce'])) { if (wp_verify_nonce($_POST['pnonce'], 'checkplugins')) { // save options // loop through defaults to get all possible keys foreach ($c->_defaults as $key => $value) { // check if key is set if (isset($_POST[$key])) { // update the options variable $c->_options[$key] = $_POST[$key]; } } // update the settings using the options variable $c->update_plugin_options(); ?> <div class="updated"><p><strong><?php _e("Settings Updated.", "share-and-follow"); ?> </strong></p></div><?php } else { // trying to save without a good nonce wp_die('hacking?'); } } ?> <div class="wrap"> <?php
td {vertical-align:top} div.rounded {-moz-border-radius:15px;-webkit-border-radius:15px;padding:0 20px 20px 20px;background-color:white;border:solid 1px #333} div.rounded table{border-collapse:collapse;} div.rounded table thead tr th {padding:.2em .4em} div.rounded table tbody tr td {} table.logic {border:solid 1px #ccc;margin-bottom:20px} table.logic tr th {padding:.2em .4em} table.logic tr td {border:solid 1px #ccc;border-width: 1px 0 0 0;padding:.2em .4em} table.logic tr td h4 {margin:0;} ul.cdn-listing li {float:left; width:120px;min-height:120px;text-align:center;} ul.cdn-listing li img {margin:0 10px} .cdn-setup {position:relative;} .not-the-cdn {padding:10px;width:120px;border-top-left-radius:15px;border-bottom-left-radius:15px;-moz-border-radius-bottomleft:15px;-moz-border-radius-topleft:15px;-webkit-border-top-left-radius:15px;-webkit-border-bottom-left-radius:15px;border:solid 1px #999; position:absolute} .the-cdn {margin-left: 142px;padding-left:10px;border-top-right-radius:15px;border-bottom-right-radius:15px;-moz-border-radius-bottomright:15px;-moz-border-radius-topright:15px;-webkit-border-top-right-radius:15px;-webkit-border-bottom-right-radius:15px;border:solid 1px #666; } .the-cdn-approved {border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;border:solid 1px #000;} </style> <?php ShareAndFollow::getCDNsets(); ?> <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?> "> <input type="submit" name="reset_share-and-follow" value="<?php _e('Reset Settings', 'share-and-follow'); ?> " /> </form> </div> <?php }
<?php if (is_admin() && is_user_logged_in() && current_user_can('install_plugins')) { $c = new ShareAndFollow(); $c->cache_warning_check(); if (isset($_POST['update_share-and-follow']) && isset($_POST['inonce'])) { if (wp_verify_nonce($_POST['inonce'], 'checkinteractive')) { // save options // loop through defaults to get all possible keys foreach ($c->_defaults as $key => $value) { // check if key is set if (isset($_POST[$key])) { // update the options variable $c->_options[$key] = $_POST[$key]; } } // update the settings using the options variable $c->update_plugin_options(); ?> <div class="updated"><p><strong><?php _e("Settings Updated.", "share-and-follow"); ?> </strong></p></div><?php } else { // trying to save without a good nonce wp_die('hacking?'); } } ?> <div class="wrap"> <?php
<?php if (is_admin() && is_user_logged_in() && current_user_can('install_plugins')) { $c = new ShareAndFollow(); $c->cache_warning_check(); if (isset($_POST['reset_share-and-follow']) && isset($_POST['rnonce'])) { if (wp_verify_nonce($_POST['rnonce'], 'checkreset')) { $c->_options = $c->return_defaults(); $c->update_plugin_options(); ?> <div class="updated"><p><strong><?php _e("Settings Reset.", "share-and-follow"); ?> </strong></p></div> <p><?php _e("All setings have now been reset to installation defaults, your widget settings have not been effected. You will need to re-add your follow links. <a href='admin.php?page=share-and-follow-menu'>Return to the adminstration page</a> to make the changes", "share-and-follow"); ?> </p> <?php } else { wp_die('hacking?'); } } else { ?> <div class="wrap"> <?php $c->showUsSupport(); ?> <div class="std"> <form method="post" action="<?php echo $_SERVER["REQUEST_URI"];
<?php if (is_admin() && is_user_logged_in() && current_user_can('install_plugins')) { $c = new ShareAndFollow(); $c->cache_warning_check(); if (isset($_POST['update_share-and-follow']) && isset($_POST['snonce'])) { if (wp_verify_nonce($_POST['snonce'], 'checkshare')) { // save options // loop through defaults to get all possible keys foreach ($c->_defaults as $key => $value) { // check if key is set if (isset($_POST[$key])) { // update the options variable $c->_options[$key] = $_POST[$key]; } } // update the settings using the options variable $c->update_plugin_options(); ?> <div class="updated"><p><strong><?php _e("Settings Updated.", "share-and-follow"); ?> </strong></p></div> <?php } else { // trying to save without a good nonce wp_die('hacking?'); } } ?>
function follow_links($args) { $output = new ShareAndFollow(); $output->follow_links($args); }
<?php $c = new ShareAndFollow(); $c->cache_warning_check(); if (is_user_logged_in() && is_admin()) { if (isset($_POST['update_share-and-follow']) && isset($_POST['cnonce'])) { if (!wp_verify_nonce($_POST['cnonce'], 'checkcdn')) { wp_die('hacking??'); } foreach ($c->_defaults as $key => $value) { // check if key is set if (isset($_POST[$key])) { // update the options variable $c->_options[$key] = $_POST[$key]; } } update_option($c->_adminOptionsName, $c->_options); delete_transient($c->_adminOptionsName); if (function_exists('json_decode')) { $key = ''; if (!empty($_POST['cdn-key']) && $_POST['cdn-key'] != $c->_options['cdn-key']) { delete_transient('cdnsets'); $c->_options['cdn-key'] = $_POST['cdn-key']; } if ($c->_options['cdn-key'] == '') { delete_transient('cdnsets'); } else { if (strlen($c->_options['cdn-key']) != 40) { echo "<div class='error'><p>It looks like you have put in an incorrect CDN API key. Check if you have put extra spaces in it</p></div>"; delete_transient('cdnsets'); } else {