/** * Template callback for GeoMashupQuery::list_comments() * * Use the newer form of template, where the individual comment template goes in * a function that matches the callback argument to list_comments * * @since 1.3 * @access public * @package GeoMashup * * @param object $comment The comment to display * @param array $args Arguments from wp_list_comments * @param mixed $depth Nested depth */ function geo_mashup_comment_default($comment, $args, $depth) { // Enable the WordPress comment functions GeoMashupQuery::set_the_comment($comment); // From here to the closing curly brace should look like a familiar template ?> <div id="div-comment-<?php comment_ID(); ?> " class="<?php comment_class(''); ?> "> <div class="comment-author vcard"> <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()); ?> </div> <div class="comment-meta commentmetadata"> <a href="<?php echo esc_html(get_comment_link($comment->comment_ID)); ?> "><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()); ?> </a> </div> <?php comment_text(); ?> </div> <?php }
/** * Template callback for GeoMashupQuery::list_users() * * @since 1.3 * @param object $user The user to display. */ function geo_mashup_user_default_template($user) { GeoMashupQuery::set_the_user($user); ?> <div id="div-user-<?php echo esc_attr($user->ID); ?> " class="vcard"> <div class="fn"> <span class="type"><?php _e('Display Name'); ?> </span>: <span class="value"><?php echo esc_attr($user->display_name); ?> </span> </div> <?php echo GeoMashup::location_info('fields=locality_name,admin_code&format=<div class="adr"><span class="locality">%s</span>, <span class="region">%s</span></div>'); ?> <?php if (isset($user->user_url) && strlen($user->user_url) > 7) { ?> <div class="url"> <span class="type"><?php _e('Website'); ?> </span>: <a class="value" href="<?php echo esc_attr($user->user_url); ?> "><?php echo esc_attr($user->user_url); ?> </a> </div> <?php } ?> </div> <?php }
<?php /** * Respond to Geo Mashup AJAX requests for object locations. * * @since 1.0 * @package GeoMashup */ if (isset($_GET['output']) and 'json' == $_GET['output'] or empty($_GET['object_ids'])) { GeoMashupQuery::generate_location_json(); } else { GeoMashupQuery::generate_object_html(); } /** * Class for query handling namespace * * @since 1.2 * @package GeoMashup * @access public * @static */ class GeoMashupQuery { /** * Strip content in square brackets. * * Shortcodes are not registered in the bare-bones query environments, * but we can strip all bracketed content. * * @since 1.3 *