Welcome, Guest. Please Login or Register.
November 23, 2017, 05:18:53 PM
Home Help Search Login Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

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


I'm NOT a llama!


WWW
Re:yabb.info Member Map
« Reply #165 on: July 17, 2002, 11:43:58 AM »
Reply with quote


By itself it works ...

http://www.betasom.it/forum/Sources/BetasomMap_Image_0.php
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 #166 on: July 17, 2002, 11:45:50 AM »
Reply with quote

Move it from the sources directory to the forum directory and change all the links in the source to point to it in the forum directory instead.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!


WWW
Re:yabb.info Member Map
« Reply #167 on: July 17, 2002, 12:49:35 PM »
Reply with quote

Chris, did you get my email yesterday?

Thanks, Moya
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
powergen
Full Member
***
Posts: 131


I'm NOT a llama!


WWW
Re:yabb.info Member Map
« Reply #168 on: July 17, 2002, 01:39:52 PM »
Reply with quote

Chris I have found the problem.

It's all fault of the $sourcedir variable that does work well ....

.... but just for scripts ...

In the <img src= .... > tag you have to put the clear path to the second php file ...

I have just used another variable for doing that and that's it !


;D

Thanks for your help !!

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 #169 on: July 17, 2002, 01:52:28 PM »
Reply with quote

That is the reason I told you to change it. The sourcedir var has the directory of it not the url.
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!


WWW
Re:yabb.info Member Map
« Reply #170 on: July 17, 2002, 04:07:36 PM »
Reply with quote


hehehe, thanks Chris .....


Next time I'll listen to you just from the start !!

The point is that I really like to understand things on my own ...

I know I have asked help ... but just after the first tip, I really want to scour and find the why underneath ...


::)

Logged
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!


WWW
Re:yabb.info Member Map
« Reply #171 on: July 26, 2002, 08:38:55 PM »
Reply with quote

I'm having a small problem with the member map and YaPP... perhaps Chris or Jedi can find the problem?

I created a page in Admin (index.php?page=map) that looks like this:

Code: [Select]
global $imagesdir, $ID_MEMBER, $db_prefix, $HTTP_GET_VARS, $settings;
   if ($HTTP_GET_VARS['t'] == 2 && $settings[7] != 'Administrator')
      $HTTP_GET_VARS['t'] = 0;

   if ($HTTP_GET_VARS['t'] == 1 && $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 pre_world_map WHERE ID_MEMBER=$ID_MEMBER");
         if (mysql_num_rows($request) > 0)
            $request = mysql_query ("UPDATE pre_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 pre_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=\"worldmap_image.php\"></center>";    
   }
   else
   {
      if ($settings[7] == 'Administrator')
      {
         $adminTxt = "     <input type=radio name=t value=2>Delete Pin";
          
      }
print "<font face=verdana,size=1><form action=\"index.php\" method=get><input type=hidden name=page value=\"map\"><center><input type=image src=\"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?     <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 highlighted by a blue circle, and your location is indicated by a blue pin. The ACēM member map is a map of all members who are registered on ACēM 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>Please note that <b>Who is this?</b> isn't quite working yet.<p>
<hr width="80%">
EOT;
obexit();


Everything works except for when you click on "Who Is This?" then I get no pic. DELETE and ADD A PIN work fine though. Also, the obexit() stuff is preventing the copyright stuff from loading yet I get no error. If I remove obexit() I get errors in subs.php (or was it ssubs.php?).

The worldmap_image.php is in the same directory as the forums, and the image is in YaBBImages. Here's what worldmap_image.php looks like:

Code: [Select]
<?
$dbcon = mysql_connect('localhost', surprise', 'IWontTell');
mysql_select_db('NotHereEither');
$db_prefix = 'pre_';
$im = @imagecreatefromjpeg ("http://ac2m.computers4gaming.com/YaBBImages/dereth.jpg"); /* Attempt to open */
$request = mysql_query("SELECT * FROM pre_world_map");

$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 pre_world_map 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 pre_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,"There are $numPins pins",$blue);

imagejpeg ($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
?>


Again, everything works but the "Who is This" button, and I've been going over this code for several hours now and can't find it. You can see it not working right here:

http://ac2m.computers4gaming.com

Then click on "Where in Dereth? Link on the left. I've set up a dummy login account with a name of "testuser" and a password of "testpass" - let me know if you can figure out what's going on, I'm running on empty here.

Thanks, Mad Moya
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
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 #172 on: July 27, 2002, 03:04:36 AM »
Reply with quote

That isn't going to work because it uses the variable action while making a page in YaPP uses the variable page. The only way for this to work is for you to edit the source code and put it in yourself.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!


WWW
Re:yabb.info Member Map
« Reply #173 on: July 27, 2002, 08:37:19 AM »
Reply with quote

Well, it was mostly working when I posted the message, now it's not working at all for some reason...

Are you talking about the <form action="index.php" stuff? If so, I'll take a look at it and start playing and see what I come up with.

Thanks, MM

Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284



WWW
Re:yabb.info Member Map
« Reply #174 on: July 27, 2002, 04:34:39 PM »
Reply with quote

Maybe I can get Chris to integrate the member map into YaPP, with permission of course :)

(I would, but 1.) I know nothing about it and 2.) I can't even see the stupid thing. )
Logged
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!


WWW
Re:yabb.info Member Map
« Reply #175 on: July 28, 2002, 12:19:05 AM »
Reply with quote

Hehe, the map stopped working this morning, and my site stopped working sometime this evening, so I'm not surprised you couldn't see it. :(

Still awaiting a reply from my host's tech support. It looks like the Nameserver for my site is down, as I can still get there via the IP address.

There seems to be an issue with the line

imagejpeg ($im)

Sometimes it displays the map fine, sometimes it outputs gibberish, and sometimes it just outputs a broken link. I tried converting the jpeg to png, but it went from a 55K jpeg to a 450K png, so that wasn't a good solution. :)

Have fun, Moya
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
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 #176 on: July 28, 2002, 02:45:31 AM »
Reply with quote


Maybe I can get Chris to integrate the member map into YaPP, with permission of course :)

(I would, but 1.) I know nothing about it and 2.) I can't even see the stupid thing. )

The only problem is that the gd library must be installed for it to work. Should I put it into YaPP anyway?
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!


WWW
Re:yabb.info Member Map
« Reply #177 on: July 28, 2002, 09:00:50 AM »
Reply with quote

Don't most hosts enable the gd library?

If you do integrate it, just remember to put a place for us to change the map file used! :)

Have fun, Moya
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
laidback
Noobie
*
Posts: 1


I'm a llama!


Re:yabb.info Member Map
« Reply #178 on: July 28, 2002, 11:28:40 AM »
Reply with quote


Hehe, the map stopped working this morning, and my site stopped working sometime this evening, so I'm not surprised you couldn't see it. :(

Still awaiting a reply from my host's tech support. It looks like the Nameserver for my site is down, as I can still get there via the IP address.



You wouldn't be using xnull would you?  My site and xnull itself both seem to be down, with myown site disappeared from the DNS.  >:(
Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284



WWW
Re:yabb.info Member Map
« Reply #179 on: July 28, 2002, 12:32:59 PM »
Reply with quote


If you do integrate it, just remember to put a place for us to change the map file used! :)


Chris, make sure you do that ;)
Logged
Pages: 1 ... 10 11 [12] 13 14 Reply Ignore Print 
YaBB SE Community  |  YaBB SE Info  |  News From the YaBB SE Team  |  Topic: 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.0.12 | SMF © 2016, Simple Machines
Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 19 queries.