prefix."lugmap"; if ( isset( $_POST['lugmap_api_key'] ) && isset( $_POST['lugmap_coord'] ) ) { if($_POST['lugmap_api_key']) update_option('lugmap_api_key', attribute_escape($_POST['lugmap_api_key'])); if($_POST['lugmap_coord']) update_option('lugmap_coord', attribute_escape($_POST['lugmap_coord'])); ?>

query("DELETE FROM $table WHERE id = $lugmap_marker_id"); ?>


[LUGMAP]','lug-map')?>

,

here','lug-map'), 'http://code.google.com/apis/maps/signup.html')?>.

this tool','lug-map'),'http://itouchmap.com/latlong.html')?>.

    get_results("SELECT * FROM $table"); $wpdb->show_errors(); foreach($markers as $marker) { printf(__('
  1. X | Geolocation: %2$s, Name: %3$s, URL: %4$s, Contact: %6$s
    %7$s
  2. ','lug-map'), "?page=lug-map&delete_lugmap_marker=$marker->id", "$marker->point", "$marker->name", "$marker->web", "$marker->email", "$marker->cord", "$marker->dsc"); echo "\n"; } ?>

.

prefix."lugmap"; $lm_name = $wpdb->escape($_POST['lm_name']); $lm_org = $wpdb->escape($_POST['lm_org']); $lm_email = $wpdb->escape($_POST['lm_email']); $lm_web = $wpdb->escape(apply_filters("the_title",$_POST['lm_web'])); $lm_dsc = $wpdb->escape(apply_filters("comment_status_pre ",$_POST['lm_dsc'])); $lm_point = $wpdb->escape(strtok($_POST['lm_point'],"()")); $wpdb->query(" INSERT INTO $table(name, cord, email, web, dsc, point) VALUES('$lm_name', '$lm_org', '$lm_email', '$lm_web', '$lm_dsc', '$lm_point') "); } /** * Gmaps markers generation */ function lugmap_markers() { global $wpdb; $table = $wpdb->prefix."lugmap"; $markers = $wpdb->get_results("SELECT point FROM $table"); foreach($markers as $marker) { echo "\t"."var point = new GLatLng(".stripslashes($marker->point).");"."\n"; $point_data = null; //otherwise it will collect the whole world :) $marker_data = $wpdb->get_results("SELECT `name`,`cord`,`email`,`web`,`dsc` FROM `$table` WHERE `point` = '$marker->point'"); foreach($marker_data as $item) { $point_data .= "
web)."\">".js_escape($item->name)."
".js_escape($item->cord)."
".js_escape($item->dsc)."
"; } echo "\t"."var marker = createMarker(point,'$point_data');"."\n"; echo "\t"."map.addOverlay(marker);"."\n\n"; } } /** * Loading meta stuff like js files and etc. */ function lugmap_header() { $lugmap_api_key = get_option('lugmap_api_key'); $lugmap_coord = get_option('lugmap_coord'); ?> '; $output .= '
'; $output .= '
'; $output .= '

'.__("LUG Description","lug-map").' : '.__("Search","lug-map").'

'.__("Required fields are marked with *.","lug-map").'
'; $output .= ''; return $output; } /** * Clean lugmap table */ function lugmap_clean() { global $wpdb; $table = $wpdb->prefix."lugmap"; $wpdb->query("DROP TABLE $table"); lugmap_install(); } /** * Generate widget content */ function lugmap_widget_content() { global $wpdb; $table = $wpdb->prefix."lugmap"; $markers = $wpdb->get_results("SELECT `name`,`web` FROM `$table` ORDER BY `name`"); $content = ''; return $content; } /** * Generate widget */ function lugmap_widget() { register_widget( 'LugMap_Widget' ); } class LugMap_Widget extends WP_Widget { function LugMap_Widget() { /* Widget settings. */ $widget_ops = array( 'classname' => 'lm_widget', 'description' => 'Widget displays LugMap entries.' ); /* Widget control settings. */ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'lm_widget' ); /* Create the widget. */ $this->WP_Widget( 'lm_widget', 'LugMap Widget', $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', $instance['title'] ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo lugmap_widget_content(); echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); return $instance; } function form( $instance ) { $defaults = array( 'title' => 'LugMap' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

prefix."lugmap"; $structure = "CREATE TABLE $table ( id INT(9) NOT NULL AUTO_INCREMENT, name VARCHAR(80) NOT NULL, cord VARCHAR(40) NOT NULL, email VARCHAR(40) NOT NULL, web VARCHAR(1000) NOT NULL, dsc VARCHAR(2000) NOT NULL, point VARCHAR(20) NOT NULL, UNIQUE KEY id (id) );"; $wpdb->query('CHARACTER SET utf8 COLLATE utf8_general_ci'); $wpdb->query($structure); // Populate table $wpdb->query("INSERT INTO $table(name, cord, email, web, dsc, point) VALUES('Grupul pentru software liber', 'Adi Roiban', 'adiroiban@gmail.com', 'http://softwareliber.ro/', 'Grupul pentru software liber s-a conturat la începutul anului 2005 in jurul unor studenți din cadrul Universității Tehnice din Cluj-Napoca. Ținta grupului a fost promovarea software-lui liber în rândurile studenților și profesorilor din facultate și continuarea activitații începute de Igor Știrbu la sfarșitul anului 2004.', '46.776306, 23.60429')"); add_option('lugmap_coord','45.943161,24.96676'); add_option('lugmap_api_key','Please add your Google Maps key'); } //l10n stuff $lugmap_domain = 'lug-map'; $lugmap_domain_path = PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)); load_plugin_textdomain($lugmap_domain,$lugmap_domain_path.'/l10n' ); register_activation_hook(__FILE__,'lugmap_install'); add_action('admin_menu', 'lugmap_admin'); add_action('wp_head', 'lugmap_header'); add_action( 'widgets_init', 'lugmap_widget' ); add_shortcode('LUGMAP', 'lugmap_content'); ?>