Plugin Directory

Changeset 737


Ignore:
Timestamp:
02/17/2005 02:24:19 PM (22 years ago)
Author:
ringmaster
Message:

Added GoogleMaps (thanks to Pete @ rasterweb.net)
Now using add_options_page(..., menu_hook)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geo/trunk/geo.php

    r641 r737  
    5656        function options_page_geo()
    5757        /**
    58         * Short Description for the Function, one line, end w/ period.
     58        * Displays the Options admin interface for the plugin.
    5959        *
    6060        * Long description for the Function.
    … …  
    193193       
    194194        </div>
    195         <?
     195        <?php
    196196        }
    197197       
    198198        function prepare_database()
    199199        /**
    200         * Short Description for the Function, one line, end w/ period.
     200        * Moves WordPress 1.2 geo info to meta fields.
    201201        *
    202202        * Long description for the Function.
    … …  
    237237        function add_options()
    238238        /**
    239         * Short Description for the Function, one line, end w/ period.
     239        * Adds the options required for geo info
    240240        *
    241241        * Long description for the Function.
    … …  
    252252        function edit_form_advanced($not_used)
    253253        /**
    254         * Short Description for the Function, one line, end w/ period.
     254        * Displays the Geo interface on the post editing form
    255255        *
    256256        * Long description for the Function.
    … …  
    283283        function admin_head($not_used)
    284284        /**
    285         * Short Description for the Function, one line, end w/ period.
     285        * Outputs support javascript to admin console and prepares the databse.
    286286        *
    287287        * Long description for the Function.
    … …  
    315315        function update_post($id)
    316316        /**
    317         * Short Description for the Function, one line, end w/ period.
     317        * Updates the geo info for a post when the post is updated.
    318318        *
    319319        * Long description for the Function.
    … …  
    328328        function wp_head($not_used)
    329329        /**
    330         * Short Description for the Function, one line, end w/ period.
     330        * Outputs the geo info as meta tags in the blog head.
    331331        *
    332332        * Long description for the Function.
    … …  
    362362        function logErrors($msg)
    363363        /**
    364         * Short Description for the Function, one line, end w/ period.
     364        * Simple error logging function for debugging.
    365365        *
    366366        * Long description for the Function.
    … …  
    378378        function admin_menu($not_used)
    379379        /**
    380         * Short Description for the Function, one line, end w/ period.
     380        * Adds the Geo Info menu to the Options tab in the admin menu.
    381381        *
    382382        * Long description for the Function.
    … …  
    385385        */
    386386        {
    387                         add_options_page(__('Geo Location Manager', 'Geo'), __('Geo Info', 'Geo'), 5, 'geo.php');
     387                add_options_page(__('Geo Location Manager', 'Geo'), __('Geo Info', 'Geo'), 5, basename(__FILE__), array('Geo', 'options_page_geo'));
     388                //add_submenu_page('index.php', __('Geo Location Manager', 'Geo'), __('Geo Info', 'Geo'), 5, basename(__FILE__), array('Geo', 'options_page_geo'));
    388389        }
    389390
    … …  
    399400add_action('publish_post', array('Geo', 'update_post'));
    400401add_action('admin_menu', array('Geo', 'admin_menu'));
    401 add_action('options_page_geo', array('Geo', 'options_page_geo'));
    402 
    403402
    404403function pingGeoURL($blog_ID)
    405404/**
    406 * Short Description for the Function, one line, end w/ period.
     405* Pings geourl.org with blog page ID.
    407406*
    408407* Long description for the Function.
    … …  
    419418function get_Lat()
    420419/**
    421 * Short Description for the Function, one line, end w/ period.
     420* Returns the latitude setting for a post.
    422421*
    423422* Long description for the Function.
    … …  
    440439function get_Lon()
    441440/**
    442 * Short Description for the Function, one line, end w/ period.
     441* Returns the longitude setting for a post.
    443442*
    444443* Long description for the Function.
    … …  
    461460function the_Lat()
    462461/**
    463 * Short Description for the Function, one line, end w/ period.
     462* Outputs the latitude for a post.
    464463*
    465464* Long description for the Function.
    … …  
    479478function the_Lon()
    480479/**
    481 * Short Description for the Function, one line, end w/ period.
     480* Outputs the longitude for a post.
    482481*
    483482* Long description for the Function.
    … …  
    499498function geo_PopUpScript()
    500499/**
    501 * Short Description for the Function, one line, end w/ period.
     500* Outputs the popup javascript used by the dropdown popup-er.
    502501*
    503502* Long description for the Function.
    … …  
    519518function geo_urls($lat = '', $lon = '')
    520519/**
    521 * Short Description for the Function, one line, end w/ period.
     520* Returns an array of named URLs for the llat and lon specified.
    522521*
    523522* Long description for the Function.
    … …  
    538537                'FindU' => array("http://www.findu.com/cgi-bin/near.cgi?lat={$lat}&amp;lon={$lon}&amp;scale=100000&amp;zoom=50&amp;type=1&amp;icon=0&amp;&amp;scriptfile=http://mapserver.maptech.com/api/espn/index.cfm", __('FindU near here', 'Geo')),
    539538                'MapTech' => array("http://mapserver.maptech.com/api/espn/index.cfm?lat={$lat}&amp;lon={$lon}", __('Maptech near here', 'Geo')),
     539                'GoogleMaps' => array("http://maps.google.com/maps?ll={$lat}%2C{$lon}", __('Google Maps', 'Geo')),
    540540        );
    541541
    … …  
    545545function geo_UrlPopNav()
    546546/**
    547 * Short Description for the Function, one line, end w/ period.
     547* Creates a dropdown popup-er for viewing geo sites for a post's lat/long.
    548548*
    549549* Long description for the Function.
    … …  
    698698        echo get_geo_url('MapTech');
    699699}
     700
     701function the_GoogleMap_Url() {
     702/**
     703* Outputs a URL to Google Maps for the current geo coordinates.
     704*
     705* Long description for the Function.
     706*
     707*/
     708        echo get_geo_url('GoogleMaps');
     709}
     710
    700711
    701712function geo_distance($lat1, $lon1, $lat2, $lon2, $unit = 'm' )
Note: See TracChangeset for help on using the changeset viewer.