TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 02, 2024, 01:38:55 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 136
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 145
  • Total: 146
  • tino

Location Mod (Member Map)

Started by nokonium, November 26, 2006, 08:47:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

Resizing the map to fit Tiny Portal
Not really a block code snippet, but how to get the mod to work with TP. The size of the map is contolled from the database so changing the size of the map itself has no effect.

If you want to do it before you install you can edit the install.php file and add it to the mod zip file.

Find

// insert the maps
db_query("INSERT INTO {$db_prefix}mm_maps VALUES (1, 'World.gif', 'World', 0, 6000, 0, 3044, 0.13, 1)", __FILE__, __LINE__);


replace with

// insert the maps
db_query("INSERT INTO {$db_prefix}mm_maps VALUES (1, 'World.gif', 'World', 0, 6000, 0, 3044, 0.115, 1)", __FILE__, __LINE__);


The changed value scales the map image, 0.13 matches the world.gif width of 780px, changing it to 0.115 will reduce the displayed width to 690px which fits nicely with one sidebar of 180px. If you then wish you can resize the map and reduce the file size.

To do it manually find [$db_prefix]mm_maps and edit the scale field


Adding Flags
If you want to add more flags you can also do that by editing the install.php file

All countries listed are added to the database with lines like this:

db_query("INSERT INTO {$db_prefix}location_country VALUES ('us', 'United States', 10)", __FILE__, __LINE__);

Modify the VALUES('us', 'United States',

The 'us' is the file name of the flag file i.e. us.png (all png files) must be 2 letters has to be unique.

The 'United States' is the country name to be displayed, change it to whatever you want, maximum 42 characters.

The number following the country name I believe is a map reference number, so put the same one as the nearest country i.e. if you want to add Texas, use the same as 'United States',  10.

Create your flag, size 25px x 15px and put it with the rest of the flags in the default/images/flags folder.



Nokonium

I think that is something that can only be answered on Tiny Portals.

Earache

confused...
where is the mod in the 1st place??

Nokonium

The Location Mod is an SMF mod. It was not designed to be used with Tiny Portal sidebars. My code snippet above is to alter the display size for Tiny Portal with a sidebar.

Tiny Portals is website, there is a link to it in the links block in the sidebar.