MyBB Hacks

Full Version: User Map with XThreads?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
(09-03-2011 05:31 AM)RocketFoot Wrote: [ -> ]Oh ok...I thought it would automatically link from this mod.  I don't want to have to make them add even more info...LOL

I think profile page isn't the main XThreads working area. You need to query the data from the custom thread fields if you want it to be automatically.
Ah, ok...I thought it would be something easy like using the code from the firstpost to the profile...LOL!
Do you guys know how I can change the color of the hyper text links in the ballon pop-ups?  I installed a new theme and the links are now not visible!  I can't change the whole forum links as the theme is black and the words have to be white to see.  I just need to alter the user map only!
Try this way:
Edit your Geo Location custom thread fields. Find (in the Display Format, line #1):

Code:
<div><strong><a href=\"'.get_profile_link($thread['uid']).'\">


Change to:

Code:
<div class=\"gmap_if\"><strong><a href=\"'.get_profile_link($thread['uid']).'\">


Add .gmap_if class to your global.css
Something like this:

Code:
.gmap_if a {
	color: green;
}

Excellent!  That is what I needed!

Thanks RateU!!
Update: We will try to use Marker Clusterer Plus to cluster our marker.
  • Download markerclusterer_packed.js from here. Upload it to our /jscripts/ dir/folder.
  • Edit our umap_geol (Geo Location) custom thread fields:
    • Display Format:

      Code:
      <if THIS_SCRIPT != 'forumdisplay.php' then>{VALUE}</if><setvar umap_title>$thread['uid'] ? '<div class=\"gmap_if\"><strong><a href=\"'.get_profile_link($thread['uid']).'\">'.htmlspecialchars_uni($thread['username']).'</a>, <a href=\"'.$threadurl.'\">'.htmlspecialchars_uni($thread['subject']).'</a></strong></div><div class=\"smalltext\"><em>Pinned: '.$thread['threaddate'].', '.$thread['threadtime'].'</em></div>' : '<div><strong>'.htmlspecialchars_uni($mybb->user['username']).', '.htmlspecialchars_uni($mybb->input['subject']).'</strong></div><div class=\"smalltext\"><em>Pinned: '.my_date($mybb->settings['dateformat'], TIME_NOW).', '.my_date($mybb->settings['timeformat'], TIME_NOW).'</em></div>'</setvar><setvar map_msg>'<div><div class=\"float_left\" style=\"margin: 5px;\">'.$GLOBALS['threadfields']['umap_img']['value'].'</div>'.$tplvars['umap_title'].'<br />'.$GLOBALS['threadfields']['umap_desc'].'</div>'</setvar><setvar mymarker>$mybb->user['uid'] ? '<a href="'.$forumurl_q.'filterxt_uid='.intval($mybb->user['uid']).'">Where is my marker?</a>' : ''</setvar><if THIS_SCRIPT == 'forumdisplay.php' then>[{VALUE$1},"<func htmlspecialchars_uni>{$thread['username']}: {$thread['subject']}</func>","{$GLOBALS['tplvars']['map_msg']}","{$threadurl}"],</if>

    • Text Mask Filter:

      Code:
      ^\(((-?)([0-9]*)(?:\.(\d*)), (-?)([0-9]*)(?:\.(\d*)))\)$

  • Edit our umap_threadlist template:

    HTML Code
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$foruminfo['name']} </title>
    {$headerinclude}
    {$rssdiscovery}
    <script type="text/javascript">
    <!--
    	lang.no_new_posts = "{$lang->no_new_posts}";
    	lang.click_mark_read = "{$lang->click_mark_read}";
    // -->
    </script>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/markerclusterer_packed.js"></script>
    <script type="text/javascript">
    var gmarkers = [];
    var map = null;
    var infowindow = new google.maps.InfoWindow();
    var myLatlng = new google.maps.LatLng(0,0);
    function createMarker(latlng,name,html,url) {
    	var contentString = html;
    	var marker = new google.maps.Marker({
    		position: latlng,
    		map: map,
    		title: name
    	});
    	marker.myname = name;
    	gmarkers.push(marker);
    	
    	google.maps.event.addListener(marker, "click", function() {
    		window.location = url;
    	});
    
    	google.maps.event.addListener(marker, "rightclick", function() {
    		infowindow.setContent(contentString); 
    		infowindow.open(map,marker);
    	});
    }
    
    function initialize() {
    	var myOptions = {
    		zoom: 2,
    		center: myLatlng,
    		mapTypeId: google.maps.MapTypeId.ROADMAP
    	}
    	map = new google.maps.Map(document.getElementById('map_threadlist'), myOptions);
    	google.maps.event.addListener(map, 'click', function() {
    		infowindow.close();
    	});
    	var markers = [{$threads}];
    	var mcOptions = {gridSize: 50, maxZoom: 15, title: 'Click to view all pins inside this cluster'};
    	for (i = 0; i < markers.length; i++) {
    		var point = new google.maps.LatLng(markers[i][0],markers[i][1]);
    		var name = markers[i][2];
    		var html = markers[i][3];
    		var url = markers[i][4];
    		var marker = createMarker(point,name,html,url);
    	}	
    	var mc = new MarkerClusterer(map, gmarkers, mcOptions);
    }
    </script>
    </head>
    <body onload="initialize()">
    {$header}
    {$moderatedby}
    {$usersbrowsing}
    {$rules}
    <br class="clear" />
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right">
    	{$newthread}
    </div>
    <br class="clear" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    	<tr>
    		<td class="thead">
    			<div class="float_right"><strong>{$tplvars['mymarker']}</strong></div>
    			<strong>{$foruminfo['name']}</strong>
    		</td>
    	</tr>
    	<tr>
    		<td class="trow1">
    			<div id="map_threadlist" style="width:100%; height:500px"></div>
    		</td>
    	</tr>
    </table>
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right" style="margin-top: 4px;">
    	{$newthread}
    </div>
    <br style="clear: both;" />
    <br />
    
    <div class="float_right" style="text-align: right;">
    	{$inlinemod}
    	{$searchforum}
    	{$forumjump}
    </div>
    <br style="clear: both" />
    <div class="smalltext" style="text-align: center;">
    {$foruminfo['name']}<br />
    Powered By <a href="http://mybbhacks.zingaburga.com/showthread.php?tid=288">XThreads</a> &ndash; <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    {$inline_edit_js}
    {$footer}
    </body>
    </html>

