if (isset($lmm_options['misc_global_admin_notices']) && $lmm_options['misc_global_admin_notices'] == 'show') {
     //info: check if custom shadow image and custom marker icon directory exists
     function checkUrlExists($url)
     {
         $result = wp_remote_get($url, array('sslverify' => false, 'body' => $url));
         if (is_wp_error($result)) {
             return false;
         }
         if ((int) $result['response']['code'] != 200) {
             return false;
         }
         return true;
     }
     if ($lmm_options['defaults_marker_icon_shadow_url_status'] == 'custom') {
         $custom_shadow_icon_url = $lmm_options['defaults_marker_icon_shadow_url'];
         $custom_shadow_icon_url_exists = checkUrlExists($custom_shadow_icon_url);
         if ($custom_shadow_icon_url != NULL && !$custom_shadow_icon_url_exists) {
             echo '<div class="error" style="padding:10px;margin:10px 0;"><strong>' . sprintf(__('Leaflet Maps Marker Warning: the setting for the marker shadow url (%1s) seems to be invalid. This can happen when you moved your WordPress installation from one server to another one.<br/>Please navigate to <a href="%2s">Settings / Map Defaults / "Default values for marker icons"</a> and update the option "Shadow URL". If you do not know which values to enter, please <a href="%3s">reset all plugins options to their defaults</a>', 'lmm'), $shadow_icon_url, LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#mapdefaults-section5', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#reset') . '</strong></div>';
         }
     }
     //info: display admin notice (lmm only) if user switches back to free version
     $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
     if (file_exists($lmm_pro_readme)) {
         $lmm_pro_version = get_option('leafletmapsmarker_version_pro');
         if ($lmm_pro_version != NULL) {
             $lmm_trial_key = get_option('leafletmapsmarkerpro_license_key_trial');
             //info: do not add additional option just for free downgrade since v2.4p/multi-layer-assignment-checks
             if ($lmm_trial_key != NULL) {
                 $toolnonce = wp_create_nonce('tool-nonce');
                 echo '<p><div id="database-downgrade"  class="error" style="padding:10px;margin:10px 0;">' . sprintf(__('Warning: "Maps Marker Pro" enabled you to assign markers to multiple layers. If you plan to use "Leaflet Maps Marker" again, a database downgrade is needed!<br/>Please be aware that the information about markers being assigned to multiple layers will get lost during that downgrade - only the first layer each marker was assigned to will be preserved!<br/><a href="%1s">Please click here to start the database downgrade</a>', 'lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_tools&action=database_downgrade&_wpnonce=' . $toolnonce) . '<br/>' . __('This message will disappear once the database downgrade has been completed.', 'lmm') . '</div></p>';
             }
Beispiel #2
0
						Shorten URL
					</button>
					<br>
				</form>
			</div>
		</div>

			<span id='encodedurl' align='center'>
		<?php 
if (isset($_POST['url'])) {
    $url = $_POST['url'];
    if (empty($url)) {
        echo $message = '<p>No url was supplied</p>';
    } elseif (validateUrlFormat($url) == false) {
        echo $message = '<p>URL does not have a valid format.</p>';
    } elseif (checkUrlExists($url) == false) {
        echo $message = '<p>URL does not appear to exist.</p>';
    } elseif (urlExistsinDB($url) == true) {
        $shortcode = urlExistsinDB($url);
        echo $message = "<div id='error' title='Copy this code'>Copy this url to share  -  <b style='font:bold 18px arial;margin-left:5px;color:green;'>{$shortcode}</b></div>";
    } else {
        $shortcode = createShortCode($url);
        echo "<div id='error' title='Copy this code'>Copy this url to share  -  <b style='font:bold 18px arial;margin-left:5px;color:green;'>{$shortcode}</b></div>";
    }
}
?>
			</span>
			<div id='facebook'><div class="fb-facepile" data-href="http://facebook.com/longurl2shorturl" data-width="560" data-max-rows="1" data-colorscheme="light" data-size="medium" data-show-count="true"></div></div>
			<div id='footer'>
				<span id='copy'>Copyright &copy Romit Choudhary 2014</span>
				<span id='social'>
Beispiel #3
0
             return false;
         }
         return true;
     }
     if ($lmm_options['defaults_marker_icon_shadow_url_status'] == 'custom') {
         $custom_shadow_icon_url = $lmm_options['defaults_marker_icon_shadow_url'];
         $custom_shadow_icon_url_exists = checkUrlExists($custom_shadow_icon_url);
         if ($custom_shadow_icon_url != NULL && !$custom_shadow_icon_url_exists) {
             echo '<div class="error" style="padding:10px;margin:10px 0;"><strong>' . sprintf(__('Leaflet Maps Marker Warning: the setting for the marker shadow url (%1s) seems to be invalid. This can happen when you moved your WordPress installation from one server to another one.<br/>Please navigate to <a href="%2s">Settings / Map Defaults / "Default values for marker icons"</a> and update the option "Shadow URL". If you do not know which values to enter, please <a href="%3s">reset all plugins options to their defaults</a>', 'lmm'), $shadow_icon_url, LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#mapdefaults-section5', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#reset') . '</strong></div>';
         }
     }
     //info: check if custom marker icon dir/url is available
     if ($lmm_options['defaults_marker_custom_icon_url_dir'] == 'yes') {
         $defaults_marker_icon_url = htmlspecialchars($lmm_options['defaults_marker_icon_url']);
         $defaults_marker_icon_dir = htmlspecialchars($lmm_options['defaults_marker_icon_dir']);
         $defaults_marker_icon_url_exists = checkUrlExists($defaults_marker_icon_url . '/readme-icons.txt');
         if (!$defaults_marker_icon_url_exists) {
             echo '<div class="error" style="padding:10px;margin:10px 0;"><strong>' . sprintf(__('Leaflet Maps Marker Warning: the setting for your custom marker icon url (%1s) seems to be invalid. <br/>Please navigate to <a href="%2s">Settings / Map Defaults / "Default values for marker icons"</a> and update the option "Custom icons URL".', 'lmm'), $defaults_marker_icon_url, LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#mapdefaults-section5') . '<br/>' . __('Please note that the file readme-icons.txt within this directory is used for this check, so please make sure, that this file is available!', 'lmm') . '</strong></div>';
         }
         if (!file_exists($defaults_marker_icon_dir . DIRECTORY_SEPARATOR . 'readme-icons.txt')) {
             echo '<div class="error" style="padding:10px;margin:10px 0;"><strong>' . sprintf(__('Leaflet Maps Marker Warning: the setting for your custom marker icon directory (%1s) seems to be invalid. <br/>Please navigate to <a href="%2s">Settings / Map Defaults / "Default values for marker icons"</a> and update the option "Custom icons directory".', 'lmm'), $defaults_marker_icon_dir, LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#mapdefaults-section5') . '<br/>' . __('Please note that the file readme-icons.txt within this directory is used for this check, so please make sure, that this file is available!', 'lmm') . '</strong></div>';
         }
     }
     if ($lmm_options['misc_betatest'] == 'enabled') {
         echo '<div class="updated" style="padding:10px;margin:10px 0;">' . sprintf(__('<strong>Beta testing is enabled - updates will be downloaded from the beta release channel</strong><br/>Beta versions may be used on production sites on your own risk only as they might be unstable!<br/>Important: please <a href="%1s">save the settings manually</a> after each plugin update and <a href="%2s" target="_blank">use the helpdesk</a> for feedback.', 'lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings', 'https://www.mapsmarker.com/helpdesk') . '</div>';
     }
 }
 //info: end misc_global_admin_notices check (which can be disabled)
 if ($lmm_options['google_places_status'] == 'disabled' && $lmm_options['google_maps_api_status'] == 'enabled') {
     echo '<div class="error" style="padding:10px;margin:10px 0;">' . sprintf(__('<strong>Warning: you disabled "Google Places Autocomplete API" but did not also disable Google Maps API - this will cause maps on backend to break!</strong><br/>To fix this, please navigate to <a href="%1s">Settings / Google / "Google Maps API"</a> and set the option "Google Maps API status" to "disabled".', 'lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-google-section1') . '</div>';
 }