• I’ve spent a couple of days rewriting NextGEN’s rewrite code (no pun intended!) and here is the result:

    http://www.cwatson.org/odd/nextgen-1.5.5-cw.tar.gz

    Changed files are:
    nggfunctions.php
    lib/ngg-db.php
    lib/rewrite.php

    There are several code changes, so I won’t list all changes here. You can either replace the files above or replace the whole nextgen-gallery folder in your plugins directory.

    After replacing the files, log into your wp-admin console and go to your NextGEN options. Click on the “Permalinks” tab, and the options should be self-explanatory.

    Disclaimer
    Note to anyone upgrading to this patch, obviously there is a risk in using this as it I haven’t tested on anything other than my own website. Remember to backup your current nextgen-gallery plugin folder, as well as any customised CSS files you have.

    Demo gallery is here: http://www.cwatson.org/gallery

    I have submitted the code changes to Alex (NextGEN’s developer) so hopefully they should be incorporated into a NextGEN release sometimes soon 🙂

    Any questions, please ask 🙂

    http://ww.wp.xz.cn/extend/plugins/nextgen-gallery/

Viewing 15 replies - 16 through 30 (of 33 total)
  • Craig, you’re awesome for adding towards further improvement of NextGen, especially in the SEO gap. Gold star!

    I’ll run it through my site over the next couple of days and post up some feedback. Since I use a host of extra Nextgen plugins (Tag Search v0.6, Custom fields, Voting, SEO Titles), could be interesting to see if it all plays nice.

    If I may ask, would this hack/eventual patch then eliminate need for the Nextgen SEO Titles plugin? One less plug-y to deal with is always good.

    [test page link]
    Files are installed, patch activaed (slug is ‘fotosets’), cache cleared etc, and yet sadly no visible changes in the source code. Also, disabled the Nextgen SEO Titles plugin to minimize possible conflict or confusion.

    I am presuming I’m looking for ”

      img title=

    ” to every thumb. Please inform if I’m mistaken on that, that has been what I’ve noticed is different about your sample pages.

    Could it be that code mods for a Nextgen Custom Field in my custom gallery.php is interfering? My php buddy moved stuff around, so if there’s any reference to gallery.php I’d need to know which code it’s looking for.

    Hope this is of help.

    No love for the feedback?

    Thread Starter Craig Watson

    (@craigwatson)

    gearsdigital, brightsides, Sjeng and FotoAndy,

    Thanks for your feedback, unfortunately I have a lot of freelance (paid) web development work outstanding at the moment and various personal situations that I need to deal with, so while I do really value the feedback, I’m unable to work on the plugin at this point – I’m trying to put as much on hold as I can to deal with everything.

    I should be able to start work again on Monday 2nd August. In the meantime, I will try and provide support if needed, however it will be on a “if I have time” basis.

    If anyone has the time to develop this fix further, please by all means email me at [email protected] or post here.

    What I’m planning to do is develop a full “version 2” of my patch, and release it as I have done here – this will supersede v1 above, and (should) fix the problems you have all experienced.

    This “v2” will involve changing the NextGen database schema to include a sanitised gallery name to solve the special characters problem.

    I’ll address all of your problems individually in messages to follow. Thanks again for your feedback, hopefully you’ll bear with me.

    Cheers,
    Craig

    Thread Starter Craig Watson

    (@craigwatson)

    @gearsdigital:
    You should be able to create nested albums, my website at http://www.cwatson.org is using one main “Gallery” album, with separate sub-albums acting as categories.

    ——————————————————-

    @brightsides:
    Page titles can be handled by a separate NextGEN plugin, available through the WordPress plugin system – the name is NextGEN SEO Titles I believe.

    ——————————————————-

    @sjeng: The way I have designed the plugin is that there is only *one* page within WordPress that handles the gallery. From there, navigation is handled by the URL, using WordPress’ permalink rewrite structure to extract the full path to galleries/albums/subalbums.

    Basically: you have a single gallery “homepage” and the plugin does the rest for you – so no subpages for albums etc.

    If you would like text with each gallery, I would suggest using NextGEN’s description field. My plugin doesn’t alter any of the code output by NextGEN, just adds the permalink rewrite functionality.

    ——————————————————-

    @fotoandy:
    Similar to Sjeng above, my patch only provides URL rewrite functionality, it doesn’t alter any of the XHTML code output by NextGEN or WordPress. From your test URL, you seem to have the plugin installed OK and it seems to be working fine – the prefix slug seems to be “sets” rather than “fotosets”.

    Well, I just found out I completely misunderstood a setting that is actually in your plugin:
    I only needed to UNcheck “Deactivate gallery page link:” in the gallery options tab. This makes the Albums redirect to the page you entered in the “linked to” field, so this way, you CAN create subpages, link galleries to them, and have the albums do the same 😀

    So in my case, problem solved (although you might want to clarify what this function does a little more in the readme 😉 )

    Thanks!

    Thread Starter Craig Watson

    (@craigwatson)

    @sjeng:

    I’m not the main NextGEN developer – I’m just contributing the URL rewrite code.

    The patch I’m supporting here is just that: a patch to the main NextGEN Gallery plugin to enable users to create SEO-friendly permalink structures.

    The purpose of these structures is so that you don’t have to use linked pages to create a “nice” URL structure with nested albums being handled automatically by the URL rather than being explicitly linked within WordPress by pages.

    A URL of http://www.example.com/gallery/holiday/london/zoo would automatically route to the appropriate place, without any “holiday”, “london” or “zoo” pages existing in WordPress.

    Again, to clarify: my patch above is merely an unofficial modification to NextGEN, which I’m hoping Alex Rabe will incorporate officially when it has been tested enough 🙂

    Cheers,
    Craig

    Thanks for the feedback Craig, as well as patience with the rest of us jonesing for this patchs’ functions.

    Thankyou guys, especially Sjeng-

    You made me realize i overlooked that option (and the activate permalinks option) too.

    My problem was to create a nice breadcrumb for my NextGEN Gallery.

    You can find an explanation here.

    Michael D

    (@michael-divine)

    Hi craig,
    This sounds like it might be what I’ve been looking for – better permalinks for the imagebrowser – album -> gallery -> imagebrowser

    RIght now it goes:
    http://WEBSITE.com/ALBIM/ ->
    http://WEBSITE.com/ALBUM/GALLERY/ ->
    http://WEBSITE.com/nggallery/page-638/image/461/

    …. which is terrible. I would love the imagebrowser to display this URL:

    http://WEBSITE.com/ALBUM/GALLERY/IMAGE-NAME
    or even
    http://WEBSITE.com/IMAGE/IMAGE-NAME

    I tried clicking through a few people’s examples above but didn’t find anything relevant – most people’s images click through to .jpg and your own example seems to be giving a 403 Forbidden error.

    Any suggestions?

    Thanks!

    Thread Starter Craig Watson

    (@craigwatson)

    Hi Michael,
    My own gallery should be back up now – problem was my web-host switching to the Litespeed server and it treating my setup slightly differently than Apache did, I basically have a WP page and a folder of the same name, something that Litespeed doesn’t like!

    Unfortunately my mod doesn’t go as far as image names, it just rewrites the gallery/album part of the URL. Hopefully when I get some spare time to work on the mod, I’ll be able to add this, but ideally I’ll be submitting a complete code change to Alex Rabe to release with NextGEN, as the changes needed are too complex to release as a standalone mod.

    Hope that’s OK, sorry I couldn’t be more help, I’m in about 10 places at the moment!

    Cheers,
    Craig

    Thread Starter Craig Watson

    (@craigwatson)

    Hi everyone,
    Just an update to proceedings.

    I have now started work on version 2 of the patch, however I think the best way to continue work is to submit code to Alex Rabe (NextGEN’s maintainer) to officially integrate, rather than releasing the patch as standalone.

    The reason for this is that the v2 of my patch incorporates database schema updates, and these are best left to NextGEN itself to deal with – I don’t want to be responsible for people’s databases breaking on future NextGEN upgrades.

    I will continue to support v1 of my patch here, but please be aware that there are problems/issues with it (discussed above) and it may not be a complete solution – though it has been proven to work with many people’s installations.

    I hope to have v2 finished and submitted to Alex this week, so hopefully it’ll make it into NextGEN 1.6.0, due for release in two weeks.

    Many thanks everyone,
    Craig

    Thread Starter Craig Watson

    (@craigwatson)

    Quick progress update – v2 of my patch has been completed, though it won’t make NextGEN until v1.7, as Alex has already frozen features for v1.6.0.

    If people are interested in testing v2, please post here or email me at [email protected]. Knowledge of patch files and database schemas are advised – though not required – the more independent testing I can do here, the less Alex needs to do in the future 🙂

    Hey Craig any update? I have NextGen 1.7.4 installed and haven’t experienced any SEO yet. Plus the URLS are still ugly.

    Tho I did see an option to prep the database for SEO friendly permalinks but that hasn’t happened yet.

    Please advise… I’ noticing your last reply was 7 months ago so I’m hoping there’s an update.

    Thanks so much for your hard work. With all the images we have…getting nextgen indexed would be a huge boom for the site.

    Thread Starter Craig Watson

    (@craigwatson)

    Hi mykkal,
    Alex Rabe is working on getting the SEO changes into the body of NextGEN.

    You may have noticed a database upgrade sneak through a couple of versions ago – this has laid the groundwork for full SEO of the gallery – albeit with one minor concession: there will be no “landing” page, everything will still come under /nggallery – but the album/gallery/image names will all be SEO-friendly.

    Keep an eye on this ticket for more info: http://code.google.com/p/nextgen-gallery/issues/detail?id=223

    I haven’t had any time recently after starting a job last October and then moving jobs at the beginning of April, so 90% of the credit should go to Alex for incorporating the code into NextGEN.

    Craig

Viewing 15 replies - 16 through 30 (of 33 total)

The topic ‘[Plugin: NextGEN Gallery] SEO Permalinks — Patch’ is closed to new replies.