Initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
include_once('fwgm-edit-map.php');
|
||||
include_once('fwgm-shrt-code.php');
|
||||
include_once('fwgm-widget.php');
|
||||
include_once('fwgm-add-map.php');
|
||||
?>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
function add_map_details(){
|
||||
global $wpdb,$fwbm;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
if(isset($_GET['add']) && $_GET['add']==1) {
|
||||
$option=$_POST['fullmap_option_name'];
|
||||
if(!get_option($_POST['fullmap_option_name'])){
|
||||
if($option){
|
||||
$option = preg_replace('/[^a-z0-9\s]/i', '', $option);
|
||||
$option = str_replace(" ", "_", $option);
|
||||
$options = get_option($option);
|
||||
if($options){
|
||||
$fwbm = "Please Choose Different Name";
|
||||
}
|
||||
else{
|
||||
$sql = "INSERT INTO " . $table_name . " values ('','".$option."','1');";
|
||||
if ($wpdb->query( $sql )){
|
||||
add_option($option, gfullmap_defaults());
|
||||
$fwbm = 'Google Map Successfully Added';
|
||||
}
|
||||
}
|
||||
}else{$fwbm = "Please Choose Different Name";}
|
||||
}else{$fwbm = "Please Choose Different Name";}
|
||||
}else{$fwbm = "Please Choose Different Name";} ?>
|
||||
<div class="show-message updated"> <?php echo $fwbm; ?> </div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function fwgm_get_map_details(){
|
||||
|
||||
global $wpdb;
|
||||
$disabled=null;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$my_rows_cont = $wpdb->get_results("SELECT * FROM $table_name");
|
||||
foreach( $my_rows_cont as $row){
|
||||
|
||||
echo '<div class="show_con">
|
||||
<div class="fwgm_id">'.$fgm_map_name = $row->id.'</div>
|
||||
<div class="fwgm_map_name">'.$fgm_map_name = $row->option_name.'</div>
|
||||
<div class="fwgm_shortcode_name"> '.$fgm_option_name ='[showmap name=\''. $row->option_name .'\']'.' </div>';
|
||||
|
||||
$map_status = $row->active ;
|
||||
|
||||
if( $map_status == 1){
|
||||
$disabled='disabled';
|
||||
echo '<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=edit-map&edit='. $row->option_name . '">Edit</a></div>
|
||||
<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=gfullmap&deactivate='. $row->option_name . '">Deactivate</a></div>';
|
||||
}
|
||||
else{
|
||||
echo '<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" '.$disabled.' href="?page=gfullmap">Edit</a></div>
|
||||
<div class="fwgm_activate"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=gfullmap&activate='. $row->option_name . '">Activate</a></div>';
|
||||
}
|
||||
echo'<div class="fwgm_delete_link"> '.$fgm_edit_link ='<a class="g_map_delete_btn" href="?page=gfullmap&delete='. $row->option_name . '" onclick="return fwgm_delconfirm(\''.$row->option_name.'\');""> Delete </a></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
function display_map_info(){
|
||||
|
||||
global $wpdb;
|
||||
$disabled=null;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$my_rows = $wpdb->get_results("SELECT * FROM $table_name");
|
||||
foreach( $my_rows as $row){
|
||||
|
||||
echo '<div class="show_con">
|
||||
<div class="fwgm_id">'.$fgm_map_name = $row->id.'</div>
|
||||
<div class="fwgm_map_name">'.$fgm_map_name = $row->option_name.'</div>
|
||||
<div class="fwgm_shortcode_name"> '.$fgm_option_name ='[showmap name=\''. $row->option_name .'\']'.' </div>';
|
||||
|
||||
$map_status = $row->active ;
|
||||
|
||||
if( $map_status == 1){
|
||||
$disabled='disabled';
|
||||
echo '<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=edit-map&edit='. $row->option_name . '">Edit</a></div>
|
||||
<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=gfullmap&deactivate='. $row->option_name . '">Deactivate</a></div>';
|
||||
}
|
||||
else{
|
||||
echo '<div class="fwgm_edit_link"> ' .$fgm_edit_link ='<a class="button-primary" '.$disabled.' href="?page=gfullmap">Edit</a></div>
|
||||
<div class="fwgm_activate"> ' .$fgm_edit_link ='<a class="button-primary" href="?page=gfullmap&activate='. $row->option_name . '">Activate</a></div>';
|
||||
}
|
||||
echo '<div class="fwgm_delete_link"> '.$fgm_edit_link ='<a class="g_map_delete_btn" href="?page=gfullmap&delete='. $row->option_name . '"onclick="return fwgm_delconfirm(\''.$row->option_name.'\');""> Delete </a></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['deactivate'])){
|
||||
$id=$_GET['deactivate'];
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$sql = "UPDATE " . $table_name . " SET active='0' WHERE option_name='".$id."';";
|
||||
$wpdb->query( $sql );
|
||||
}
|
||||
if(isset($_GET['activate'])){
|
||||
$id=$_GET['activate'];
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$sql = "UPDATE " . $table_name . " SET active='1' WHERE option_name='".$id."';";
|
||||
$wpdb->query( $sql );
|
||||
}
|
||||
if(isset($_GET['delete'])){
|
||||
$id=$_GET['delete'];
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$sql = "DELETE FROM " . $table_name . " WHERE option_name='".$id."';";
|
||||
$wpdb->query( $sql );
|
||||
}
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
include_once('fwgm-widget.php');
|
||||
|
||||
// Code to show Map Image
|
||||
function fwbgm_front_show($option='gfullmap_options'){
|
||||
global $wpdb;
|
||||
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$fwgm_db_data = $wpdb->get_results("SELECT * FROM $table_name WHERE option_name = '".$option."'",ARRAY_A);
|
||||
|
||||
if($fwgm_db_data[0]['active']) {
|
||||
|
||||
$options = get_option($option);
|
||||
|
||||
if($options['g_thumb_width'] == null){
|
||||
$options['g_thumb_width'] = '250';
|
||||
}
|
||||
if($options['g_thumb_height'] == null){
|
||||
$options['g_thumb_height'] = '250';
|
||||
}
|
||||
if($options['g_map_type'] == null){
|
||||
$options['g_map_type'] = 'roadmap';
|
||||
}
|
||||
if($options['g_zoom_val'] == null){
|
||||
$options['g_zoom_val'] = 'roadmap';
|
||||
}
|
||||
|
||||
$from_this = "http://www.wpfruits.com/?fwgm_refs=".$_SERVER['SERVER_NAME'];
|
||||
|
||||
if(array_key_exists("g_image_chkbox" ,$options)) {
|
||||
$tmp = "";
|
||||
$tmp .= '<div style="position:relative;"><a class="wpf_ref" href="'.$from_this.'" target="_blank">WPF</a><a class="gfullmap-thumbnail-map" href="javascript:void(0);" data-href="#dialog-lightgmap-'.$option.'" title="Click to open larger map">';
|
||||
$tmp .= '<img class="click_it" class-value="createPopup-'.$option.'" style="background: none repeat scroll 0 0 #F3F3F3;border: 1px solid #CCCCCC; padding: 5px;" title="Click to open larger map" alt="Click to open larger map" src="'.$options['g_image_path'].'" width ='. $options['g_thumb_width']. 'x height = '. $options['g_thumb_height'].'></a>';
|
||||
$tmp .= '</div>';
|
||||
$out = $tmp ;
|
||||
}
|
||||
else{
|
||||
$tmp = "";
|
||||
$tmp .= '<div id="cf_custom_content" style="position:relative;"><a class="wpf_ref" href="'.$from_this.'" target="_blank">WPF</a> <a class="gfullmap-thumbnail-map" href="javascript:void(0);" data-href="#?custom=true&width=500&height=500" title="Click to open larger map">';
|
||||
$tmp .= '<img class="click_it" class-value="createPopup-'.$option.'" style="background: none repeat scroll 0 0 #F3F3F3;border: 1px solid #CCCCCC; padding: 5px;" title="Click to open larger map" alt="Click to open larger map" src="https://maps.googleapis.com/maps/api/staticmap?center='.urlencode($options['g_thumb_address']) . '&zoom=' . $options['g_zoom_val'] . '&size=' . $options['g_thumb_width'] . 'x' . $options['g_thumb_height'] . '&maptype=' . $options['g_map_type'] .'&language=' . $options['gmap_language'] .'&sensor=false&scale=1&markers=size:red%7Ccolor:small%7Clabel:A%7C' .urlencode($options['g_thumb_address']) . '"></a>';
|
||||
$tmp .= '</div>';
|
||||
$out = $tmp ;
|
||||
}
|
||||
echo $out;
|
||||
}
|
||||
}
|
||||
|
||||
// Code to show Map in light-box
|
||||
function show_lightbox($option='gfullmap_options')
|
||||
{
|
||||
$fgm_glightbox_height = null;
|
||||
$fgm_glightbox_width = null;
|
||||
$fgm_glightbox_map_type = null;
|
||||
$fgm_glightbox_add = null;
|
||||
$fgm_glightbox_zoom = null;
|
||||
|
||||
$options = get_option($option);
|
||||
$lout = '';
|
||||
|
||||
if(!isset($options['glightbox_bubble']))
|
||||
$options['glightbox_bubble'] = 0;
|
||||
|
||||
if ($options['glightbox_bubble']) {
|
||||
$iwloc = 'addr';
|
||||
}
|
||||
else {
|
||||
$iwloc = 'near';
|
||||
}
|
||||
|
||||
if(array_key_exists("glightbox_height" ,$options)) {
|
||||
$fgm_glightbox_height =$options['glightbox_height'];
|
||||
}
|
||||
|
||||
if(array_key_exists("glightbox_map_type" ,$options)) {
|
||||
$fgm_glightbox_map_type =$options['glightbox_map_type'];
|
||||
}
|
||||
|
||||
if(array_key_exists("glightbox_width" ,$options)) {
|
||||
$fgm_glightbox_width =$options['glightbox_width'];
|
||||
}
|
||||
|
||||
if(array_key_exists("g_thumb_address" ,$options)) {
|
||||
$fgm_glightbox_add =$options['g_thumb_address'];
|
||||
}
|
||||
|
||||
if(array_key_exists("glightbox_zoom_val" ,$options)) {
|
||||
$fgm_glightbox_zoom =$options['glightbox_zoom_val'];
|
||||
}
|
||||
|
||||
if((array_key_exists("g_thumb_address" ,$options))&&($options['g_thumb_address'] == null)){
|
||||
$options['g_thumb_address']='New York, USA';
|
||||
$fgm_glightbox_add = $options['g_thumb_address'];
|
||||
}
|
||||
|
||||
if($fgm_glightbox_height == null){
|
||||
$fgm_glightbox_height = '500';
|
||||
}
|
||||
|
||||
if($fgm_glightbox_width == null){
|
||||
$fgm_glightbox_width = '500';
|
||||
}
|
||||
|
||||
$from_this = "http://www.wpfruits.com/?fwgm_refs=".$_SERVER['SERVER_NAME'];
|
||||
$map_url = 'http://maps.google.com/maps?hl=en&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t='. $fgm_glightbox_map_type . '&q=' . urlencode(remove_accents($fgm_glightbox_add)) . '&z=' . urlencode($fgm_glightbox_zoom) . '';
|
||||
|
||||
$lout .= '<div class="gmbdm-dialog" data-map-height="' . $fgm_glightbox_height . '" gmaptype="'.$fgm_glightbox_map_type.'" data-map-width="' . $fgm_glightbox_width . '" data-map-skin="black-square" data-map-iframe-url="'.$map_url.'" id="dialog-lightgmap-'.$option.'" title="Google Map">';
|
||||
$lout .= '<div class="createPopup gmbdm-map createPopup-'.$option.'" style="overflow: auto;"><div class="innerdiv" style="border:10px solid #000000; z-index:999999999;position:relative; margin:auto; display:block; height:'.($fgm_glightbox_height+20).'px; width:'.$fgm_glightbox_width.'px;"><div class="cf-close"></div><iframe height='.$fgm_glightbox_height.'px width='.$fgm_glightbox_width.'px src="'.$map_url.'"></iframe></div></div>';
|
||||
$lout .= '</div>';
|
||||
|
||||
echo $lout;
|
||||
}
|
||||
|
||||
function fwgm_short_code($atts){
|
||||
ob_start();
|
||||
extract(shortcode_atts(array(
|
||||
"name" => ''
|
||||
), $atts));
|
||||
fwbgm_front_show($name);
|
||||
show_lightbox($name);
|
||||
$output = ob_get_clean();
|
||||
return $output;
|
||||
}
|
||||
add_shortcode('showmap', 'fwgm_short_code');
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
class FullWidthGoogleMapWidget extends WP_Widget {
|
||||
|
||||
|
||||
/**
|
||||
* Register widget with WordPress.
|
||||
*/
|
||||
function __construct() {
|
||||
$widget_ops = array('classname' => 'FullWidthGoogleMapWidget', 'description' => 'Displays selected GoogleMap' );
|
||||
parent::__construct(
|
||||
'FullWidthGoogleMapWidget', // Base ID
|
||||
__('Full GoogleMap LightBox Widget',''), // Name
|
||||
$widget_ops ); // Args
|
||||
}
|
||||
|
||||
function FullWidthGoogleMapWidget() {
|
||||
$widget_ops = array('classname' => 'FullWidthGoogleMapWidget', 'description' => 'Displays selected GoogleMap' );
|
||||
$this->WP_Widget('FullWidthGoogleMapWidget', 'Full GoogleMap LightBox Widget', $widget_ops);
|
||||
}
|
||||
|
||||
function form($instance){
|
||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '','select_fwgm' =>'' ) );
|
||||
$title = $instance['title'];
|
||||
$select_fwgm = esc_attr($instance['select_fwgm']);
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','gfullmap'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('select_fwgm'); ?>"><?php _e('Select GoogleMap:','gfullmap'); ?>
|
||||
<?php
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$fwgm_data = $wpdb->get_results("SELECT * FROM $table_name WHERE active=1 ORDER BY id");
|
||||
?>
|
||||
<select id="<?php echo $this->get_field_id('select_fwgm'); ?>" name="<?php echo $this->get_field_name('select_fwgm'); ?>">
|
||||
<?php foreach($fwgm_data as $fwgm_data_item){ ?>
|
||||
<option <?php selected($fwgm_data_item->option_name,$select_fwgm); ?> value="<?php echo $fwgm_data_item->option_name; ?>"><?php echo $fwgm_data_item->option_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance){
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['select_fwgm'] = strip_tags($new_instance['select_fwgm']);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget($args, $instance){
|
||||
extract($args, EXTR_SKIP);
|
||||
echo $before_widget;
|
||||
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
||||
$select_fwgm = esc_attr($instance['select_fwgm']);
|
||||
if (!empty($title))
|
||||
echo $before_title . $title . $after_title;
|
||||
echo fwbgm_front_show($select_fwgm);
|
||||
echo show_lightbox($select_fwgm);
|
||||
echo $after_widget;
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', create_function('', 'return register_widget("FullWidthGoogleMapWidget");') );
|
||||
?>
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
GoogleMap LightBox Popup Admin Style
|
||||
*/
|
||||
|
||||
#gfullmap_admin {
|
||||
width: 892px;
|
||||
margin-top: 5px;
|
||||
float:left;
|
||||
height:auto;
|
||||
border: 1px double #DCDCD3;
|
||||
}
|
||||
#gfullmap_admin table{
|
||||
width:100%;
|
||||
}
|
||||
#gfullmap_admin table tr td{
|
||||
padding:10px 0;
|
||||
text-align:center;
|
||||
}
|
||||
#poststuff .show_con{
|
||||
border-top: 1px solid #D7D7D7;
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
height: auto;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-top: 17px;
|
||||
width: 100%;
|
||||
}
|
||||
#gfullmap_admin .fwgm_map_name{
|
||||
width:115px;
|
||||
float:left;
|
||||
height:auto;
|
||||
word-wrap: break-word;
|
||||
margin-right:20px;
|
||||
text-align:center;
|
||||
}
|
||||
#gfullmap_admin .fwgm_id{
|
||||
float: left;
|
||||
margin-left: 51px;
|
||||
width: 80px;
|
||||
}
|
||||
#gfullmap_admin .fwgm_edit_link{
|
||||
width:124px;
|
||||
float:left;
|
||||
height:auto
|
||||
}
|
||||
#poststuff .fwgm_shortcode_name{
|
||||
float: left;
|
||||
height: auto;
|
||||
margin-right: 20px;
|
||||
width: 229px;
|
||||
word-wrap: break-word;
|
||||
text-align: center;
|
||||
}
|
||||
#gfullmap_admin.postbox div.inside form table tbody tr td{
|
||||
height:Auto;
|
||||
font-weight:bold;
|
||||
font-size:12px;
|
||||
text-align: left;
|
||||
}
|
||||
#gfullmap_admin.postbox div.inside form table tbody tr td:first-child{
|
||||
font-size: 13px;
|
||||
width: 220px;
|
||||
}
|
||||
#gfullmap_admin.postbox div.inside form table tbody tr td textarea, input[type="text"], input[type="password"], input[type="file"], input[type="button"], input[type="submit"], input[type="reset"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], select{
|
||||
font-weight:normal;
|
||||
}
|
||||
#gfullmap_admin.postbox h3.hndle{
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
height: 20px;
|
||||
padding: 10px;
|
||||
background: none repeat scroll 0 0 #eeeeee;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.show-message,.gmapfrnt-show-message{
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
line-height: 30px;
|
||||
margin-bottom: 5px !important;
|
||||
margin-top: 0;
|
||||
width: 864px;
|
||||
}
|
||||
|
||||
#gfullmap_admin .form_cont {
|
||||
float:left;
|
||||
height:auto;
|
||||
width:100%;
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
#gfullmap_admin .form_cont form{
|
||||
margin-left: 13px;
|
||||
margin: 0 6px;
|
||||
}
|
||||
|
||||
#gfullmap_admin .form_cont form table span {
|
||||
font-size:10px;
|
||||
color:#B52222;
|
||||
}
|
||||
|
||||
.g_map_delete_btn {
|
||||
background:#D84949;
|
||||
padding:4px 10px;
|
||||
border-radius:3px;
|
||||
color: #ffffff;
|
||||
border:1px solid #D84949;
|
||||
font-size:12px;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.g_map_delete_btn:hover{
|
||||
background:#FDB944;
|
||||
padding:4px 10px;
|
||||
border-radius:3px;
|
||||
color: red;
|
||||
border:1px solid #F9B03F;
|
||||
font-size:12px;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
#gfullmap_add_btn{
|
||||
font-size: 15px;
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
#gfullmap_admin.postbox table tbody tr td{
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
#gfullmap_admin .fwgm_edit_link a{
|
||||
text-align:center!important;
|
||||
}
|
||||
|
||||
#gfullmap_admin .fwgm_activate{
|
||||
float: left;
|
||||
height: auto;
|
||||
margin-left: 8px;
|
||||
margin-right: 10px;
|
||||
width: 106px;
|
||||
}
|
||||
#gfullmap_admin.postbox div.inside form table tbody tr{
|
||||
margin-top:10px;
|
||||
}
|
||||
#gfullmap_admin .fwgm_delete_link{
|
||||
float: left;
|
||||
height: auto;
|
||||
margin-left: 13px;
|
||||
margin-top: 4px;
|
||||
width: 83px;
|
||||
}
|
||||
.show-message-edit{
|
||||
background: none repeat scroll 0 0 #125E7C;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
line-height: 30px;
|
||||
margin: 10px 0 !important;
|
||||
width: 726px
|
||||
}
|
||||
#gfullmap_admin.postbox h3.hndle span span{
|
||||
color: #4F5484;
|
||||
font-style: italic;
|
||||
}
|
||||
#gfullmap_admin.postbox div.inside form table tbody tr.hide{
|
||||
display:none;
|
||||
}
|
||||
#adminmenu a[href="admin.php?page=edit-map"]{
|
||||
display:none;
|
||||
}
|
||||
.gmaplbox_iframe{
|
||||
border:1px solid #dfdfdf;
|
||||
padding:4px;
|
||||
border-radius:2px;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
GoogleMap LightBox Popup Front Style
|
||||
*/
|
||||
|
||||
.createPopup{
|
||||
visibility:hidden;
|
||||
border:0px;
|
||||
outline-width:0px;
|
||||
top:50%;
|
||||
left:50%;
|
||||
position:fixed;
|
||||
float:left;
|
||||
width:0px;
|
||||
background:url("../images/thelightbox_bg.png");
|
||||
height:0px;
|
||||
}
|
||||
|
||||
a.wpf_ref{
|
||||
background: none repeat scroll 0 0 #000000;
|
||||
bottom: 16px;
|
||||
color: #FFFFFF;
|
||||
font-family: tahoma;
|
||||
font-size: 9px;
|
||||
font-weight: bold;
|
||||
left: 10px;
|
||||
line-height: 8px;
|
||||
padding: 4px;
|
||||
position: absolute;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
|
||||
.cf-close{
|
||||
background: url("../images/close.png") no-repeat scroll 0 0 transparent;
|
||||
height: 40px;
|
||||
margin-right: -29px;
|
||||
margin-top: -32px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 40px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.gmbdm-dialog{
|
||||
position:relative;
|
||||
z-index:999999999;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.gmbdm-dialog .innerdiv {
|
||||
background:url('../images/progress.gif') no-repeat scroll center #111;
|
||||
}
|
||||
|
||||
.gmbdm-dialog .innerdiv iframe{
|
||||
display:none;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 923 B |
@@ -0,0 +1 @@
|
||||
/*
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
GoogleMap LightBox Popup Front Script
|
||||
*/
|
||||
|
||||
function generate_popup(){
|
||||
jQuery('.createPopup').fadeOut().animate({
|
||||
height:'0%',
|
||||
width:'0%',
|
||||
top:'50%',
|
||||
left:'50%',
|
||||
visibility:'hidden',
|
||||
},0, function() {
|
||||
jQuery('.createPopup').parent('.gmbdm-dialog').fadeOut();
|
||||
jQuery('.createPopup').find('iframe').hide();
|
||||
});
|
||||
}
|
||||
|
||||
jQuery('document').ready(function(){
|
||||
|
||||
jQuery('.click_it').click(function(){
|
||||
|
||||
var createp ='.'+ (jQuery(this).attr('class-value'));
|
||||
jQuery(createp).css({visibility:'visible'});
|
||||
jQuery(createp).show().animate({
|
||||
height:'100%',
|
||||
width:'100%',
|
||||
top:'0',
|
||||
left:'0',
|
||||
}, 0, function() {
|
||||
jQuery(createp).parent('.gmbdm-dialog').fadeIn();
|
||||
var Iframe = jQuery(createp).find('iframe');
|
||||
var src = Iframe.attr('src');
|
||||
Iframe.attr('src', '');
|
||||
Iframe.attr('src', src);
|
||||
Iframe.load(function(){
|
||||
Iframe = jQuery(createp).find('iframe');
|
||||
Iframe.fadeIn();
|
||||
});
|
||||
});
|
||||
var map_val = (jQuery('.gmbdm-dialog').attr('data-map-height'))/2;
|
||||
var x = jQuery(window).height();
|
||||
var y= (x/2)- map_val;
|
||||
if(y < 0 ){y=0;}
|
||||
jQuery('.innerdiv').css({'display':'block','top': y, });
|
||||
});
|
||||
jQuery('.createPopup').click(function(){
|
||||
generate_popup();
|
||||
});
|
||||
jQuery('.innerdiv').click(function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).keyup(function(e) {
|
||||
if (e.keyCode == 27) {
|
||||
generate_popup();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.cf-close').click(function(e) {
|
||||
generate_popup();
|
||||
});
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name:Google Map Lightbox
|
||||
Plugin URI: http://www.wpfruits.com/downloads/wp-plugins/google-map-lightbox-popup-wordpress-plugin/
|
||||
Description: This plugin will show Google Map in Lightbox.
|
||||
Author: WPFruits
|
||||
Version: 2.0.2
|
||||
Author URI: http://www.wpfruits.com
|
||||
*/
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
// include all required files
|
||||
include_once('admin/admin.php');
|
||||
|
||||
// ADD Styles and Script in head section
|
||||
add_action('admin_init', 'gfullmap_backend_scripts');
|
||||
add_action('wp_enqueue_scripts', 'gfullmap_frontend_scripts');
|
||||
function gfullmap_backend_scripts() {
|
||||
if(is_admin()){
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_style('gfullmap_backend_style',plugins_url('admin/gfullmap_admin.css',__FILE__), false, '1.0.0' );
|
||||
wp_register_script('my-upload', plugins_url('js/gfullmap-admin.js',__FILE__), array('jquery','media-upload','thickbox'));
|
||||
wp_enqueue_script('my-upload');
|
||||
|
||||
if(isset($_GET['page']) && $_GET['page']=="edit-map"){
|
||||
wp_enqueue_script('media-upload');
|
||||
wp_enqueue_script('thickbox');
|
||||
wp_enqueue_style('thickbox');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function gfullmap_frontend_scripts() {
|
||||
if(!is_admin()){
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('gfullmap',plugins_url('js/gfullmap.js',__FILE__), array('jquery'),'1.0.0',true);
|
||||
wp_enqueue_style('gfullmap_front_style',plugins_url('css/gfullmap.css',__FILE__));
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Hook for adding admin menus
|
||||
add_action('admin_menu', 'gfullmap_plugin_admin_menu');
|
||||
function gfullmap_plugin_admin_menu() {
|
||||
add_menu_page('gfullmap', 'GoogleMap Lightbox','administrator', 'gfullmap', 'gfullmap_backend_menu',plugins_url('images/map-icon.png',__FILE__));
|
||||
add_submenu_page('gfullmap', 'Edit Map','', 'administrator','edit-map','edit_details');
|
||||
}
|
||||
//This function will create new database fields with default values
|
||||
function gfullmap_defaults(){
|
||||
$default = array(
|
||||
'g_image_path' =>'',
|
||||
'g_thumb_address' => 'Eiffel Tower',
|
||||
'g_thumb_width' => 250,
|
||||
'g_thumb_height' => 250,
|
||||
'g_map_type' => 'roadmap',
|
||||
'g_zoom_val' => '15',
|
||||
'glightbox_width' => 450,
|
||||
'glightbox_height' => 450,
|
||||
'glightbox_map_type' => 'roadmap',
|
||||
'glightbox_zoom_val' => '15',
|
||||
'gmap_language' => 'en',
|
||||
'glightbox_bubble' => '1'
|
||||
);
|
||||
return $default;
|
||||
}
|
||||
|
||||
function create_fwgm_table(){
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$sql = "CREATE TABLE " . $table_name . " (
|
||||
id mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
option_name VARCHAR(255) NOT NULL DEFAULT 'gfullmap_options',
|
||||
active tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (
|
||||
`option_name`
|
||||
)
|
||||
);";
|
||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||
dbDelta($sql);
|
||||
}
|
||||
|
||||
// Runs when plugin is activated and creates new database field
|
||||
function gfullmap_plugin_install(){
|
||||
$gfullmap_options = get_option('gfullmap_options');
|
||||
if(!$gfullmap_options){}
|
||||
add_option('gfullmap_options', gfullmap_defaults());
|
||||
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
|
||||
if($wpdb->get_var("show tables like '$table_name'") == $table_name){}
|
||||
else{
|
||||
create_fwgm_table();
|
||||
$table_name = $wpdb->prefix . "fullwidthgooglemap";
|
||||
$sql = "INSERT INTO " . $table_name . " values ('','gfullmap_options','1');";
|
||||
$wpdb->query( $sql );
|
||||
}
|
||||
}
|
||||
register_activation_hook(__FILE__,'gfullmap_plugin_install');
|
||||
|
||||
// update the gfullmap options
|
||||
if(isset($_POST['gfullmap_update'])){
|
||||
update_option('gfullmap_options', gfullmap_updates());
|
||||
}
|
||||
|
||||
function gfullmap_updates() {
|
||||
$options = $_POST['gfullmap_options'];
|
||||
$update_val = array(
|
||||
'g_image_path'=>$options['g_image_path'],
|
||||
'g_thumb_address' => $options['g_thumb_address'],
|
||||
'g_thumb_width' => $options['g_thumb_width'],
|
||||
'g_thumb_height' => $options['g_thumb_height'],
|
||||
'g_map_type' => $options['g_map_type'],
|
||||
'g_zoom_val' => $options['g_zoom_val'],
|
||||
'glightbox_width' => $options['glightbox_width'],
|
||||
'glightbox_height' => $options['glightbox_height'],
|
||||
'glightbox_map_type' => $options['glightbox_map_type'],
|
||||
'glightbox_zoom_val' => $options['glightbox_zoom_val'],
|
||||
'glightbox_bubble' => $options['glightbox_bubble']
|
||||
);
|
||||
return $update_val;
|
||||
}
|
||||
|
||||
// get gfullmap version
|
||||
function gfullmap_get_version(){
|
||||
if ( ! function_exists( 'get_plugins' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
$plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );
|
||||
$plugin_file = basename( ( __FILE__ ) );
|
||||
return $plugin_folder[$plugin_file]['Version'];
|
||||
}
|
||||
|
||||
add_action('activated_plugin','save_error');
|
||||
function save_error(){
|
||||
update_option('plugin_error', ob_get_contents());
|
||||
}
|
||||
|
||||
function gfullmap_backend_menu(){
|
||||
wp_nonce_field('update-options'); $options = get_option('gfullmap_options');
|
||||
echo get_option('plugin_error');
|
||||
?>
|
||||
|
||||
<!--wrap div start-->
|
||||
<div class="wrap">
|
||||
<div id="icon-themes" class="icon32"></div>
|
||||
<h2> <?php _e('GoogleMap LightBox '.gfullmap_get_version().' Setting\'s','gfullmap'); ?> </h2>
|
||||
</div>
|
||||
<!--wrap div end-->
|
||||
|
||||
<div id="poststuff">
|
||||
|
||||
<?php
|
||||
global $fwbm;
|
||||
|
||||
if(isset($_REQUEST['gfullmap_add_btn'])){
|
||||
add_map_details();
|
||||
}
|
||||
if(isset($_GET['deactivate'])){
|
||||
echo "<div class='gmapfrnt-show-message updated'>";
|
||||
_e('Map Has been Deactivated','gfullmap');
|
||||
echo "</div>";
|
||||
}
|
||||
if(isset($_GET['activate'])){
|
||||
echo "<div class='gmapfrnt-show-message updated'>";
|
||||
_e('Map Has been Activated','gfullmap');
|
||||
echo "</div>";
|
||||
}
|
||||
if(isset($_GET['delete'])){
|
||||
echo "<div class='gmapfrnt-show-message updated'>";
|
||||
_e('Map Has been Deleted','contactform');
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- postbox start -->
|
||||
<div class="postbox" id="gfullmap_admin">
|
||||
|
||||
<h3 class="hndle"><span style="font-family: verdana;"><?php _e("Table Of GoogleMap Lightbox",'gfullmap'); ?></span></h3>
|
||||
<div class="inside" style="padding: 0px; float:left;margin:0px;width:100%;">
|
||||
<!-- inside div start -->
|
||||
<table style="text-align:center;font-weight:bold;font-size:12px;background:#eeeeee; border-top: 1px solid #DDDDDD;">
|
||||
<tr>
|
||||
<td style="color:#04569A;width:112px;"><?php _e("ID",'gfullmap'); ?></td>
|
||||
<td style="color:#04569A;"><?php _e("Map Name",'gfullmap'); ?></td>
|
||||
<td style="width:157px;color:#04569A; "><?php _e("Shortcode",'gfullmap'); ?></td>
|
||||
<td style="text-align:right;color:#04569A;"><?php _e("Edit Map",'gfullmap'); ?></td>
|
||||
<td style="text-align:right;width:150px;color:#04569A;"><?php _e("Activate Map",'gfullmap'); ?></td>
|
||||
<td style="width:176px;color:#04569A;"><?php _e("Delete Map",'gfullmap'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if(!(isset($_GET['add']) && $_GET['add']==1)) {
|
||||
fwgm_get_map_details();
|
||||
}
|
||||
if((isset($_GET['add']) && $_GET['add']==1)) {
|
||||
display_map_info();
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="form_cont">
|
||||
<form method="post" action="?page=gfullmap&add=1"> <!-- Add new Map Form start -->
|
||||
<table>
|
||||
<tr>
|
||||
<td><input style=" border: 1px solid #AAAAAA;" type="text" id="fullmap_option_name" name="fullmap_option_name" size="50" /></td>
|
||||
<td style="text-align:center;"> <span><?php _e('*Please Do not use spaces and special characters in map name','gfullmap'); ?></span> </td>
|
||||
<td><input type="submit" value=" <?php _e('Add New GoogleMap','gfullmap'); ?> " class="button-primary" id="gfullmap_add_btn" name="gfullmap_add_btn"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form> <!-- Add new Map Form end-->
|
||||
</div>
|
||||
|
||||
</div><!-- inside div end -->
|
||||
</div> <!-- postbox div end -->
|
||||
</div> <!-- poststuff end -->
|
||||
<div style="clear:both;"></div>
|
||||
<iframe class="gmaplbox_iframe" src="http://www.sketchthemes.com/sketch-updates/plugin-updates/cbar-lite/cbar-lite.php" width="250px" height="370px" scrolling="no" ></iframe>
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,124 @@
|
||||
=== Google Map Lightbox Popup ===
|
||||
Contributors: tikendramaitry, rahulbrilliant2004, sparkleptic
|
||||
Donate link: http://www.wpfruits.com/
|
||||
Tags: google map popup, google map plugin, map address google, google map contact pop up, google map lightbox popup, google map lightbox, google map widget, google map popup widget
|
||||
Requires at least: 3.0.0
|
||||
Tested up to: 4.6
|
||||
Stable tag: 2.0.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Google Map Popup plugin allows you to add a google map popup image which on click pops up the google map for your business or the address that you want to portray.
|
||||
|
||||
== Description ==
|
||||
Google Map Popup plugin allows you to add a google map popup image which on click pops up the google map for your business or the address that you want to portray.
|
||||
|
||||
- Add a google map popup feature for your website.
|
||||
- you can create any number of google map popus.
|
||||
- Widget to use the pop up in sidebar
|
||||
- Easily manageable back-end.
|
||||
- Easy to use shortcode. Use it anywhere you want to.
|
||||
- Allows you to add/upload a different image or google map image.
|
||||
- You can select the map type you want to use.
|
||||
- Highly customizable with the height and width of the image and the popup that will come up.
|
||||
- Allows you to add your address bubble on the map.
|
||||
- Last but not the least its FREE
|
||||
|
||||
|
||||
**View Plugin Demo here - <a href="http://demo.sketchthemes.com/google-map-lightbox/"> Here </a>**
|
||||
|
||||
|
||||
= Features =
|
||||
- Add a google map popup feature for your website.
|
||||
- you can create any number of google map popus.
|
||||
- Widget to use the pop up in sidebar
|
||||
- Easily manageable back-end.
|
||||
- Easy to use shortcode. Use it anywhere you want to.
|
||||
- Allows you to add/upload a different image or google map image.
|
||||
- You can select the map type you want to use.
|
||||
- Highly customizable with the height and width of the image and the popup that will come up.
|
||||
- Allows you to add your address bubble on the map.
|
||||
- Last but not the least its FREE
|
||||
|
||||
Read more about the plugin <a href="http://www.wpfruits.com/downloads/wp-plugins/google-map-lightbox-popup-wordpress-plugin/"> Here </a>
|
||||
|
||||
|
||||
|
||||
== Installation ==
|
||||
|
||||
-Upload the plugin folder to the /wp-content/plugins/ folder of your wordpress installation.
|
||||
-Activate the plugin.
|
||||
-You will see an option at the left bottom of the wordpress options in the left sidebar.
|
||||
-Click on it to set the options
|
||||
-Then just create a new Google map popup or edit the existing one.
|
||||
http://wpfruits.com/wp-content/uploads/2013/04/image2.png
|
||||
-Click on edit and add the options to for the google map popup you have created and get going.
|
||||
-Use the shortcode to display it on the page/post or you can use the widget if you want to show them in the sidebar
|
||||
http://wpfruits.com/wp-content/uploads/2013/04/image1.png
|
||||
|
||||
|
||||
Read more about the plugin <a href="http://www.wpfruits.com/downloads/wp-plugins/google-map-lightbox-popup-wordpress-plugin/"> Here </a>
|
||||
|
||||
|
||||
|
||||
== Frequently asked questions ==
|
||||
|
||||
= I will add them as I get them =
|
||||
|
||||
An answer to that question.
|
||||
|
||||
== Screenshots ==
|
||||
http://wpfruits.com/wp-content/uploads/2013/04/image1.png
|
||||
http://wpfruits.com/wp-content/uploads/2013/04/image2.png
|
||||
|
||||
== Changelog ==
|
||||
|
||||
=Version 2.0.2=
|
||||
* Compatible with the WordPress latest version (4.6).
|
||||
* Fixed language issue.
|
||||
* Fixed lightbox frame border.
|
||||
|
||||
=Version 2.0.1=
|
||||
|
||||
* Compatible with WordPress latest Version (3.9).
|
||||
|
||||
=Version 2.0.0=
|
||||
|
||||
* Fixed small white box display issue.
|
||||
* Updated plugin settings styles.
|
||||
* Fixed few styles and jQuery issues.
|
||||
* Fixed lightbox map bubble center alignment issue.
|
||||
* Added load functionality for lightbox map.
|
||||
* Removed "show Address bubble in lightbox on Map" option from map edit settings.
|
||||
|
||||
=Version 1.0.7=
|
||||
|
||||
* Fixed few styles and jQuery issues.
|
||||
|
||||
=Version 1.0.6=
|
||||
|
||||
* Fixed Google map Grey box issue in IE9 & IE10.
|
||||
|
||||
=Version 1.0.4=
|
||||
|
||||
* Fixed Conflicting Multiple shortcode issue.
|
||||
|
||||
=Version 1.0.3=
|
||||
|
||||
* Added Google Map language option in admin panel.
|
||||
|
||||
=Version 1.0.2=
|
||||
|
||||
* Fixed Google map info window issue.
|
||||
|
||||
=Version 1.0.1=
|
||||
|
||||
* Fixed Media upload image issue
|
||||
|
||||
|
||||
|
||||
== Upgrade notice ==
|
||||
|
||||
|
||||
|
||||
== Arbitrary section 1 ==
|
||||
Reference in New Issue
Block a user