If possible, I'd like to see this module up to date with Drupal 5.x.

Comments

ray007’s picture

I'd help with the task if
- there were not french in use for naming functions and variables
- there were some comments to help around the code

as it is I fear I have to start yet another module :-(
or maybe an addon to gmap ...

JohnG-1’s picture

tracking ;)

ray007’s picture

If you check the issues for the gmap module you'll find a patch from me there to parse and display gpx-files.
But no track-management ... *hint, hint*

gadzuk’s picture

StatusFileSize
new232.13 KB

I managed to beat the 4.7 code into working with Drupal 5.x. This needs a thorough review and more testing, but it's working fine for me so I'll post in case anyone else finds it useful.

I've made a few changes that make this update depending on the GMAP module, but certainly not what I would call reuse.

I have not tested yet on a fresh Drupal 5.x install, I had upgraded from 4.7 to 5.x and already had some tracks installed.

gadzuk’s picture

Status: Active » Needs review
StatusFileSize
new16.48 KB

This needs a review and more testing, but it's working fine for me so I'll post in case anyone else finds it useful. Not tested on a fresh 5.x install, I had recently upgraded from 4.7.

The attachment was created using
diff -urpN

To use this patch, download track-4.7.x-1.x-dev, then manually apply this patch or use the instructions at http://drupal.org/patch

lenkkivihko’s picture

settings_hook used. That needs to be updated in order to have Admin UI.


function track_admin_settings() {

$form['API'] = array(
    '#type' => 'textfield',
    '#title' => t('Google Maps key'),
    '#default_value' => variable_get('googlemapskey', 'AAAAAAAAAAA'),
    '#size' => 120,
    '#maxlength' => 255,
    '#description' => t('Required by Google. ').l(t('You will be able to generate your key here'), 'http://www.google.com/apis/maps/signup.html')
  );
 
return system_settings_form($form);
}

and this needs to be added function track_menu($may_cache) {


$items[] = array(
    'path' => 'admin/settings/track',
    'title' => t('Track'),
    'description' => t('Setup the Google API'),
    'callback' => 'drupal_get_form',
    'callback arguments' => array('track_admin_settings'),
    'access' => user_access('administer site configuration'),
    'type' => MENU_NORMAL_ITEM, // optional
   );

sti’s picture

I'm trying to get Track to work with a clean install of drupal 5.7.. Anyone managed to do that? If so please tell me how!
btw the 4.7 track module with drupal 4.7 used to work, but not anymore:(
My site is all about this module so I really need it to work! All help much appreciated.

Gaby’s picture

I'm really sorry about that, I've comitted a patch without really reviewing it, not even applying the correct branch :(
Drupal module development is a bit complicated and I forgot almost everything about it, I'll try to fix that asap.

Anyway, for a working 4.7, try to get the version before my last commit.

lenkkivihko’s picture

Title: Drupal 5.x compatibility » Fresh 5.x installation

I did following:
* Find + replace paths of the files to right places. Paths are hardcoded t
* Fixed settings_hook as described above - alternative solution is to manually update the variables table with for googleapi key

And it worked on my localhost. Unfortunately it complanied someting about APIkey on my production server. Didn't manage to get it working...

But if someone gets this working, surely give a try...

sti’s picture

lenkkivihko please share your track module files! If you made it work on your localhost you must be close.. I also see that your site is offline now, Upgrading to drupal 5?? ;)

lenkkivihko’s picture

StatusFileSize
new22.09 KB

Right Sti!

Unfortunately it seems to be gone with rm * in my 5.x upgrade. (so right guess, I am in middle of upgrading my site! :-))

Did the same work, but did not test it.

See the track.module attached.

Additionally you need to make sure that hardcoded e.g.,
Atleast in my installation the track module is placed in modules/contrib/track vs. the base directory. --> in 4.7 it used to be in modules/track -folder.

track.tile.inc


 function GetUrl($x, $y, $z) {
   $filename = "${z}/${x}/${y}.png";
   if (file_exists("./maps/".$filename)) {
       return "http://tracks.landais.org/maps/".$filename;
    }else{
       return "http://tracks.landais.org/maps/transparent.gif";
   }
 }

maps.inc.js


  	var z = 17 - b;
//   	return "http://gabriel.landais.org/maps/"+z+"/"+a.x+"/"+a.y+".png";
   	return "http://gabriel.landais.org/maps/map.php?zoom="+z+"&x="+a.x+"&y="+a.y;
  }

track.module


 if ($diff == "S") {
  $image_name = "modules/track/misc/pushpins/058.png";
 } elseif ($diff == "M") {
  $image_name = "modules/track/misc/pushpins/150.png";
 } elseif ($diff == "L") {
  $image_name = "modules/track/misc/pushpins/011.png";
 } else {
  $image_name = "modules/track/misc/pushpins/001.png";
 }

include_once("modules/track/track.gpx.inc");
include_once("modules/track/track.tile.inc");

Replace atleast these strings with right strings in your site.

Sorry not to provide full and working solution, but I am in middle of upgrading my site to 5.x....

sti’s picture

Thanks lenkkivihko. But I still have problems with all the provided solutions.. (lenkkivihko's tips, files from the cvs and the track_drupal5.tar_.gz). I know it is only some minor changes before this wil work, but my php/drupal skills are'nt good enough to solve this:( C'mon gaby, lenkkivihko and gadzuk! this track module is to cool to not work! (And the biking season is starting soon!)

centralbyrakraten’s picture

Has anyone made any progress in this subject lately?

I´ve tried all tips and tricks in the thread but it feels like I´m far from a working version.

gadzuk’s picture

StatusFileSize
new14.51 KB
new19.42 KB

Some of the patch I submitted above didn't make it into the HEAD.

Differences
- INSTALL.txt note indicating module doesn't work correctly with caching turned on
- checks added for NULL reference in the .js files
- remove dependencies on path $ROOT/module/track vs $ROOT/sites/all/modules/track
- adjusted the default scaling (ATVs cover more ground than bicycles)
- Some of the user-facing strings changed to English
- added an overlay bitmap to the KML download (oops, can't edit / delete this attachment)
(edit to suit your application in function htmlentities2unicodeentities)

Demo under Drupal 5.14
- http://www.quadsquad.ca/?q=track

Attachments:
1. distro 4.7 version vs HEAD in patch format
2. HEAD vs my changes in patch format

gadzuk’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

Updated and branched in CVS

gadzuk’s picture

Assigned: Unassigned » gadzuk
Status: Needs review » Fixed
gadzuk’s picture

Status: Fixed » Closed (fixed)