[attachment=655]
http://xtest.byethost7.com/forumdisplay.php?fid=5
When we click the cluster (the blue circle), it will zoom and display all pins inside the cluster.

As an additional features (optional), I've updated the plugin in the example application posts (need to deactivate the previous version first before using the new version).
  • Find $umap_fid under umap_nt() function. Change the value to our XThreads Usermap forum id for limiting the num of pin for each user. By default, it is disabled.
  • Find $umap_fid under umap_run() function. Change the value to our XThreads Usermap forum id for displaying user's location on their profile page. By default, it is disabled.
[attachment=654]
http://xtest.byethost7.com/member.php?ac...http://xtest.byethost7.com/member.php?action=pro

I've updated the example application post, and add the additional screenshots.

Please tell me if there is something wrong with the code above Smile
Hello,
in my forum, when I run the home of usermap, the following appears: -click here-
Can there be a map with all pins can view?
Mfg. Lkwmonster
I can't view your forum.
sorry, the Forum is open now
It would be nice if all the pins on the card with another list would be registered with all persons.
It seems that the Output template start/end comments break it.

Try this way:
Edit your usermap forum, set the Settings Overrides setting:
  • Setting: Output template start/end comments?
  • Value: 0

Code:
tplhtmlcomments=0


(06-06-2012 05:21 AM)Lkwmonster Wrote: [ -> ]It would be nice if all the pins on the card with another list would be registered with all persons.
I can't understand what you mean?
Pages: 1 2 3 4 5 6 7 8 9
Reference URL's