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
Posts: 1894
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 !
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 3
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
Posts: 1894
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
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 3
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?
Posts: 1894
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
)
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 20
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
Posts: 1894
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 !
-------------------------
- http://www.termitenshort.com/
The Termite -
Posts: 20
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:
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
Posts: 20
sorry, double posting
Got it working. This is what I ended up with:
Cheers
Posts: 20
Hey,
Got it working by doing another "if ($_SERVER['SCRIPT_NAME'] == '/wp-gallery2.php'"
Like this:
thanks for pointing me in the right direction :D
Posts: 1894
Glad it's working now
-------------------------
- http://www.termitenshort.com/
The Termite -
Posts: 20
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:
With
Posts: 1894
Is this really "less" hard-coding
j/k
-------------------------
- http://www.termitenshort.com/
The Termite -
Posts: 2
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.
Posts: 2
Okay, managed this myself just by hard coding the links in both headers.