Welcome, Guest. Please Login or Register.
November 21, 2024, 08:27:25 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  YaBB SE Info  |  News From the YaBB SE Team  |  yabb.info Member Map « previous next »
Pages: 1 ... 9 10 [11] 12 13 14 Reply Ignore Print
Author Topic: yabb.info Member Map  (Read 262730 times)
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #150 on: July 12, 2002, 05:25:57 PM »
Reply with quote

Just a thing ....

I have seen that this way it's open in another page but still inside the forum ... I mean the template ...

If I wanted to open it in another page but just the map as here in Yabb.info ??

Thanks, Andrea
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #151 on: July 12, 2002, 05:27:51 PM »
Reply with quote

It won't do that for you, I altered WorldMap.php so it would do that. Just do what I say and it will be just like the one here.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #152 on: July 12, 2002, 05:33:06 PM »
Reply with quote


No fear, I will manage that.

For sure !!

 ;D

Thanks !!

Andrea


Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #153 on: July 12, 2002, 05:36:23 PM »
Reply with quote

Glad to help, if you need anything else, just ask.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #154 on: July 12, 2002, 08:25:48 PM »
Reply with quote


Ok Chris ... I have thought about it ...

I really would likt to have my map open inside the template of the forum and not outside.

It's really weird since when I was trying to make it work (I had the name of the function in worldmap.php set wrong) it tried to open inside the template ....

... but then when I correctly stated the name of the function and it did run .... well ... it ran in the same IE window but in a blank page .....


How can I set it to run inside the template ??

Do I have to modify the index.php ?


Please gimme some tips !  ;D

Thanks a lot,


Andrea

Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #155 on: July 12, 2002, 10:31:58 PM »
Reply with quote

To make it display inside the template you are going to have to add 3 functions to WorldMap.php

Here is what my edited WorldMap.php file looks like:

<?php

/**
 * Short description. 
 *
 * Detail description
 * @param      none
 * @global     none
 * @since      1.0
 * @access     private
 * @return     void
 * @update     date time
*/

function WorldMap()
{
   global 
$imagesdir$ID_MEMBER$db_prefix,$HTTP_GET_VARS$settings;
        
template_header();
   if (
$HTTP_GET_VARS['t'] == && $settings[7] != 'Administrator')
      
$HTTP_GET_VARS['t'] = 0;

   if (
$HTTP_GET_VARS['t'] == && $ID_MEMBER==-1)
      
$HTTP_GET_VARS['t'] = 0;

   if (
$HTTP_GET_VARS['t'] == 0)
   {
      if (isset (
$HTTP_GET_VARS['submitted']) && $HTTP_GET_VARS['submitted'] && $ID_MEMBER != -1)
      {
         
$request mysql_query ("SELECT * FROM {$db_prefix}world_map WHERE ID_MEMBER=$ID_MEMBER");
         if (
mysql_num_rows($request) > 0)
            
$request mysql_query ("UPDATE {$db_prefix}world_map SET xPos=$HTTP_GET_VARS[map_x], yPos=$HTTP_GET_VARS[map_y] WHERE ID_MEMBER=$ID_MEMBER");
         else
            
$request mysql_query ("INSERT INTO {$db_prefix}world_map (ID_MEMBER,xPos,yPos) VALUES($ID_MEMBER$HTTP_GET_VARS[map_x]$HTTP_GET_VARS[map_y])");
      }       
   }

   if (
$ID_MEMBER == -1)
   {
      print 
"<font face=verdana,size=1><center><img src=\"http://yapp.phpworld.net/worldmap_image.php\"></center>";
   }
   else
   {
      if (
$settings[7] == 'Administrator')
      {
         
$adminTxt " &nbsp;&nbsp;&nbsp; <input type=radio name=t value=2>Delete Pin";
          
      }
      print 
"<font face=verdana,size=1><form action=\"$scripturl\" method=get><input type=hidden name=action value=\"worldmap\"><center><input type=image src=\"http://yapp.phpworld.net/worldmap_image.php?me=$ID_MEMBER&t=$HTTP_GET_VARS[t]&x=$HTTP_GET_VARS[map_x]&y=$HTTP_GET_VARS[map_y]\" name=map onclick=\"submit()\" style=\"cursor:crosshair\"><br> <input type=radio name=t value=1 checked>Who is this? &nbsp;&nbsp;&nbsp; <input type=radio name=t value=0>Place My Pin$adminTxt</center><input type=hidden name=submitted value=1></form>";
   }

   print <<<EOT
      The most recent pin addition is hilighted by a blue circle, and your location is indicated by a blue pin.  The above image is a PNG, if you can't see it, your browser may not support the PNG file type. The member map is a map of all the members who are registered and who have indicated their position on the world map.  If you haven't yet placed yourself, click on the map above to place your pin.  You can move your pin around at any time.  Also, you can only place a pin if you are a registered member and are logged in.
      </font>
EOT;
        
footer();
   
obExit();
}
//end func
?>

