Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Map Grid help

  1. #1
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Map Grid help

    I tried adding the while loop in the function below, but when i view the page, it just sits there and times out.

    PHP Code:
    //Function to display the map.
    function DisplayGrid($grid_x,$grid_y) {
        global 
    $x$y$user_location$users_map;
        
            
    $bgimg 'grass.gif';
            
    $building '';

            
    //Display current user location on the displayable grid if exists.
            
    if ($grid_x == $user_location['x'] &&  $grid_y == $user_location['y']) {
                 
    $building '<img src="images/map/building.gif" alt="" border="0" /><br />';
                 
    $user_map_name '<br /><a href="player_profile.php?id='.$user_location['uID'].'" target="_blank"><u><b>'.$user_location['uLogin'].'</b></u></a><br />';
            }

            
    //Fetch all player locations within the displayable grid.
            
    while($users_map mysql_fetch_array(mysql_query("SELECT * FROM map LEFT JOIN users ON map.uID=users.uID WHERE map.x=$grid_x AND map.y=$grid_y"))){
                
    $building '<img src="images/map/building.gif" alt="" border="0" /><br />';
                
    $user_map_name '<br /><a href="player_profile.php?id='.$users_map['uID'].'" target="_blank"><u><b>'.$users_map['uLogin'].'</b></u></a><br />';
            }
        
        echo 
    "<td width=\"75\" height=\"75\" style=\"background-image: url('images/map/$bgimg');background-repeat: repeat;\" align=center valign=center onclick=\"window.location.href='map.php?xcord=$grid_x&ycord=$grid_y'\">$building $user_map_name</td>";


  • #2
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •