TrackMe's web development and user plugins. Developers welcome!!

Search This thread

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
Staryon,

I've used requests.php to build a geotag request to accept remote Web lookups for the Geotagging script I've been writing. Works well, and basically just copied and refactored what was already in requests.php. Said another way, I don't know PHP well, but I can copy and paste to make what I want. :)

My section drops right into requests.php, but I've also during testing made a separate geotag.php so I have either option. Which would you feel more comfortable accepting into the TrackMe server code?

This is assuming you're comfortable with the whole idea that users can utilize your TrackMe server/database to look up their datapoints for geotagging images. The API is simple, so people could always write their own tagging script and use the same server code. For example, Windows users might want to write something in .Net which has a GUI. Me, I'll stick to Perl.

Let me know, I'll PM you the URL to check it out.


Thanks for that.
Yes, I think a separate file is better so we keep TrackMe's core separated from user plugins.
I'll take a look at the URL later.

Regards
 

faeArai

Senior Member
Sep 26, 2008
436
120
Hey folks,

how about starting a project on github and coding cool stuff using a php framework like cakephp or php on trax? We could extend trackme-web-app step by step including nice ajax features and so on!

Or is there such a repository already on the web?

cheers
 

heyk

Member
Aug 7, 2007
6
0
Fryslan
trip management

i have problems to manage my trips on my own server. get message;
undefined index : tn in D:\www\...\...\..\request.php on line 66 result:0|5|2009-02-23 22:21 . i can't get it refreshed or get the existing from my server.:confused:
 

illflux

Senior Member
Oct 1, 2007
57
18
I have a feature request for the viewer. Would it be possible to add a drop-down menu on the right side (along with "trip" and "filter") and have it list the various kinds of google icons that one can select when forcing an update? For example, I was out scouting some photo locations today and marked a few spots (with the forced update, using the Google "camera" icon) that I would like to revisit when I have a little more time. I had another spot that I thought would make a good bike ride, so I marked it with the "bike" icon. I'm uploading my data to my own server using the "Official release." I was thinking that when I got back to my computer, I could view my page and filter by points denoted as "camera" or "bike," but then realized that option wasn't available. I've done a little php / sql wrangling, and I think I could figure out how to do it, but before I dive into the code head-first, I thought I'd bring it up here in case it's something that could be added to the official version.

It would be nice if that could be added in addition to the other filters, i.e. view the points marked with "camera" only on a certain trip or within a certain date range, etc.

And it may be even better to present all the Google icon options as checkboxes, rather than a drop-down menu. That way, the user could have it show as many or as few of the categories as they want. Kind of like layers in Google Earth.

Thank you for the software / viewer, they're awesome!
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
I have a feature request for the viewer. Would it be possible to add a drop-down menu on the right side (along with "trip" and "filter") and have it list the various kinds of google icons that one can select when forcing an update? For example, I was out scouting some photo locations today and marked a few spots (with the forced update, using the Google "camera" icon) that I would like to revisit when I have a little more time. I had another spot that I thought would make a good bike ride, so I marked it with the "bike" icon. I'm uploading my data to my own server using the "Official release." I was thinking that when I got back to my computer, I could view my page and filter by points denoted as "camera" or "bike," but then realized that option wasn't available. I've done a little php / sql wrangling, and I think I could figure out how to do it, but before I dive into the code head-first, I thought I'd bring it up here in case it's something that could be added to the official version.

It would be nice if that could be added in addition to the other filters, i.e. view the points marked with "camera" only on a certain trip or within a certain date range, etc.

And it may be even better to present all the Google icon options as checkboxes, rather than a drop-down menu. That way, the user could have it show as many or as few of the categories as they want. Kind of like layers in Google Earth.

Thank you for the software / viewer, they're awesome!

Yes, I think it's a good idea. I would like to see that.
At this moment, I'm not sure if anybody is working on rewriting the web viewer. There were some people interesting in doing that but I haven't heard from them since then.

I will add that to my to-do list in case I'm the one rewriting the viewer so I can add that feature.

Regards
 

khaytsus

Senior Member
Apr 8, 2008
7,258
1,175
Central Kentucky
Does the date range work for anyone? I never have quite figured that one out..

Here's the use case that makes sense to me, but perhaps the author of the code was going another direction?

User wants to limit the range on the current trip. This could be a specific trip, or All trips. In the case of All Trips, ideally the date setting would persist so one could set the date, then select All, and only get the datapoints within that date range.

Does the date range work for anyone? I typically use Firefox in Linux, but I've tried it in IE on Windows at work too.
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
I use Firefox and I think it works fine to me.
First I select a trip and the "Date From" and "Date To" are populated automatically. Once I have that I can change those values myself in case I want a shorter interval.

Is that what is not working for you?
 

khaytsus

