Changeset 963041
- Timestamp:
- 08/09/2014 02:52:03 PM (12 years ago)
- Location:
- map-contact/trunk
- Files:
-
- 1 added
- 5 edited
-
admin/add_new_address.php (modified) (2 diffs)
-
admin/map_addresses.php (modified) (3 diffs)
-
admin/media_uploader.js (added)
-
includes/stylesheet.css (modified) (2 diffs)
-
map-contact.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
map-contact/trunk/admin/add_new_address.php
r958909 r963041 6 6 global $wpdb; 7 7 8 wp_enqueue_script('jquery'); 9 wp_enqueue_script('media-upload'); 10 wp_enqueue_script('thickbox'); 11 wp_register_script('my-upload', plugin_dir_url(__FILE__).'media_uploader.js', array('jquery','media-upload','thickbox')); 12 wp_enqueue_script('my-upload'); 13 wp_enqueue_style('thickbox'); 14 8 15 if ($_POST["submit"]) 9 16 { 10 $wpdb->query("INSERT INTO ".$wpdb->prefix."map_addresses VALUES('','". trim($_POST["name"])."','".trim($_POST["infowindow"])."','".trim($_POST["email"])."','".trim($_POST["address"])."')");17 $wpdb->query("INSERT INTO ".$wpdb->prefix."map_addresses VALUES('','".$_POST["image_location"]."','".trim($_POST["name"])."','".trim($_POST["infowindow"])."','".trim($_POST["email"])."','".trim($_POST["address"])."')"); 11 18 echo "<div class='updated'> <p>New address has been added!</p> </div>"; 12 19 } … … 15 22 <form action='".$URL."' method='POST'> 16 23 <table style='padding-top:10px;'> 24 <tr><td style='width:200px;'>Image:</td><td style='width:300px;'><input type='text' name='image_location' value='' style='width:63.01%;' /><input type='button' class='upload-button' value='Upload Image' /></td></tr> 17 25 <tr><td style='width:200px;'>Contact Name:</td><td style='width:300px;'><input style='width:100%;' type='text' name='name'></td></tr> 18 26 <tr><td style='width:200px;'>Address:</td><td style='width:300px;'><input style='width:100%;' type='text' name='address'></td></tr> 19 <tr><td style='width:200px;'>Info Window HTML:</td><td style='max-width:300px; width:300px;'><textarea style='max-width: 100%; max-height: 106px; width:100%; height: 106px;' name='infowindow'>< /textarea></td></tr>27 <tr><td style='width:200px;'>Info Window HTML:</td><td style='max-width:300px; width:300px;'><textarea style='max-width: 100%; max-height: 106px; width:100%; height: 106px;' name='infowindow'><h2>Your Name Here!</h2><img src='[IMAGE_URL]'><div>Your Info Window description here!</div></textarea></td></tr> 20 28 <tr><td style='width:200px;'>Email:</td><td style='width:300px;'><input style='width:100%;' type='text' name='email'></td></tr> 21 29 </table>"; 22 30 submit_button('Add Address', 'submit', 'submit'); 23 31 echo "</form>"; 32 24 33 ?> 25 34 </div> -
map-contact/trunk/admin/map_addresses.php
r958909 r963041 7 7 $columns = array( 8 8 'id' => 'ID', 9 'image' => 'Image', 9 10 'name' => 'Name', 10 11 'address' => 'Address', … … 56 57 $row = $wpdb->get_var("SELECT $element FROM ".$wpdb->prefix."map_settings WHERE id='".$id."'"); 57 58 58 if (@mysql_fetch_array($result) !== false && !empty($id) && !empty($element) )59 if (@mysql_fetch_array($result) !== false && !empty($id) && !empty($element) && !empty($value)) 59 60 { 60 61 $wpdb->query("UPDATE ".$wpdb->prefix."map_addresses SET $element='".$value."' WHERE id='".$id."'"); … … 90 91 91 92 $addressess = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."map_addresses"); 93 $imported = false; 92 94 foreach ($addressess as $address) 93 95 { 94 96 $address = get_object_vars($address); 95 $listTable->data[] = array("id" => $address["id"],"name" => "<input name='".$address["id"]."_"."name"."' type='text' style='width:100%;' value='".$address["name"]."'>","infowindow" => "<textarea name='".$address["id"]."_"."infowindow"."' style='max-width: 100%; max-height: 106px;width:100%; height:106px;'>".$address["infoWindow"]."</textarea>","address" => "<input name='".$address["id"]."_"."address"."' type='text' style='width:100%;' value='".$address["address"]."'>","email" => "<input name='".$address["id"]."_"."email"."' type='text' style='width:100%;' value='".$address["email"]."'>", "delete" => "<div style='height:106px; line-height:106px; text-align:center;'><form id='delete' action='".$URL."' method='POST'><input type='submit' value='Delete' name='".$address['id']."_delete'></form></div>"); 97 98 if (!empty($address["image"]) && $imported==false) 99 { 100 wp_enqueue_script('jquery'); 101 wp_enqueue_script('media-upload'); 102 wp_enqueue_script('thickbox'); 103 wp_register_script('my-upload', plugin_dir_url(__FILE__).'media_uploader.js', array('jquery','media-upload','thickbox')); 104 wp_enqueue_script('my-upload'); 105 wp_enqueue_style('thickbox'); 106 $imported = true; 107 } 108 109 $image = "<div style='width:100%; text-align:center;'><img src='".$address["image"]."' style='max-width:100%;' /></div>"."<div style='text-align:center;'><input type='hidden' name='".$address["id"]."_image' value='' style='width:63.01%;' /><input type='button' class='upload-button' value='Change Image' /></div>"; 110 111 $listTable->data[] = array("id" => $address["id"],"image" => $image,"name" => "<input name='".$address["id"]."_"."name"."' type='text' style='width:100%;' value='".$address["name"]."'>","infowindow" => "<textarea name='".$address["id"]."_"."infowindow"."' style='max-width: 100%; max-height: 106px;width:100%; height:106px;'>".$address["infoWindow"]."</textarea>","address" => "<input name='".$address["id"]."_"."address"."' type='text' style='width:100%;' value='".$address["address"]."'>","email" => "<input name='".$address["id"]."_"."email"."' type='text' style='width:100%;' value='".$address["email"]."'>", "delete" => "<div style='height:106px; line-height:106px; text-align:center;'><form id='delete' action='".$URL."' method='POST'><input type='submit' value='Delete' name='".$address['id']."_delete'></form></div>"); 96 112 } 97 113 -
map-contact/trunk/includes/stylesheet.css
r958909 r963041 11 11 { 12 12 background-color: #FFFFFF; 13 border: 1px solid #DBDBDB !important;14 border-radius: 0px !important;15 -moz-border-radius: 0px !important;16 -webkit-border-radius: 0px !important;13 border: 1px solid #DBDBDB; 14 border-radius: 0px; 15 -moz-border-radius: 0px; 16 -webkit-border-radius: 0px; 17 17 padding: 10px 10px 10px 10px; 18 box-shadow: 5px 5px 2px 2px #DBDBDB !important;19 -moz-box-shadow: 5px 5px 2px 2px #DBDBDB !important;20 -webkit-box-shadow: 5px 5px 2px 2px #DBDBDB !important;18 box-shadow: 5px 5px 2px 2px #DBDBDB; 19 -moz-box-shadow: 5px 5px 2px 2px #DBDBDB; 20 -webkit-box-shadow: 5px 5px 2px 2px #DBDBDB; 21 21 } 22 22 .lightbox { … … 28 28 background:rgba(0, 0, 0, .8); 29 29 } 30 .person_entry img 31 { 32 width: 35%; 33 float: left; 34 text-align: center; 35 margin-right:14px; 36 background: #FFFFFF; 37 border: 1px solid #DBDBDB; 38 padding: 2px; border-radius: 200px; 39 -moz-border-radius: 200px !important; 40 -webkit-border-radius: 200px !important; 41 box-sizing: border-box !important; 42 -moz-box-sizing: border-box !important; 43 -webkit-box-sizing: border-box !important; 44 } -
map-contact/trunk/map-contact.php
r960722 r963041 6 6 Plugin URI: http://wordpress.org/plugins/map-contact/ 7 7 Author URI: http://xantoo.com/ 8 Version: 2.0.48 Version: 3.0 9 9 */ 10 10 … … 48 48 49 49 $address["infoWindow"] = trim(preg_replace('/\s\s+/', ' ', $address["infoWindow"])); 50 $map->addLocationPin($loc["lat"],$loc["lng"],$address["name"],"<div style='max-width:250px; padding-bottom:10px;'>".preg_replace("/<img[^>]+\>/i", "", $address["infoWindow"])."</div>"); 50 $iw = preg_replace("/<img[^>]+\>/i", "", $address["infoWindow"]); 51 $map->addLocationPin($loc["lat"],$loc["lng"],$address["name"],"<div style='max-width:250px; padding-bottom:10px;'>".$iw."</div>"); 51 52 } 52 53 } … … 67 68 foreach ($addresses as $address) { 68 69 $address = get_object_vars($address); 70 $contact = ""; 71 if (!empty($address["image"])) { $address["infoWindow"] = preg_replace("/".preg_quote("[IMAGE_URL]")."/i",$address["image"],$address["infoWindow"]); } 72 69 73 if (!empty($address["email"])){ 70 74 $contact = '<button type="button" onclick="document.getElementById(\''.$address["id"].'_lightbox\').style.display=\'inline\';" >Contact by email</button>'; 75 71 76 if (strpos($_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"],"http")!==true) { $URL = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } else { $URL = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } 72 77 … … 187 192 dbDelta( "CREATE TABLE ".$wpdb->prefix."map_addresses ( 188 193 `id` int(11) NOT NULL AUTO_INCREMENT, 194 `image` text NOT NULL, 189 195 `name` text NOT NULL, 190 196 `infoWindow` text NOT NULL, … … 201 207 else 202 208 { 203 $wpdb->get_var("INSERT INTO ".$wpdb->prefix."map_addresses"." VALUES('','Ryan Smith','<h2>Ryan Smith</h2> <img src=\'http://www.w3.org/html/logo/downloads/HTML5_Logo_256.png\' style=\'width: 35% !important; float: left !important; text-align: center; margin-right:14px; background: #FFFFFF !important; border: 1px solid #DBDBDB !important; padding: 2px !important; border-radius: 200px !important; -moz-border-radius: 200px !important; -webkit-border-radius: 200px !important; box-sizing: border-box !important; -moz-box-sizing: border-box !important; -webkit-box-sizing: border-box !important;\'><div>Ryan, our lead developer on Map Contact is located in Greater London!</div>','ryan@xantoo.com','London')"); 204 $wpdb->get_var("INSERT INTO ".$wpdb->prefix."map_addresses"." VALUES('','James Smith','<h2>James Smith</h2><img src=\'http://a1.res.cloudinary.com/hvqqwrowv/image/asset/css3-65bdc13faee51df7f05b91f44414a80d.png\' style=\'width: 35% !important; float: left !important; text-align: center; margin-right:14px; background: #FFFFFF !important; border: 1px solid #DBDBDB !important; padding: 2px !important; border-radius: 200px !important; -moz-border-radius: 200px !important; -webkit-border-radius: 200px !important; box-sizing: border-box !important; -moz-box-sizing: border-box !important; -webkit-box-sizing: border-box !important;\'><div>James, our lead marketer on Map Contact is located in Greater London!</div>','james@xantoo.com','London')"); 205 } 206 } 209 $wpdb->get_var("INSERT INTO ".$wpdb->prefix."map_addresses"." VALUES('','http://www.w3.org/html/logo/downloads/HTML5_Logo_256.png','Ryan Smith',\"<h2>Ryan Smith</h2><img src='[IMAGE_URL]'><div>Ryan, our lead developer on Map Contact is located in Greater London!</div>\",'ryan@xantoo.com','London')"); 210 $wpdb->get_var("INSERT INTO ".$wpdb->prefix."map_addresses"." VALUES('','http://a1.res.cloudinary.com/hvqqwrowv/image/asset/css3-65bdc13faee51df7f05b91f44414a80d.png','James Smith',\"<h2>James Smith</h2><img src='[IMAGE_URL]'><div>James, our lead marketer on Map Contact is located in Greater London!</div>\",'james@xantoo.com','London')"); 211 } 212 } 213 } 214 215 function updatePlugin() 216 { 217 //2.1 UPDATE 218 global $wpdb; 219 220 $result = $wpdb->get_var("SHOW COLUMNS FROM `wp_map_addresses` LIKE 'image'"); 221 222 if (!$result) { $wpdb->query("ALTER TABLE wp_map_addresses ADD COLUMN `image` text NOT NULL AFTER `ID`"); } 207 223 } 208 224 … … 212 228 add_shortcode( 'map-contact', 'shortcodeManagment' ); 213 229 register_activation_hook( __FILE__, "pluginActivated"); 230 add_action( 'admin_init', 'updatePlugin' ); 214 231 ?> -
map-contact/trunk/readme.txt
r960722 r963041 23 23 * Fully cross browser compliant including IE7 to IE11. 24 24 * Mobile device optimized, all tablets and phones. 25 * Click on map markets to open the persons profile as well as displaying the persons profile under the map. 25 * Click on map markers to open the persons profile as well as displaying the persons profile under the map. 26 * Upload and change contact images in seconds. 26 27 27 28 = To-Do = 28 29 * Profile Pictures upload via admin, currently only available by uploading picture manually and pasting link30 into html code.31 32 29 33 30 * If you have any suggestions what so ever please dont hesitate to leave feedback. … … 61 58 = 62 59 60 = 3.0 - 09/08/2014 = 61 * Upload and change contact images, without having to put code! 62 63 63 = 2.0.4 - 05/08/2014 = 64 64 * Bug Fixes
Note: See TracChangeset
for help on using the changeset viewer.