Fresh 5.x installation

CirruZZ - March 1, 2007 - 19:44
Project:Track
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:gadzuk
Status:closed
Description

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

#1

ray007 - April 11, 2007 - 09:12

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 ...

#2

JohnG - April 18, 2007 - 13:01

tracking ;)

#3

ray007 - April 18, 2007 - 14:20

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*

#4

gadzuk - January 27, 2008 - 22:03

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.

AttachmentSize
track_drupal5.tar_.gz 232.13 KB

#5

gadzuk - January 29, 2008 - 11:58
Status:active» needs review

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

AttachmentSize
track-5.6.x.patch 16.48 KB

#6

lenkkivihko - February 24, 2008 - 16:20

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
   );

#7

sti - February 27, 2008 - 11:56

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.

#8

Gaby - February 27, 2008 - 13:27

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.

#9

lenkkivihko - February 27, 2008 - 14:51
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...

#10

sti - March 7, 2008 - 19:53

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?? ;)

#11

lenkkivihko - March 8, 2008 - 14:40

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....

AttachmentSize
track_5x.module.txt 22.09 KB

#12

sti - March 9, 2008 - 12:48

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!)

#13

centralbyrakraten - May 7, 2008 - 13:36

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.

#14

gadzuk - February 16, 2009 - 14:31

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

AttachmentSize
track-47-vs_head.patch 19.42 KB
track-head-vs-gadzuk.patch 14.51 KB

#15

gadzuk - February 18, 2009 - 04:09
Version:4.7.x-1.x-dev» 5.x-1.x-dev

Updated and branched in CVS

#16

gadzuk - May 3, 2009 - 18:20
Assigned to:Anonymous» gadzuk
Status:needs review» fixed

#17

gadzuk - May 17, 2009 - 12:27
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.