Senior Member
Apr 8, 2008
7,258
1,175
Central Kentucky
I use Firefox and I think it works fine to me.
First I select a trip and the "Date From" and "Date To" are populated automatically. Once I have that I can change those values myself in case I want a shorter interval.

Is that what is not working for you?

The dates change, but the interval does not. Maybe I'm doing it wrong?

I have a trip, 16:45 to 18:15, say I want to see 16-17.. so I click the calendar at the bottom, drag the hours/minutes to 1700. I've tried clicking the x in the calendar popup, tried hitting enter, tried clicking "Show" again, tried adjusting the time, then clicking the date, etc.. In every case, it just refreshes the full trip, date sets back to what it originally was, all points are still shown.

Okay, very odd, I *can* do it on your server. Is there something server side which is needed?
 
Last edited:

khaytsus

Senior Member
Apr 8, 2008
7,258
1,175
Central Kentucky
That was going to be my next question, if it works on mine.
In that case I cannot help you too much. Hopefully some other people using their own servers will be able to give you more information.

Sorry about that.

I got a bunch of undefined variables in relation to dates and location in my Apache logs when I do this, I'll have to investigate some.

Anyone else with their own servers, can you try limiting the date range and seeing if it works for you? Only thing I can think of that'd be different is PHP version. I'm running 5.1.6 on CentOS 5.2.
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
khaytsus,

I just noticed something.
Let's suppose I select Trip A whose date range is 2008-11-17 09:00:59 - 2008-11-17 09:52:22

Now, if I change the 'date from' to 2008-11-17 09:01:20
and click on SHOW, the 'date from' is automatically updated with the date and time of the closest available position for the date that you entered.

I didn't have noticed that, but I think it looks very nice.
 

khaytsus

Senior Member
Apr 8, 2008
7,258
1,175
Central Kentucky
khaytsus,

I just noticed something.
Let's suppose I select Trip A whose date range is 2008-11-17 09:00:59 - 2008-11-17 09:52:22

Now, if I change the 'date from' to 2008-11-17 09:01:20
and click on SHOW, the 'date from' is automatically updated with the date and time of the closest available position for the date that you entered.

I didn't have noticed that, but I think it looks very nice.

Yup, that does look nice.. On yours.. :confused: I'm going to poke into it sometime, not sure if it's a PHP difference or something else.
 

bwired

Member
Dec 4, 2007
36
0
www.bwired.nl
Uploading images With asp

Hi

My ASP upload (posted earlier) is working good, this is only handling "upload"
I now want to go on with uploading images.
If i do that I see that I receive a
"findclosestpositionbytime" and that I need to to return two fields like ID and dateocccured in asp that is for example this:

Response.write("Result:0|1284|2009-02-27 13:49:13")

I still get a "Uable to get postions" on my cellphone
Can somebody tell me how this flow goes before the uploading of the selected image file is done.

I see there is also "updateimageurl" but I dont know either how to trigger this from my cellphone.
I searched the forum as good as I could but did not find this info
hopefully you can help me

regards Pieter
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
Hi

My ASP upload (posted earlier) is working good, this is only handling "upload"
I now want to go on with uploading images.
If i do that I see that I receive a
"findclosestpositionbytime" and that I need to to return two fields like ID and dateocccured in asp that is for example this:

Response.write("Result:0|1284|2009-02-27 13:49:13")

I still get a "Uable to get postions" on my cellphone
Can somebody tell me how this flow goes before the uploading of the selected image file is done.

I see there is also "updateimageurl" but I dont know either how to trigger this from my cellphone.
I searched the forum as good as I could but did not find this info
hopefully you can help me

regards Pieter


This is what I do inside TrackMe:

Code:
if (ReadWebPage(cURL, 1000, ref cRes))
   cRes = "Unable to get positions:" + Comm.LastError;
else if (cRes.IndexOf("Result:1") != -1)
   cRes = "Incorrect Password for user";
else if (cRes.IndexOf("Result:2") != -1)
   cRes = "User didn't exist and system was unable to create it.";
else if (cRes.IndexOf("Result:3") != -1)
   cRes = "You need to specity a username and password for the user.";
else if (cRes.IndexOf("Result:4") != -1)
   cRes = "Unable to connect to database";
else if (cRes.IndexOf("Result:5") != -1)
   cRes = "In order to connect to this server you need to update your client.";
else if (cRes.IndexOf("Result:6") != -1)
   cRes = "No date specified.";
else if (cRes.IndexOf("Result:7") != -1)
   cRes = "No positions for user found";
else if (cRes.StartsWith("Result:0|"))
{
   try
   {
      cRes = cRes.Replace("Result:0|", "");
      if (cRes == "")
          cRes = "Result empty";
      else
          bError = false;
   }
   catch (Exception)
   {
      cRes = "Error processing result (" + cRes + ")";
   }
}
else // Unknown answer. Offline?
   cRes = "Unable to get positions (" + cRes + ")";

If it goes to the first 'unable to get positions' it means that the server probably timeout, but if it went to the last one it's because it received an answer but it didn't fall in any of the if statements.
 

bwired

Member
Dec 4, 2007
36
0
www.bwired.nl
This is what I do inside TrackMe:

Code:
if (ReadWebPage(cURL, 1000, ref cRes))
   cRes = "Unable to get positions:" + Comm.LastError;
else if (cRes.IndexOf("Result:1") != -1)
   cRes = "Incorrect Password for user";
else if (cRes.IndexOf("Result:2") != -1)
   cRes = "User didn't exist and system was unable to create it.";
else if (cRes.IndexOf("Result:3") != -1)
   cRes = "You need to specity a username and password for the user.";
else if (cRes.IndexOf("Result:4") != -1)
   cRes = "Unable to connect to database";
else if (cRes.IndexOf("Result:5") != -1)
   cRes = "In order to connect to this server you need to update your client.";
else if (cRes.IndexOf("Result:6") != -1)
   cRes = "No date specified.";
else if (cRes.IndexOf("Result:7") != -1)
   cRes = "No positions for user found";
else if (cRes.StartsWith("Result:0|"))
{
   try
   {
      cRes = cRes.Replace("Result:0|", "");
      if (cRes == "")
          cRes = "Result empty";
      else
          bError = false;
   }
   catch (Exception)
   {
      cRes = "Error processing result (" + cRes + ")";
   }
}
else // Unknown answer. Offline?
   cRes = "Unable to get positions (" + cRes + ")";

If it goes to the first 'unable to get positions' it means that the server probably timeout, but if it went to the last one it's because it received an answer but it didn't fall in any of the if statements.

Ok Thanks that is working!
but now i get an error uploading picture. I have write permissions on the directory, even try to create the "pics" directory myself.
thr image file is 800kb, is that to much?
 

bwired

Member
Dec 4, 2007
36
0
www.bwired.nl
ang parameter not receiving with a=upload

Hi again,

I see that there is also an ANG parameter for the a=upload.
I'm not receiving this from trackme on my server.
I have the latest version, is there a screen/option I shoud active in the trackme software?

Thanks again
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
Hi again,

I see that there is also an ANG parameter for the a=upload.
I'm not receiving this from trackme on my server.
I have the latest version, is there a screen/option I shoud active in the trackme software?

Thanks again

I don't know why you don't receive it. It's uploaded when it's available from the GPS. It's taken from the $GPRMC command.
 

bwired

Member
Dec 4, 2007
36
0
www.bwired.nl
The size should be ok. TrackMe resizes the images before uploading them.
Can you post the piece off code where the error "Error uploading picture" is generated? The sreens say's first Uploading picture..... and then I get the error.
Perhaps its not possible to upload to an ASP webserver, or is it just HTTP and all should work? Hope you can help me further, im stuck right now
 

_LEM_

Senior Member
Mar 17, 2006
2,633
153
luisespinosa.com
Can you post the piece off code where the error "Error uploading picture" is generated? The sreens say's first Uploading picture..... and then I get the error.
Perhaps its not possible to upload to an ASP webserver, or is it just HTTP and all should work? Hope you can help me further, im stuck right now

Sorry bwired, but I cannot publish that.
Basically I just post a form using a HTTP call. The body of that form contains the image.

You probably know, but I retrieve the image inside the upload.php
file.
Code:
if ( $action =="pic" )
{
     if ( !file_exists("pics") )
         mkdir("pics");
				
     $newname = urldecode($_GET["newname"]);     	
	  
     $ext = strtolower(substr(strrchr($newname, '.'), 1));				
     if ( $ext != "jpg" && $ext != "bmp" && $ext != "gif" )
     {
          echo "Result:7";
          die;
     }
	  
		
     $myfile = "pics/".$newname;
	
     if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], "./$myfile" ))
     {				
          echo"Result:0";
          //print_r($_FILES);	    	
          die;
     }
     else
     {
          echo"Result:6";
          //print_r($_FILES);
          die;
     }		
}

I think it should work fine in ASP. TrackMe doesn't know anything about the server type on the other side. There has to be way of retrieving the information from the asp page (something similar to $_FILES that gives you the name of the file being uploaded)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    new web viewer

    Uff, I made it through 10 posts, so I may post here :p

    I wrote a web viewer for TrackMe data. It is a complete rewrite of the original viewer. The only thing that is left of old viewer is interface look and feel.
    It uses Google Maps API v3 but I plan to implement also an OpenLayers/OpenStreetMap alternative.
    My viewer is based on ajax, so everything works dynamically without page reloading.
    I use TrackMe on Android, so I implemented only the functions present in this version. There is no support for photos or comments. I will surely add those features when they become present on Android. Anyway functions missing from previous viewer should be easy to add, if anybody wants it.
    On the other hand I added altitudes graph. I thought about adding other graphs (like speed) and statistics but gps data I get with the Android app often miss info like speed, angle etc. (why?)
    The code is GPL, so everybody can contribute or reuse it. If you make changes to it please contribute your patches back.

    The code is available at github:
    https://github.com/bfabiszewski/phpTrackme

    You can see a simple demo at:
    http://flaa.fabiszewski.net/phptrackme/
    (auto registration of new users from client is blocked on this site)

    ---------- Post added at 09:06 AM ---------- Previous post was at 08:46 AM ----------

    I think it was mentioned in this thread before but I noticed there are still serious security issues in requests.php script from this package.
    Several times in the code strings submitted by users are used in mysql queries without, at least, escaping special characters.
    Like here:
    Code:
    $username = urldecode($_GET["u"]);
    ...
    $result = mysql_query("Select ID FROM users WHERE username = '$username' and password='$password'");
    Inserting single quotation mark into submitted string one may change the query and bypass authentication or even get all password hashes from mysql table, or overwrite all rows with some UPDATE query.
    This should at least be corrected to:
    Code:
    $username = mysql_real_escape_string($_GET["u"]);
    Also note that superglobal $_GET is already decoded. Using urldecode() on it could have unexpected results.
    2
    TrackMeViewer Update to Version 3.1

    As of now, via GitHub and on Luis' TrackMe Server, users can download for own use or access via Browser the

    TrackMeViewer v 3.1

    The new features in this version include:
    1. Support for a wide range of publicly available tile (=map) providers (in addition to the already available Google Maps)
    (some require an API or Access Key - many are totally free - including satellite views)
    2. Support for Web Servers running with php v 7.x
    3. Support for storing you private setting via Cookies
    4. Support for Web Server ports other than 80
    5. Get rid of php warnings in Web Server logs
    The database layout has not changed from V2.0 and therefore V3.1 is backward compatible with your current MySQL database/tables.
    (Btw. Version 3.0 was never released)
    Please have fun and report problems in https://xdaforums.com/showthread.php?t=477394
    2
    Is it possible to display the last trip without select in the pulldown boxes?

    I put new version of phpTrackme on my github. It is marked as version 2.3

    It is mainly a merge of mcampbellsmith's changes.

    I am not sure it is what you meant, but I added a new feature – when there are multiple users' tracks available, the latest one is selected by default.

    Hope it helps!
    1
    TrackMeViewer v3.5 is on GitHub (/espinosaluis/TrackMeViewer) now

    The v3.5 is a major rework of the TrackMeViewer with many features and function enhancements:

    For users:
    o Let the user allow to select the colour for the trip line
    o Use specified Date and Time formats from config.php in all displays
    o Switched to a less complex date and time picker for start and end date/time way point filtering
    o Let the user allow to suppress the position markers, if the trip recording provides to many or too dense positions
    o Remember last trip seen by the user
    o Let the user allow to group trips by choosing proper naming (<groupname>:<tripname>) and display groups of trips together ("[Any]")
    o Let the user allow to delete one single Marker Point (position) of a trip from the database
    o Show detailed trip data to the side of the map (resizeable). Things such as: max speed, max altitude, min altitude, descent ascent percentage, moving time, full trip time, etc
    o Let the user allow to scroll through each point of a trip (backward/forward) from the details pop-up
    o Show the latitude and longitude of the Marker Points in the details pop-up in different notations (e.g. 48.86648N, 9°01'30.4"E, 9°5.01304'W)
    o Store user options settings in cookies and ask for allow or deny
    o Issue a warning once a day, when a user modifies a trip, that it will be overwritten with a resynch from the TrackMe App
    o Add a warning when user selects "[Any]" trips
    o Changed "Display Options Show/Hide" check box to toggle option settings and make them to work immediately
    For Web App owner:
    o Let the Web App owner to allow to run Apache2 Web Server on any port (not only 80) or path.
    o Let the Web App owner to specify the Web Page title in the config.php
    For maintainer:
    o Removed no longer necessary "None" trip selection
    o Got rid of extra " ... = urldecode($_GET ...". Superglobal $_GET is already decoded
    o Consequently and everywhere use PDO for all database access with bound parameters to prohibit data injection
    o Got rid of "UNDEFINED INDEX <xyz>" notices issued by php and saved in Apache log file
    o Restructured and reformatted code for better readability and maintenance

    Note: The translations into French, Italian, Dutch and Slovak were developed via Google Translator. If someone has better translations or wants to provide any edditional language, please feel free to announce here.
    1
    OSM and ajax

    Hello,

    based on this webserver, i've developed a webserver with open streetmaps, openlayer and lifetracking with ajax map update.