Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2006, 07:08 AM
twobob's Avatar
twobob twobob is offline
 
Join Date: Mar 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MOD for html/ajax in post?

Hi Guys. I'd like to have this html appear within a post - not as "code" but so the googlemap that it refers to appears within the post.

Is there a MOD that I can use to allow this? Or is there something more simpler that I can do?

Very much a newbie with this, so any guidance would be appreciated.

The code that I'd like to insert into a post would be:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
<title>Simple Google map - API for pubcrawlforum</title> 
<!-- //Change the following line to use your own key available from http://www.google.com/apis/maps/signup.html -->
<script src="http://maps.google.com/maps?file=api&v=1&key=REPLACE_WITH-YOUR-GOOGLEMAPS-API-CODE-HERE" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
// Google Map Maker script v.1.1
// (c) 2006 Richard Stephenson http://www.donkeymagic.co.uk
// Email: donkeymagic@gmail.com
// Documentation available at http://www.donkeymagic.co.uk/googlemap/
var map;
var icon0;
var newpoints = new Array();
 
function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function'){ 
		window.onload = func
	} else { 
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
 
addLoadEvent(loadMap);
addLoadEvent(addPoints);
 
function loadMap() {
	map = new GMap(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
 
	map.centerAndZoom(new GPoint( -0.07995128631591797, 51.50657887273498), 2);
 
	icon0 = new GIcon();
	icon0.image = "http://www.google.com/mapfiles/marker.png";
	icon0.shadow = "http://www.google.com/mapfiles/shadow50.png";
	icon0.iconSize = new GSize(20, 34);
	icon0.shadowSize = new GSize(37, 34);
	icon0.iconAnchor = new GPoint(9, 34);
	icon0.infoWindowAnchor = new GPoint(9, 2);
	icon0.infoShadowAnchor = new GPoint(18, 25);
}
 
function addPoints() {
 
	newpoints[0] = new Array(-0.07797718048095703, 51.50850206542486, icon0, 'First Stop - The Tower of London', '<div id="popup">This is your first stop on this walk.  You get can details about the Tower of London from http://www.toweroflondontour.com/</div>'); 
	newpoints[1] = new Array(-0.07527351379394531, 51.50577751848878, icon0, 'Second Stop - Tower Bridge', '<div id="popup">Half way across this bridge is the entrance to the Tower Bridge Exhibition.  Great view from the top!<br />http://www.towerbridge.org.uk/TowerBridge/English</div>'); 
	newpoints[2] = new Array(-0.07351398468017578, 51.503400084633526, icon0, '3rd Stop - Shad Thames', '<div id="popup">This area used to be where all the ships unloaded their supplies to be sold to the people of London.  The wharf's have been restorated and are now some of the trendiest cafes, restuarants and bars in town.  Definately worth a break for a beer here!</div>'); 
	newpoints[3] = new Array(-0.08244037628173828, 51.50409462869737, icon0, 'The London Dungeons!', '<div id="popup">The London Dungeons are one of the most popular tourist attractions in London.  Check it out, the kids will love it!  http://www.thedungeons.com/</div>'); 
 
	for(var i = 0; i < newpoints.length; i++) {
 
		var point = new GPoint(newpoints[i][0],newpoints[i][1]);
 
		//Add overlay to map 
		var popuphtml = newpoints[i][4] ;
		var marker = createMarker(point,newpoints[i][2],popuphtml);
		map.addOverlay(marker);
	}
}
 
function createMarker(point, icon, popuphtml) {
	var marker = new GMarker(point, icon);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(popuphtml);
	});
	return marker;
}
 
//]]>
</script>
 
<style>
div#popup {
background:#EFEFEF;
border:1px solid #999999;
margin:0px;
padding:7px;
width:270px;
}
</style>
</head>
<body>
<div id="map" style="width:600px;height:450px"></div>
</body>
</html>
If you want to try this on your own site, insert your own googlemaps api code which you can get from here ... http://www.google.com/apis/maps/signup.html

Thanks again! Twobob
Reply With Quote
  #2  
Old 05-20-2006, 07:32 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This should help: https://vborg.vbsupport.ru/showthrea...highlight=HTML
Reply With Quote
  #3  
Old 05-20-2006, 12:11 PM
twobob's Avatar
twobob twobob is offline
 
Join Date: Mar 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Livewire! I'll check it out. Cheers .... twobob

PS Could I use all that html code, or would I have to drop some of it to prevent conflicts???
Reply With Quote
  #4  
Old 05-20-2006, 01:36 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would have to drop the head & body stuff.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03776 seconds
  • Memory Usage 2,194KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete