Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.38 veröffentlicht (30.04.24)


Benutzer, die gerade dieses Thema anschauen: 2 Gast/Gäste
Mybb Usermap V3
#16
Hi Jockl,
also egal ob ich den IE FF oder Opera nutze überall das selbe . das gilt sogar wenn ich mein Handy benutze.
Hier einmal mein code
PHP-Code:
<?php

# MyBB Page Manager - Usermap
# Updated for Google Maps JavaScript API v3 by MyBBStyles.com
# Installation instructions and support: http://www.mybbstyles.com/thread-new-page-mybb-google-maps-v3

$key '';
$location 'Germany';
$zoom 6;
$fid 1;
$datacache './cache/coords';


if(!
$mybb->usergroup['canviewprofiles'])
{
    
}
global 
$headerinclude$header$theme$footer$cache$templates;

require_once 
MYBB_ROOT.'inc/class_xml.php';
require_once 
MYBB_ROOT.'inc/functions_image.php';

$contents fetch_remote_file('http://maps.googleapis.com/maps/api/geocode/xml?address=' rawurlencode($location).'&sensor=false');
$parser = new XMLParser($contents);
$tree $parser->get_tree();

if(
$tree['GeocodeResponse']['result']['geometry']['location'])
{
    
$lat $tree['GeocodeResponse']['result']['geometry']['location']['lat']['value'];
    
$lng $tree['GeocodeResponse']['result']['geometry']['location']['lng']['value'];
       
$location = array($lng$lat);
}
else
{
    
$location = array(00);
    
$zoom 2;
}

if(!
file_exists($datacache) || time()-filemtime($datacache) > 82800 || ($mybb->usergroup['cancp'] && intval($mybb->input['update']) == 1))
{
    
$usergroups_cache $cache->read('usergroups');
    
$query $db->simple_select("usertitles""*""", array('order_by' => 'posts''order_dir' => 'DESC'));
    while(
$usertitle $db->fetch_array($query))
    {
        
$usertitles_cache[$usertitle['posts']] = $usertitle;
    }
    
$query $db->query("
        SELECT u.*, f.*
        FROM "
.TABLE_PREFIX."users u
        LEFT JOIN "
.TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
        WHERE f.fid" 
$fid " != ''
        AND u.usergroup NOT IN (5, 7)
    "
);

    
$usercache = array();

    while(
$user $db->fetch_array($query) )
    {
        
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

        
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

        if(!
$user['displaygroup'])
        {
            
$user['displaygroup'] = $user['usergroup'];
        }
        
$usergroup $usergroups_cache[$user['displaygroup']];
        
        if(!empty(
$usergroup['image']))
        {
            if(!empty(
$mybb->user['language']))
            {
                
$language $mybb->user['language'];
            }
            else
            {
                
$language $mybb->settings['bblanguage'];
            }
            
$usergroup['image'] = str_replace("{lang}"$language$usergroup['image']);
            
$usergroup['image'] = str_replace("{theme}"$theme['imgdir'], $usergroup['image']);
            
$usergroup['groupimage'] = '<img src="' $usergroup['image'] . '" alt="' $usergroup['title'] . '" title="' $usergroup['title'] . '" />';
        }

        
$has_custom_title 0;
        if(
trim($user['usertitle']) != "")
        {
            
$has_custom_title 1;
        }

        if(
$usergroup['usertitle'] != "" && !$has_custom_title)
        {
            
$user['usertitle'] = $usergroup['usertitle'];
        }
        elseif(
is_array($usertitles_cache) && !$usergroup['usertitle'])
        {
            foreach(
$usertitles_cache as $posts => $titleinfo)
            {
                if(
$user['postnum'] >= $posts)
                {
                    if(!
$has_custom_title)
                    {
                        
$user['usertitle'] = $titleinfo['title'];
                    }
                    
$user['stars'] = $titleinfo['stars'];
                    
$user['starimage'] = $titleinfo['starimage'];
                    break;
                }
            }
        }

        if(
$usergroup['stars'])
        {
            
$user['stars'] = $usergroup['stars'];
        }

        if(!
$user['starimage'])
        {
            
$user['starimage'] = $usergroup['starimage'];
        }
        
$user['starimage'] = str_replace("{theme}"$theme['imgdir'], $user['starimage']);

        for(
$i 0$i $user['stars']; ++$i)
        {
            
$user['userstars'] .= "<img src=\"".$user['starimage']."\" border=\"0\" alt=\"*\" />";
        }

        if(
$user['userstars'] && $usergroup['groupimage'])
        {
            
$user['userstars'] = "<br />".$user['userstars'];
        }

        if(
$user['avatar'] != '')
        {
            
$user['avatar'] = htmlspecialchars_uni($user['avatar']);
            
$avatar_dimensions explode("|"$user['avatardimensions']);
            
            if(
$avatar_dimensions[0] && $avatar_dimensions[1])
            {
                list(
$max_width$max_height) = explode("x"my_strtolower($mybb->settings['memberlistmaxavatarsize']));
                if(
$avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height)
                {
                    
$scaled_dimensions scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width$max_height);
                    
$avatar_width_height "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
                }
                else
                {
                    
$avatar_width_height "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";    
                }
            }

            
$user['avatar'] = '<img src="' $user['avatar'] . '" alt="" ' $avatar_width_height ' />';
        }
        else
        {
            
$user['avatar'] = "";
        }

        
$html '<table><tr><td>' $user['avatar'] . '</td><td>' $user['profilelink'] . '<br /><span class="smalltext">' $user['usertitle'] . '<br />' $usergroup['groupimage'] . $user['userstars'] . '</span></td></tr></table>';

        
$home strtolower($user['fid' $fid]);
        if(isset(
$usercache[$home]) )
        {
            
$usercache[$home] .= '<hr>'.$html;
        }
        else
        {
            
$usercache[$home] = $html;
        }
    }

    
$coordscache = array();


    foreach(
$usercache as $index => $value)
    {
        
$contents fetch_remote_file('http://maps.googleapis.com/maps/api/geocode/xml?address=' rawurlencode($index).'&sensor=false');
        
$parser = new XMLParser($contents);
        
$tree $parser->get_tree();

        
sleep(1);
        

        if(
$tree['GeocodeResponse']['result']['geometry']['location'])
        {
            
$lat $tree['GeocodeResponse']['result']['geometry']['location']['lat']['value'];
            
$lng $tree['GeocodeResponse']['result']['geometry']['location']['lng']['value'];
            
$loc $lng.",".$lat.",0";

            if(isset(
$coordscache[$loc]))
            {
                
$coordscache[$loc] .= '<hr>'.$value;
            }
            else
            {
                
$coordscache[$loc] = $value;
            }

        }
    }

    
file_put_contents($datacacheserialize($coordscache));
}
else
{
    
$coordscache unserialize(file_get_contents($datacache));
}

$run 1;

foreach(
$coordscache as $index => $value)
{
    
$point explode(','$index);
    
$output .= '

        var point' 
$run ' = new google.maps.LatLng(' $point[1] . ',' $point[0] . ');

        var marker' 
$run ' = new google.maps.Marker({
                        position: point' 
$run ', 
                        map: map,
                        title: ""
                        });

        var infowindow' 
$run ' = new google.maps.InfoWindow({
                        content: "' 
str_replace('"'"'"$value) . '"
                        });

        google.maps.event.addListener(marker' 
$run ', "click", function() {
            infowindow' 
$run '.open(map, marker' $run ')
        });

 
    '
;
    
$run++;
}


$template '<html>
<head>
<title>' 
$pages['name'] . '</title>
{$headerinclude}
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=' 
$key '&amp;sensor=false">
    </script>
    <script type="text/javascript">
      function initialize() {
        var myOptions = {
          center: new google.maps.LatLng(' 
$location[1] . ',' $location[0] . '),
          zoom: ' 
$zoom ',
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    {$output}
      }
    </script>
</head>
 <body onload="initialize()">
{$header}
<table border="0" cellspacing="' 
$theme['borderwidth'] . '" cellpadding="' $theme['tablespace'] . '" class="tborder">
<tbody>
<tr>
<td class="trow1" style="padding: 0;"><div id="map_canvas" style="width:100%; height:500px"></div></td>
</tr>
</tbody>
</table>
<br />
{$footer}
</body>
</html>'
;

$template str_replace("\'""'"addslashes($template));

add_breadcrumb($pages['name']);

eval(
"\$page = \"" $template "\";");

output_page($page);

?>

Ich gehe irgendwie davon aus das es ein rechte Problem gibt .
Denn der Firebug schmeißt mir zwar keine Fehler aus aber laut firebug gibt es an der Stelle nur einen kleinen Code der Rest wird nicht geladen .
das einzigste was geladen wird ist :
PHP-Code:
<div style="width:100%; height:500px" id="map_canvas"></div

Ich glaube das es ein rechte Problem ist denn wenn ich als normal registrierter besucher mir die Seite anschauen möchte kommt nur der Fehler " Sie sind nicht berechtigt etc..."
Könnte es evtl . hiermit zu tun haben ?:
PHP-Code:
<?php

# MyBB Page Manager - Usermap
# Updated for Google Maps JavaScript API v3 by MyBBStyles.com
# Installation instructions and support: http://www.mybbstyles.com/thread-new-page-mybb-google-maps-v3

$key '';
$location 'Germany';
$zoom 6;
$fid 1;
$datacache './cache/coords';


if(!
$mybb->usergroup['canviewprofiles'])
{
    

Zitieren


Nachrichten in diesem Thema
Mybb Usermap V3 - von taccodip - 08.01.2014, 17:32
RE: Mybb Usermap V3 - von Jockl - 08.01.2014, 18:00
RE: Mybb Usermap V3 - von taccodip - 08.01.2014, 22:35
RE: Mybb Usermap V3 - von MrBrechreiz - 09.01.2014, 00:12
RE: Mybb Usermap V3 - von taccodip - 10.01.2014, 13:57
RE: Mybb Usermap V3 - von Jockl - 10.01.2014, 20:27
RE: Mybb Usermap V3 - von taccodip - 11.01.2014, 00:30
RE: Mybb Usermap V3 - von Jockl - 11.01.2014, 18:04
RE: Mybb Usermap V3 - von Lennart Sauter - 15.01.2014, 22:44
RE: Mybb Usermap V3 - von taccodip - 15.01.2014, 23:56
RE: Mybb Usermap V3 - von Jockl - 16.01.2014, 00:09
RE: Mybb Usermap V3 - von taccodip - 16.01.2014, 14:08
RE: Mybb Usermap V3 - von Jockl - 17.01.2014, 00:00
RE: Mybb Usermap V3 - von taccodip - 19.04.2014, 01:09
RE: Mybb Usermap V3 - von Jockl - 19.04.2014, 12:54
RE: Mybb Usermap V3 - von taccodip - 19.04.2014, 13:53
RE: Mybb Usermap V3 - von Jockl - 19.04.2014, 16:27
RE: Mybb Usermap V3 - von taccodip - 20.04.2014, 01:24

Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
Question Mybb Usermap V3 ?? Mario4774 1 1.417 01.07.2014, 03:36
Letzter Beitrag: Jockl