As you can see I added template_header(); to the beginning of it. and at the end of it I added footer(); and obExit();

Just add those 3 function calls to yours and it will make it load with the template.(don't use this code above since it has my site's specific stuff in it for the urls of the image.) Be sure to add them in the same place that I put them in this example.

Hope this helps.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #156 on: July 12, 2002, 11:21:31 PM »
Reply with quote

Hey Chris !!!

THANKS !!

I really appreciated, thanks for sharing.

I have put the 3 tags, actually I already had the "obExit();" one.

It works !!


Ok, the close javascript button had not sense anymore, so I changed it to a more useful ..

<a href="$scripturl">


Just to take the user back to main menu, that's it ....

 ;D


That's all I have added .. and it's ready to roll as soon as my host get GD on the website ....

 :D


Thanks again, you are a great guy !!


powergen

« Last Edit: July 12, 2002, 11:23:25 PM by powergen » Logged
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #157 on: July 17, 2002, 03:41:08 PM »
Reply with quote

Dear friends ....

unfortunately .... after my host gently installed the GD Library and also updated php and MySQL ....

After, I think, having correctly installed all files ... I still get the ugly "no pic" image from Internet Explorer ....

 :-[

What could be wrong ??

Here's again my phpinfo and my link to the forum action command.....


http://www.betasom.it/phpinfo.php


http://www.betasom.it/forum/?action=betasommap


I really do not know what is wrong ... I modified index.php, Subs.php, the image, all appears to be properly set.....

But it doesn't work.


Could you give me a tip, a hint .... a guess ??

Thanks a lot for any help,


Andrea


Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #158 on: July 17, 2002, 03:50:04 PM »
Reply with quote

Well first off the link needs to be action=worldmap not action=betasommap like you have. Second, I have both the WorldMap.php and the worldmap_image.php file in the main directory with the settings.php file. I can see that you have it in the Sources directory which is probably why the image isn't loading.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #159 on: July 17, 2002, 04:01:00 PM »
Reply with quote

Thanks for the fast reply !

Ok, I have changed all ..

I have set action=betasommap

since it's not anymore a World Map ...


And also those links ....


Here we go ......... sorry to post all this ........

<?php


/**
 * Short description. 
 *
 * Detail description
 * @param      none
 * @global     none
 * @since      1.0
 * @access     private
 * @return     void
 * @update     date time
*/

function BetasomMap_0()
{
   global $scripturl,$imagesdir,$sourcedir$ID_MEMBER$db_prefix,$HTTP_GET_VARS$settings;
       
template_header();
   if ($HTTP_GET_VARS['t'] == && $settings[7] != 'Administrator')
      $HTTP_GET_VARS['t'] = 0;

   if ($HTTP_GET_VARS['t'] == && $ID_MEMBER==-1)
      $HTTP_GET_VARS['t'] = 0;

   if ($HTTP_GET_VARS['t'] == 0)
   {
      if (isset ($HTTP_GET_VARS['submitted']) && $HTTP_GET_VARS['submitted'] && $ID_MEMBER != -1)
      {
         $request mysql_query ("SELECT * FROM {$db_prefix}betasom_map_0 WHERE ID_MEMBER=$ID_MEMBER");
         if (mysql_num_rows($request) > 0)
            $request mysql_query ("UPDATE {$db_prefix}betasom_map_0 SET xPos=$HTTP_GET_VARS[map_x], yPos=$HTTP_GET_VARS[map_y] WHERE ID_MEMBER=$ID_MEMBER");
         else
            $request 
mysql_query ("INSERT INTO {$db_prefix}betasom_map_0 (ID_MEMBER,xPos,yPos) VALUES($ID_MEMBER$HTTP_GET_VARS[map_x]$HTTP_GET_VARS[map_y])");
      }       
   
}

   if ($ID_MEMBER == -1)
   {
      print "<font face=verdana size=1><center><img src=\"$sourcedir/BetasomMap_Image_0.php\"></center>";    
   }
   else
   
{
      if ($settings[7] == 'Administrator')
      {
         $adminTxt " &nbsp;&nbsp;&nbsp; <input type=radio name=t value=2>Cancella puntina";
          
      
}
      print "<font face=verdana size=1><form action=\"$scripturl\" method=get><input type=hidden name=action value=\"betasommap\"><center><input type=image src=\"$sourcedir/BetasomMap_Image_0.php?me=$ID_MEMBER&t=$HTTP_GET_VARS[t]&x=$HTTP_GET_VARS[map_x]&y=$HTTP_GET_VARS[map_y]\" name=map onclick=\"submit()\" style=\"cursor:crosshair\"><br> <input type=radio name=t value=1 checked>Chi è questo ? &nbsp;&nbsp;&nbsp; <input type=radio name=t value=0>Attacca la mia puntina$adminTxt</center><input type=hidden name=submitted value=1></form>";    
   }
   
   print 
<<<EOT
      L'ultima puntina affissa è evidenziata con un cerchio blu, la tua posizione è invece evidenziata con una puntina blu.  L'immagine sopra è in formato PNG, se non riesci a vederla può essere a causa del tuo browser che non supporta i file di formato PNG.  La Mappa Membri Betasom è una cartina che riporta i membri che sono registrati al Forum e che hanno indicato la loro posizione.  Se non lo hai ancora fatto, fai click sulla cartina qui sopra per porre la tua puntina.  Potrai spostarla in qualsiasi momento.  Puoi apporre una puntina solo se sei un Membro registrato del Forum e hai effettuato il login.<p align=right><a href="$scripturl">Ripiega Mappa</a>
   </font>
      
EOT;
       
footer();
   obExit();
}
//end func
?>



and the second one



<?

$dbcon = mysql_connect(XXX, 'XXX', 'XXX');
mysql_select_db(XXX');

$db_prefix = 'yabbse_';

$im = @imagecreatefrompng("http://www.betasom.it/pics/forum/italia.png"); /* Attempt to open */

$request = mysql_query("SELECT * FROM {$db_prefix}betasom_map_0");

$red = imagecolorallocate ($im, 255, 0, 0);
$darkred = imagecolorallocate ($im, 100, 0, 0);
$grey = imagecolorallocate ($im, 165, 165, 165);
$pink = imagecolorallocate ($im, 255, 195, 195);
$black = imagecolorallocate ($im, 0, 0, 0);
$blue = imagecolorallocate ($im, 0, 0, 200);
$darkblue = imagecolorallocate ($im, 0, 0, 80);
$lightblue = imagecolorallocate ($im, 195, 195, 255);
$white = imagecolorallocate ($im, 255, 255, 255);

if (!isset($x))
   $x = -100;
if (!isset($y))
   $y = -100;


$count = mysql_num_rows($request);
$labelX = -100;
$labelY = -100;
$labelID = -1;

while ($row = mysql_fetch_array($request))
{
   $count --;
   imagesetpixel ($im, $row['xPos'],$row['yPos'],$red);

   if (isOnPin($row['xPos'],$row['yPos'], $x, $y))
   {
      $labelX = $row['xPos'];
      $labelY = $row['yPos'];
      $labelID = $row['ID_MEMBER'];
      if ($t != 2)
      {
         if ($count == 0)
            imagearc ($im, $row['xPos'],$row['yPos'], 9, 9, 0, 360, $blue);
         drawPin ($im, $row['xPos'],$row['yPos'], $me==$row['ID_MEMBER']);          
      }
      else // delete the pin
      {
         $request2 = mysql_query("DELETE FROM {$db_prefix}betasom_map_0 WHERE ID_MEMBER=$row[ID_MEMBER]");
      }
   }
   else
   {
      if ($count == 0)
         imagearc ($im, $row['xPos'],$row['yPos'], 9, 9, 0, 360, $blue);
      drawPin ($im, $row['xPos'],$row['yPos'], $me==$row['ID_MEMBER']);
   }
}

if ($t==1)
{
    $request2 = mysql_query("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER=$labelID");
   if (mysql_num_rows($request2) > 0)
   {
      $row2 = mysql_fetch_array($request2);
   }
   drawAlphaFilledBox ($im, ($labelX+6), ($labelY-19), ($labelX + (strlen($row2['realName']) * 6) + 9), ($labelY-3), $white, .5);
   imagerectangle ($im, ($labelX+6), ($labelY-19), ($labelX + (strlen($row2['realName']) * 6) + 9), ($labelY-3), $black);
   imagestring ($im,2,$labelX+8,$labelY-17,$row2['realName'],$blue);             
}

$numPins = mysql_num_rows($request);

imagestring ($im,2,0,0,"Vi sono $numPins puntine",$blue);

imagepng ($im);

imagedestroy($im);


/**
 * Short description.
 *
 * Detail description
 * @param      none
 * @global     none
 * @since      1.0
 * @access     private
 * @return     void
 * @update     date time
*/
function drawPin($img, $x, $y, $me=false)
{
   global  $red, $pink, $darkred, $black, $grey, $blue, $darkblue, $lightblue;
   
   if ($me) {
      imageline ($img, $x+1,$y-2,$x+2,$y-2,$blue);
      imageline ($img, $x,$y-3,$x+3,$y-3,$blue);
      imagesetpixel ($img, $x+1,$y-4,$blue);

      imageline ($img, $x+2,$y-5,$x+4,$y-5,$blue);
      imageline ($img, $x+2,$y-6,$x+4,$y-6,$blue);
      imageline ($img, $x+3,$y-7,$x+4,$y-7,$blue);

      imagesetpixel ($img, $x+2,$y-4,$lightblue);
      imagesetpixel ($img, $x+3,$y-6,$lightblue);

      imagesetpixel ($img, $x,$y-2,$darkblue);
      imagesetpixel ($img, $x+3,$y-2,$darkblue);
      imagesetpixel ($img, $x+2,$y-5,$darkblue);
      imagesetpixel ($img, $x+4,$y-4,$darkblue);
      imagesetpixel ($img, $x+5,$y-6,$darkblue);        
   }
   else
   {
      imageline ($img, $x+1,$y-2,$x+2,$y-2,$red);
      imageline ($img, $x,$y-3,$x+3,$y-3,$red);
      imagesetpixel ($img, $x+1,$y-4,$red);

      imageline ($img, $x+2,$y-5,$x+4,$y-5,$red);
      imageline ($img, $x+2,$y-6,$x+4,$y-6,$red);
      imageline ($img, $x+3,$y-7,$x+4,$y-7,$red);

      imagesetpixel ($img, $x+2,$y-4,$pink);
      imagesetpixel ($img, $x+3,$y-6,$pink);

      imagesetpixel ($img, $x,$y-2,$darkred);
      imagesetpixel ($img, $x+3,$y-2,$darkred);
      imagesetpixel ($img, $x+2,$y-5,$darkred);
      imagesetpixel ($img, $x+4,$y-4,$darkred);
      imagesetpixel ($img, $x+5,$y-6,$darkred);
   }

   imagesetpixel ($img, $x,$y-1,$grey);

   imageline ($img, $x,$y,$x+1,$y,$black);
   imageline ($img, $x+1,$y-1,$x+3,$y-1,$black);
   imageline ($img, $x+4,$y-2,$x+4,$y-3,$black);
   imagesetpixel ($img, $x+3,$y-4,$black);
   imagesetpixel ($img, $x+5,$y-5,$black);
   
} // end func


/**
 * Short description.
 *
 * Detail description
 * @param      none
 * @global     none
 * @since      1.0
 * @access     private
 * @return     void
 * @update     date time
*/
function isOnPin($pinX, $pinY, $pointX, $pointY)
{
   if ($pointX < $pinX || $pointY > $pinY || $pointX > $pinX+5 || $pointY < $pinY-7)
   {
      return false;
   }
   else
   {
      if (($pointX==$pinX || $pointX == $pinX+1) && $pointY <= $pinY && $pointY >= ($pinY-3))
         return true;

      if ($pointX > $pinX && $pointX < ($pinX+4) && $pointY < $pinY && $pointY >= ($pinY-4))
         return true;

      if (($pointX==$pinX+3 || $pointX == $pinX+4) && $pointY <= ($pinY-2) && $pointY >= ($pinY-7))
         return true;

      if ($pointX >= ($pinX+2) && $pointX < ($pinX+5) && $pointY <= ($pinY-5) && $pointY >= ($pinY-6))
         return true;

      return false;
   }
   
} // end func


/**
 * Short description.
 *
 * Detail description
 * @param      none
 * @global     none
 * @since      1.0
 * @access     private
 * @return     void
 * @update     date time
*/
function drawAlphaFilledBox(&$im, $x1, $y1, $x2, $y2, $col, $trans)
{
   for ($i = $x1; $i <= $x2; $i++)
   {
      for ($k = $y1; $k <= $y2; $k++)
      {
         $ttt = imagecolorat ($im, $i, $k);
         $rgb1 = imagecolorsforindex ($im, imagecolorat ($im, $i, $k));
         $rgb2 = imagecolorsforindex ($im, $col);

         $red1 = ((1-$trans) * $rgb2['red']) + ($trans * $rgb1['red']);
         $green1 = ((1-$trans) * $rgb2['green']) + ($trans * $rgb1['green']);
         $blue1 = ((1-$trans) * $rgb2['blue']) + ($trans * $rgb1['blue']);

         $newCol = imagecolorresolve ($im, $red1, $green1, $blue1);

         imagesetpixel ($im, $i, $k, $newCol);
      }        
    }
} // end funcdraw
?>




What do you think Chris ?


 ::)


« Last Edit: July 17, 2002, 04:05:46 PM by powergen » Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #160 on: July 17, 2002, 04:05:20 PM »
Reply with quote

You might want to edit that post, it contains your password.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #161 on: July 17, 2002, 04:06:31 PM »
Reply with quote

Just done !!!

My God !!!

I'm so dumb ....................


Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:yabb.info Member Map
« Reply #162 on: July 17, 2002, 04:09:40 PM »
Reply with quote

I don't really see anything wrong with it(on a fast inspection). I am not sure why it isn't working.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #163 on: July 17, 2002, 04:12:40 PM »
Reply with quote


How could I verify that GD is really working ?

Or whatever ?


 :-\
Logged
powergen
Full Member
***
Posts: 131


I'm NOT a llama!

ICQ - 133158581 WWW
Re:yabb.info Member Map
« Reply #164 on: July 17, 2002, 04:30:28 PM »
Reply with quote

Maybe I have got the clue ...


Logged
Pages: 1 ... 9 10 [11] 12 13 14 Reply Ignore Print 
YaBB SE Community  |  YaBB SE Info  |  News From the YaBB SE Team  |  yabb.info Member Map « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.024 seconds with 20 queries.