[Maps Module] Adding Map to Wordpress Page

ugatridawg24

Joined: 2007-03-14
Posts: 3
Posted: Wed, 2007-03-14 18:32

Greetings - I recently installed the map module (0.5.1d) into my Gallery 2 site. It is working just fine. I'm also running WPG2. I'd like to create a Wordpress page and simply embed the map. I've searched all over the forums to no avail. I realize this is probably more of a Wordpress question but I wanted to see if anyone could point me in the right direction. Any help would be greatly appreciated.

Below is my G2 system info:

Gallery version = 2.1.2 core 1.1.0.2
PHP version = 4.4.4 cgi
Webserver = Apache/1.3.33 (Unix)
Database = mysql 4.0.27-standard-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, NetPBM, Ffmpeg
Acceleration = none, none
Operating system = Linux infong 2.4 #1 SMP Thu Jan 13 08:59:31 CET 2005 i686 unknown
Default theme = wordpressembedded
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070216 Firefox/1.5.0.10

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2007-03-14 19:22

Hello :-)

If you have gallery correctly embedded in wordpress, the map page would show up within your wordpress theme, then the only remaining thing to do would be to create a link someplace pointing to this: http://yourwebsite/gallery.php?g2_view=map.ShowMap

gallery.php would be the name of the script for wpg2

I have achieved the same on my site: http://www.termitenshort.com/photos.php?g2_view=map.ShowMap&g2_language=en

Feel free to ask more question if you need to :-)

See you !
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
ugatridawg24

Joined: 2007-03-14
Posts: 3
Posted: Wed, 2007-03-14 19:59

Termite,

Thanks for your reply... I just checked out your site. Looks good! I want to create a menu link just like yours "Photo Map". How did you accomplish this? I was hoping it'd be as simple as creating a new page, going to the code tab and adding a link to the full URL. However this doesn't appear to be working. And yes, I'm a noob that knows just enough to be dangerous :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2007-03-14 20:11

Hello :-)

What I did to get that link up there :

- I went to the control panel -> presentation
- I Clicked "Theme editor"
- I selected the file on the left side called header
- Inside there I simply added a link (<a href="URL-GOES-HERE">Photo Map</a>)

You can basically add that link where-ever you want but it's a manual process at this point to modify the theme :-)

Let me know if you need more assistance :D
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
ugatridawg24

Joined: 2007-03-14
Posts: 3
Posted: Sat, 2007-03-24 00:21

Ok, after some header tweaking, I think I got what I want. However, one little quirk is bothering me. When I clik on my "Photo Map" menu link, it pulls up the photo map but the "Gallery" menu link is still highlighted. Where in the code is this set? If it's too much trouble to fix this, I guess I'd like to not highlight any menu items when they're active. Take a look at my "masterpiece" to see what I'm talking about :)

http://www.billyharllee.com/wp-gallery2.php?g2_view=map.ShowMap

Anyone have any ideas?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2007-03-24 03:12

Hello !

This really depends on your theme but for me, I have a class (called "selected") on the LI and I simply make a php test to get it to display.

This is the current tests I have:

Gallery -> if ($_SERVER['SCRIPT_NAME'] == '/photos.php' && !strstr($_SERVER['QUERY_STRING'],'g2_view=map.ShowMap')
Map -> if ($_SERVER['SCRIPT_NAME'] == '/photos.php' && strstr($_SERVER['QUERY_STRING'],'g2_view=map.ShowMap')

this seems to take care of it for me (I changed my theme last night :-))
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
ccjensen

Joined: 2007-03-24
Posts: 20
Posted: Sat, 2007-03-24 23:43

Hi

Don't mean to steal your thread, but I am having similar issues.
Using WP 2.1.2 (theme: K2 0.95 RC1) with gallery2 2.2 (theme: siriux), WPG2 2.01.
If you take a look at http://www.itismylife.net, and click on "gallery", you will see that it doesn't activate as "current". I have hardcoded the gallery link into my header file, but I can't figure out what "test" to run to get it to be "current".

Once I figure that out, I will also be adding a "pic map" link.
I have to say, termite, I can hardly wait until your lightbox module is ready :)
Thanks for any and all help,
C

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2007-03-25 00:11
ccjensen wrote:
Hi

Don't mean to steal your thread, but I am having similar issues.
Using WP 2.1.2 (theme: K2 0.95 RC1) with gallery2 2.2 (theme: siriux), WPG2 2.01.
If you take a look at http://www.itismylife.net, and click on "gallery", you will see that it doesn't activate as "current". I have hardcoded the gallery link into my header file, but I can't figure out what "test" to run to get it to be "current".

You should be able to do this:

Gallery Link -> <li <?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="http://itismylife.net/wp-gallery2.php">Gallery</a></li>

You probably have to do something similar on the "home link" (script_name = index.php) otherwise they will both be "selected" when you click on gallery :-)

That's what I did
See you !

-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
ccjensen

Joined: 2007-03-24
Posts: 20
Posted: Sun, 2007-03-25 00:42

ok, worked for the gallery link, but as you predicted, the "Blog" link stays "current"

This is the code I have for my menu right now:

Quote:
<li <?php if ($_SERVER['SCRIPT_NAME'] == '/index.php') { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="http://itismylife.net/">Blog</a></li>
<li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li>
<li <?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="http://itismylife.net/wp-gallery2.php">Gallery</a></li> <?php } ?>

The "Blog" I hardcoded is working fine, but I can't figure out how to remove the other "blog". I am trying to find some sort of "loop" function in the php, but I can't figure out what makes it run through and pick out all the links...
Thanks for helping

 
ccjensen

Joined: 2007-03-24
Posts: 20
Posted: Sun, 2007-03-25 01:55

sorry, double posting

Got it working. This is what I ended up with:

Quote:
<?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?><li class="page_item"><a href="http://itismylife.net/">Blog</a></li><?php } else { ?><li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li> <?php } ?>
<li <?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php' && !strstr($_SERVER['QUERY_STRING'],'g2_view=map.ShowMap')) { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="<?php echo get_settings('home'); ?>/wp-gallery2.php">Gallery</a></li>
<li <?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php' && strstr($_SERVER['QUERY_STRING'],'g2_view=map.ShowMap')) { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="<?php echo get_settings('home'); ?>/wp-gallery2.php?g2_view=map.ShowMap">Photo Map</a></li>

Cheers

 
ccjensen

Joined: 2007-03-24
Posts: 20
Posted: Sun, 2007-03-25 00:56

Hey,

Got it working by doing another "if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php'"
Like this:

Quote:
<?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?>
<li class="page_item"><a href="http://itismylife.net/">Blog</a></li>
<?php } else {
?><li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li>
<?php } ?>
<li <?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?> class="current_page_item" <?php } else { ?>class="page_item"<?php } ?>><a href="http://itismylife.net/wp-gallery2.php">Gallery</a></li> <?php } ?>

thanks for pointing me in the right direction :D

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2007-03-25 03:59

Glad it's working now :-)

-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
ccjensen

Joined: 2007-03-24
Posts: 20
Posted: Sun, 2007-03-25 12:40

Thanks
fyi ended up removing all the hardcoded stuff and installing the "page links to" plugin for WP http://txfx.net/code/wordpress/page-links-to/. It's a bit... smoother way of doing it. Figured it would save me hardcoding any of the links.
I then created a "page" for Gallery2 (wp-gallery2.php) and the map.
This worked perfectly, except my main page "Blog" would remain current when visiting the two new pages, so I had put in the check to see if wp-gallery.php was the valid script, and if so set "blog" to be just a page_item

To anyone trying to do what I did. Replace:

Quote:
<li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li>

With

Quote:
<?php if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php') { ?><li class="page_item"><a href="http://itismylife.net/">Blog</a></li><?php } else { ?><li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li> <?php } ?> <?php } ?>

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2007-03-25 15:19

Is this really "less" hard-coding :-) j/k

-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
kelpie

Joined: 2007-04-08
Posts: 2
Posted: Sun, 2007-04-08 14:15

I'm having a similar problem but can't figure out how to adjust any of the code to get what I want. I have a Wordpress blog running a (customised) K2 theme, and am trying to integrate my gallery (WPG2) so that it looks like my other pages. I created a page for the gallery in wordpress and used the redirectify plugin so that when you click on the gallery link it takes you to wp-gallery2.php. So far so good, but I'm using menu highlighting, and I want "gallery" to be highlighted as current in the menu when I'm at wp-gallery2.php. Can this be done? I'm a PHP newbie and have been at this for days now... To make it more complicated, the gallery uses a separate header (wpg2header.php) - I can't even remember why now. Any ideas will be really appreciated.

 
kelpie

Joined: 2007-04-08
Posts: 2
Posted: Sun, 2007-04-08 16:29

Okay, managed this myself just by hard coding the links in both headers.