forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Joachim Müller on March 26, 2007, 06:56:46 pm

Title: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on March 26, 2007, 06:56:46 pm
In cpg1.4.x, the SEF_URL plugin used to be part of the coppermine package, although there are known issues with it. That's why the dev team decided to not bundle the SEF_URL plugin with cpg1.5.x any longer.
Instead, it is available here for download. Please keep in mind that this plugin is still experimental and not recommended for production use.

What it does: this plugin makes search engine friendly URLs for index, thumbnails, and displayimage.php. It can only work on apache-driven webservers.
If you have issues using this plugin, uninstall it (using the plugin manager) and remove the .htaccess file from coppermine's root folder that the plugin has created.

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_sef-urls_v1.4.zip/download

Download latest SVN snapshot (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/sef_urls.tar.gz?view=tar) (use at own risk)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on January 05, 2009, 09:53:27 pm
- fixed: didn't work for displayimage.php
- added: didn't t include the latest stable changes from the cpg 1.4.x version
- fixed: install / uninstall functions didn't work as intended (no use of Inspekt)

Changes in detail:

Changes needed in codebase.php:

Edit: Removed changes because they are in the current version
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on January 06, 2009, 10:22:28 am
I've added another small change to the version in the message above; theme selection wasn't possible (now it is).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Paver on January 07, 2009, 02:13:04 am
@Joachim: Maybe the SEF_URLs plugin should be added to the SVN repository plugins branch so that Timo can commit the changes directly?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on January 07, 2009, 11:01:58 am
I can add the plugin to the SVN, but this will of course not grant Timo write access there.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on May 10, 2009, 11:43:55 am
I'm thinking of use this plugin when CPG v1.5 be ready for production and submit the bugs here. I'm a fan of SEO and CPG needs a boost on this topic to keep up to date in front of all new scripts and CMS out there.

Does the Timos' modifications has been added to the first post? Or do I just checkout from repository? (If the plugin was already submited.)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on May 10, 2009, 11:49:29 am
Please perform a checkout and try for yourself. I don't think that Timo's suggestions have made it into the SVN yet, but you should just try for yourself.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on August 24, 2009, 01:08:05 pm
The sef_urls plugin hasn't existed in the SVN plugin repo, so I added it a few seconds ago. Please feel free to improve as suggested above.
Web SVN: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/sef_urls/
Subversion Repository: https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/sef_urls
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on January 06, 2010, 10:25:32 am
updated to v1.3 and attached new version to first post
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 02, 2010, 04:18:10 pm
updated to v1.6 and attached version to first post

- fixed a lot of URLs
- added known issues text file
- added localisation support for german language
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 03, 2010, 10:31:05 am
updated to v1.7

- removed slideshow URLs because not relevant for search engines, improving the plugin's perfomance
- removed sort string from german htaccess (wasn't used) improving performance
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 03, 2010, 06:19:00 pm
I've updated the SVN version to 1.8 adding experimental support for french and spanish SEF URLs. It would be nice if a french or spanish speaking person could check if these work as they should (and if my translation is good enough).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on February 03, 2010, 07:27:36 pm
I'll check out when I got home and I'll post my results this night!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on February 05, 2010, 04:24:47 am
One day later, but here I'm! I'm having some troubles with my computer so I'm posting this tiny thing I found so far, if I keep testing and founding new bugs or bad spanish wording, I'll post them...

The little button referring the Plugin's threads on the plugin manager leads to "http://forum.coppermine-gallery.net//index.html/topic,42568.0.html". Please, take out one slash there becase it's giving me a 404.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on February 05, 2010, 04:44:08 am
OK, Rookie question: How am I supposed to see the plugin working in Spanish? Where does the plugin takes the language from?

If it's from the browser I got in spanish and I don't see the url in sp.
If it's from the cpg installation, despite we know that because someone's (http://forum.coppermine-gallery.net/index.php?action=profile;u=53458) fault we don't have the file yet, I duplicated the english one and went to the config panel and chose it. Even that, I don't see spanish url.

Yes, I got the SVN version, 1.8 installed ;)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on February 05, 2010, 06:47:45 am
"http://forum.coppermine-gallery.net//index.html/topic,42568.0.html". Please, take out one slash there becase it's giving me a 404.
AND... change the ".html" to ".php".

Or, just copy and paste the URL of this post! :P

Didn't tested when I posted... My bad!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on February 05, 2010, 07:37:46 am
Haven't looked into the plugin in detail, but as far as I can see the possible scope of i18n of this plugin could be transliteration - it should be able to cope with Spanish pecularities in writing, e.g. accented characters and ñ in case that it should allow filename -> title relations in the future.
As of now, the differences lie in the naming of particular pages:

For you as a native speaker you just open ht-spanish.txt with a plain text editor and review each line like
Code: [Select]
RewriteRule busca.html(.*) search.php$1 [NC]if "busca" is actually the correct translation for "search" or if it should read buscar or busco. Pretty straightforward ;)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 05, 2010, 07:59:37 am
OK, Rookie question: How am I supposed to see the plugin working in Spanish? Where does the plugin takes the language from?

Please read the known issues txt file!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on February 05, 2010, 10:09:23 am
AND... change the ".html" to ".php".
'.html' is correct, as you can see in your address bar: http://forum.coppermine-gallery.net/index.php/topic,42568.0.html
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 05, 2010, 11:39:06 am
To elaborate it: The german, french and spanish language words have to be tested very carefully. For example, the word 'comentaire' in ht-french.txt is misspelled consciously, because 'commentaire' would contain the word 'comment' which is forbidden because it is used at other places in URLs, too. The question is, if a french visitor would prefer 'comentaire' over 'lastcom' even if it is misspelled. The german version is used here (http://pics.timos-welt.de/index.html) for example without any problem.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Fabricio Ferrero on February 05, 2010, 05:07:25 pm
Please read the known issues txt file!
My bad! I did it very fast. (I shouldn't post till I get real results.)


'.html' is correct, as you can see in your address bar: http://forum.coppermine-gallery.net/index.php/topic,42568.0.html
Is not. If you go to the plugin manager you'll see this url: http://forum.coppermine-gallery.net//index.html/topic,42568.0.html the "index.html" in the middle is not correct. SMF works with "index.php" in its URLs.


For you as a native speaker you just open ht-spanish.txt with a plain text editor and review each line like
Code: [Select]
RewriteRule busca.html(.*) search.php$1 [NC]if "busca" is actually the correct translation for "search" or if it should read buscar or busco. Pretty straightforward ;)
Thanks ;) I'll do.

I'll post when I got more results, and will correct some wording mistakes.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on February 05, 2010, 05:27:40 pm
If you go to the plugin manager you'll see this url: http://forum.coppermine-gallery.net//index.html/topic,42568.0.html the "index.html" in the middle is not correct. SMF works with "index.php" in its URLs.
Sorry, I didn't notice the 'index.html' in the middle ;)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: papukaija on February 05, 2010, 10:20:03 pm
I found a bug in codebase.php at lines 84-87:
Code: [Select]
   $html = preg_replace('/index\.php\?cat=([0-9]+)(\&|\&)page=([0-9]+)/i','index-$1-'.$str_page.'-$3.html',$html);
    $html = preg_replace('/index\.php\?cat=0/i','/index.html',$html);
    $html = preg_replace('/index\.php\?cat=([0-9]+)/i','index-$1.html',$html);
    $html = preg_replace('/index\.php/i','/index.html',$html);
which should be:
Code: [Select]
   $html = preg_replace('/index\.php\?cat=([0-9]+)(\&|\&)page=([0-9]+)/i','index-$1-'.$str_page.'-$3.html',$html);
    $html = preg_replace('/index\.php\?cat=0/i','index.html',$html);
    $html = preg_replace('/index\.php\?cat=([0-9]+)/i','index-$1.html',$html);
    $html = preg_replace('/index\.php/i','index.html',$html);

The difference is that the slash (in the second and fourth line) points the albumlist link to the webserver's root folder which might not be Coppermine's root folder. As a consequence, the user may get a 404 page or an other page which isn't powered by Coppermine.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 06, 2010, 11:07:19 am
Thanks for your report, fixed in SVN.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on February 08, 2010, 09:59:02 am
Update to v1.8 attached to first post
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 04, 2010, 11:58:22 am
Let's consider an image link created using this plugin:
http://www.test.com/gallery/displayimage-7-505.html#top_display_media

Shouldn't be more SEO-ish substituting the number (7) after "displayimage-" with the album name, and the number just after (505) with the title of the photo, if any?
Google really likes it.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on June 04, 2010, 12:28:06 pm
That's actually a feature request for a totally different approach. Has been requested before, and the answer remains the same: you're welcome to code that if you need it badly. See http://forum.coppermine-gallery.net/index.php/topic,61471.0.html and similar threads...
The main disadvantage is stability: if you base a URL on the textual content of a page and the textual content changes (i.e. the user who uploaded the image and has got editing powers is not aware of this mechanism), the URL will change and all static links to the old URL will become invalid, which is a very bad thing in terms of search engine friendliness. It would therefore not be a bright idea imo to completely rely on the title of the pic, i.e. it would be bad to get rid of the album and picture ID from the URL generated. Relevance in terms of search engine friendliness doesn't decrease with numbers in the URL.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 04, 2010, 12:30:39 pm
No, I don't need it badly, it was a suggestion only, I was glad to propose an idea in the same way I'm glad to contribute to the translations. In SEO optic, it would be a more interesting approach to experiment.
Thanks, anyway...
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on June 04, 2010, 04:47:02 pm
Will this plugin add permanent link to each photo?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on June 04, 2010, 04:55:45 pm
Will this plugin add permanent link to each photo?
Coppermine has a permanent link out of the box. Just look at the file information.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on June 05, 2010, 02:03:39 am
Well, for this one photo in the demo I see this URLs:
http://coppermine-gallery.net/demo/cpg15x/displayimage.php?pid=6
http://coppermine-gallery.net/demo/cpg15x/displayimage.php?album=2&pid=6#top_display_media
http://coppermine-gallery.net/demo/cpg15x/displayimage.php?album=lastup&cat=2&pid=6#top_display_media

These are everything, but not permalinks :)
SEOed links are not just links with .html in the end!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on June 05, 2010, 08:10:43 am
You need that additional information in the link, to determine what you're currently doing (viewing an album, viewing an meta album like 'recent uploads', search, etc.). So you need different url's to that one image. The pid parameter is always the same for each single file.

So maybe the answer is 'no'. Of course you can modify the plugin to only use that variant: http://coppermine-gallery.net/demo/cpg15x/displayimage.php?pid=6 - but that limits the functionality of Coppermine substantially.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 05, 2010, 11:21:33 am
This a beta version!

New in version 2.0beta:
- Speaking URL functionality. This means that if you like, the picture title (or its filename if no title is given) will be included into the URL.

Open codebase.php with a text editor and configure the plugin as you wish (lines 42-45) before installing it.

Please note:
The previous versions of this plugin are not 100% stable, and this beta may be even more unstable. So please test carefully before installing this in a productive gallery.

Edit: Removed file, use latest SVN snapshout from first post instead
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on June 05, 2010, 11:29:33 am
These are everything, but not permalinks :)
Really? Then what are they in your opinion? They are permanent URLs - they won't go down or change dynamically - that's what a permalink is by definition. You are right though if you claim that those different URLs all lead to the same content and that there will be a penalty for double content. But: that's a different animal.

SEOed links are not just links with .html in the end!
That's an entirely different animal. First of all, you appear to be repeating things that you seem to have read somewhere without critically looking at this. Search engine friendliness is being achieved using several techniques, which vary in as much as search engine ranking mechanisms are constant subject to change. Some years ago, search engines slightly prefered links with a trailing .htm or .html, as this used to be a guarantee for a static page. SEO techniques adopted to that and delivered dynamic sites using the extension .htm. Do your really think that the folks in Mountainview, CA are that supid? They are of course aware of this and therefore there is no longer a bonus for pages with that extension. The recommendation that you could read on SEO pages that was valid some years ago is still out there and you can read it in many places: the recommendation to create pages with the extension .htm(l). As suggested, that's no longer the case. For search engine relevance, you need textual content and keyword density (among some other things). That's one of the reasons why this plugin has been dropped from the core.
You are welcome to discuss things here, but I suggest you do not lecture us on SEO basics unless you have fully understood them.

- Speaking URL functionality. This means that if you like, the picture title (or its filename if no title is given) will be included into the URL.
Good work Timo!

Open codebase.php with a text editor and configure the plugin as you wish (lines 42-45) before installing it.
Do you plan to implement a config page for this plugin in a later version?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 05, 2010, 11:30:45 am
Thanks for having followed my tip.
Works here: http://www.test.com/gallery/displayimage-7-493-_Memoriale_WW2_.html#top_display_media

Will track it down in the next weeks any weird behaviours.
The sitemaps generator still seems to work good.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 05, 2010, 11:43:52 am
Anyway, you can add a new translation:

       $str_thumbnails = 'miniature';
        $str_displayimage = 'mostra';
        $str_toprated = 'migliore';
        $str_topn = 'popolari';
        $str_lastcomby = 'commento_di';
        $str_lastcom = 'commento';
        $str_page = 'pagina';
        $str_profile = 'profilo';
        $str_lastupby = 'novita_di';
        $str_lastup = 'novita';
        $str_search = 'cerca';
        $str_contact = 'contatti';
        $str_tdm = 'in_alto';
        $str_usermgr = 'lista_utenti';
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 05, 2010, 11:47:26 am
$str_lastcom = 'commento';
Will not work because the english word comment is included. Any other italian word with the same meaning?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 05, 2010, 11:53:02 am
Nota (note) or Osservazione are the closest in the synonim dictionary.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 05, 2010, 11:57:20 am
Good work Timo!
Do you plan to implement a config page for this plugin in a later version?

Thanks. Yes that would be nice, but I think ATM the user has to manually edit files anyways (setting RewriteBase in ht file for example), so it's acceptable this way, especially in a beta version and in the context of this plugin, that surely is not adequate for absolute beginners with Coppermine/Apache.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joachim Müller on June 05, 2010, 12:08:05 pm
Sure, it's better than nothing, but I'm really opposed to have plugins that require the end user to edit files. The main objective of using plugins is the fact that the end user doesn't have to edit files or move files around. The creation and editing of the .htaccess files should be done using the plugin's user interface. The plugin should create the .htaccess file for the end user and complain if it can't.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 05, 2010, 01:09:58 pm
I've added my changes to the SVN, including italian language and some performance optimizations. Please use the link to the SVN in the first post of this thread to download.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 05, 2010, 01:35:25 pm
--> http://www.test.com/gallery/mostra-7-493-_Memoriale_WW2_.html#inalto
 ;)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 05, 2010, 02:23:48 pm
How about contributing your theme in exchange? ;)

Here's my gallery (http://pics.timos-welt.de/) (german, with speaking URLs).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 05, 2010, 05:26:57 pm
At the moment it's a real mess because I renewed my layout a month ago and the gallery actually it's a mix of both general website layout sheets and specific custom cpg css classess (which doesn't do nothing without the general website sheets), so it isn't exportable as a stand alone cpg theme.
After my summer exams and US trip I'll take a look and see how to export a stand alone theme. ;)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: taucher_0815 on June 06, 2010, 07:04:06 pm
Hi @ all!

I have a little problem with this Plugin:

The search via the Tag-Cloud is not working and when I uninstall the Plugin the Website still refers to index.html and not to index.php.

URL: http://www.sk-foto.info (http://www.sk-foto.info)

Currently the Plugin is enabled and a manual Serarch for "adac" creates the following URL and displays all thumbs :http://www.sk-foto.info/thumbnails.php?search=adac&submit=suchen&album=search&title=on&newer_than=&caption=on&older_than=&keywords=on&type=AND (http://www.sk-foto.info/thumbnails.php?search=adac&submit=suchen&album=search&title=on&newer_than=&caption=on&older_than=&keywords=on&type=AND)

Clicking the tag in the cloud gives me this URL: http://www.sk-foto.info/thumbnails-search.html&keywords=on&search=adac (http://www.sk-foto.info/thumbnails-search.html&keywords=on&search=adac) and diplays this errormessage: The requested URL /search.php&keywords=on&search=adac was not found on this server.

attached is the current .htaccess-file.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: taucher_0815 on June 06, 2010, 07:30:12 pm
OK, got the stuff with the index.html resolved.
Config-error by me in the general settings.

Now the SEF-Plugin is disabled.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 07, 2010, 07:26:48 am
Thanks for your report, I've added the info to the known_issues file in the SVN.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 07, 2010, 12:45:02 pm
Keyword search problem should be fixed in SVN (r7653).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: taucher_0815 on June 07, 2010, 12:53:56 pm
Confirmed working!

Many thanks for quick support!!!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 07, 2010, 12:55:07 pm
Yeah, confirmed! ;D
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 09, 2010, 03:01:38 pm
I've added some more 'speaking' URL functionality to the SVN (for thumbnail pages and user profiles).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: taucher_0815 on June 09, 2010, 04:11:07 pm
also confirmed working
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joe Carver on June 11, 2010, 06:06:33 pm
Hello Timos,

I have a (small?) feature request.

Is it possible to rewrite the link "Album List"   ( index.php?cat=0   )
be different than the home page link?           (  index.php   )

At the moment it looks to be that both are rewritten to   ( index.html   )
when I have tried it myself and see on your gallery. (nice pictures!)

My reasons for asking are somewhat selfish - I have made 4 plugins that
need to have different values for:                 ( server->getRaw('REQUEST_URI')  )
This is for the plugin to know which page it is on because I have found that both pages are ( $cat = 0  )
for cpg and the plugin.

Any values that you choose a would be fine. The cpg 1.4 version used   (  index-0.html    )  but at
the same time did not rewrite the home page from index.php.

Thanks
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on June 11, 2010, 10:16:18 pm
Afaik index.php?cat=0 and index.php have the same content. Why do you want to do different things with your plugin?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joe Carver on June 11, 2010, 11:21:19 pm
It is actually to replace/remove/change duplicate content so when a visitor or search engine follows the link named "Album List" from the home page they see something different than the home page. Of course this could be done with custom theming or with code mods., but plugins are for the novice -> average user of cpg as you know.

These are the plugins' actions.

All of the plugins are now on the User Contributed Plugins page. I have them running (more or less)
Here (http://photos-by.joe-carver.com/index.php)   and    Here (http://www.i-imagine.net/artists/index.php) (with a slightly modded SEF URL's plugin)

If the request is too late or difficult, I understand.

Thanks for asking
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on June 13, 2010, 04:09:53 pm
Is underscore allowed? In case I'd suggest an improved translation which fits better in the context:

FROM->TO:

inalto--> top
miniature--> album
contacto--> this was an error, it is spanish, I already suggested "contatto"
novitadi--> novita_di
migliore--> piu_votate
osservazionedi--> contributo_di
osservazione--> contributo
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on June 15, 2010, 01:06:45 pm
It is actually to replace/remove/change duplicate content so when a visitor or search engine follows the link named "Album List" from the home page they see something different than the home page.

Delete this line from codebase.php and you're fine:
Code: [Select]
    $html = preg_replace('/index\.php\?cat=0/i','index.html',$html);
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Joe Carver on June 15, 2010, 01:10:37 pm
Thanks! I will give it a try.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on July 24, 2010, 11:12:41 am
Is there a config-setting for changing characters like åäö? I noticed ö is changed to oe in Timos link above, but my ö get removed.

http://uppsalafoto.se/galleri/
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 24, 2010, 12:02:00 pm
It's this section in codebase.php that currently only works for german. Feel free to contribute rules for another language:
Code: [Select]
            if ($sef_language == 'german')
            {
              $urlname = str_replace('%C3%B6','oe',$urlname);
              $urlname = str_replace('%C3%BC','ue',$urlname);
              $urlname = str_replace('%C3%9F','ss',$urlname);
              $urlname = str_replace('%C3%A4','ae',$urlname);
              $urlname = str_replace('%C3%9C','Ue',$urlname);
              $urlname = str_replace('%C3%84','Ae',$urlname);
              $urlname = str_replace('%C3%96','Oe',$urlname);
            }
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: ThunderBolt on July 25, 2010, 10:46:19 am
Hi, how can I make it work with the "File Replace" plugin?

The normal link to replace is: http://gallerylink.com/displayimage.php?replacer_pid=39546
And with SEF it's: http://gallerylink.com/displayimage-2376-39546.html?replacer_pid=39546

The SEF link doesn't work and I don't understand much about htaccess.

Thanks!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on July 25, 2010, 01:46:11 pm
Ok, heres an attempt for swedish

Code: [Select]
if ($sef_language == 'swedish')
            {
$urlname = str_replace('%C3%A4','ae',$urlname);
$urlname = str_replace('%C3%84','Ae',$urlname);
$urlname = str_replace('%C3%A5','aa',$urlname);
$urlname = str_replace('%C3%85','Aa',$urlname);
$urlname = str_replace('%C3%B6','oe',$urlname);
$urlname = str_replace('%C3%96','Oe',$urlname);
}

Do the replacements have to be language-specific?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 26, 2010, 01:35:07 pm
It's just a performance thing - it doesn't make any sense to replace characters like åäö in an english speaking gallery. Every str_replace needs time and server performance. That's why I only implemented these for german umlauts ÄÖÜäöüß, and only do the replacement if language really is german.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on July 26, 2010, 07:37:25 pm
Hi, how can I make it work with the "File Replace" plugin?

The normal link to replace is: http://gallerylink.com/displayimage.php?replacer_pid=39546
And with SEF it's: http://gallerylink.com/displayimage-2376-39546.html?replacer_pid=39546

The SEF link doesn't work and I don't understand much about htaccess.
What happens if you click on the SEF link?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on July 26, 2010, 10:44:51 pm
It's just a performance thing - it doesn't make any sense to replace characters like åäö in an english speaking gallery. Every str_replace needs time and server performance. That's why I only implemented these for german umlauts ÄÖÜäöüß, and only do the replacement if language really is german.

I see, but how about english speaking gallery with "international" users?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 26, 2010, 11:40:38 pm
Give me a swedish language file / codebase snip, a swedish replacement list for special characters, a swedish htaccess.txt, and I will add it to the plugin. Give me complaints, and I will ignore them. It's really that easy. I don't speak swedish (although I wish I did with respect to your royal princesses).  ;D
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: ThunderBolt on July 27, 2010, 12:08:12 am
What happens if you click on the SEF link?

Like a "loop", it goes back to the same page. If I click on "http://pics.britney.com.br/displayimage-2387-39701.html?replacer_pid=39701", it just "reload" the page.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on July 27, 2010, 11:23:37 am
Give me a swedish language file / codebase snip, a swedish replacement list for special characters, a swedish htaccess.txt, and I will add it to the plugin. Give me complaints, and I will ignore them. It's really that easy. I don't speak swedish (although I wish I did with respect to your royal princesses).  ;D

Great, I will try and come up with the files.
Princess is now off the market, but she has a sister  :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: ThunderBolt on July 30, 2010, 10:38:50 pm
Hi, how can I make it work with the "File Replace" plugin?

The normal link to replace is: http://gallerylink.com/displayimage.php?replacer_pid=39546
And with SEF it's: http://gallerylink.com/displayimage-2376-39546.html?replacer_pid=39546

The SEF link doesn't work and I don't understand much about htaccess.

Thanks!

Like a "loop", it goes back to the same page. If I click on "http://pics.britney.com.br/displayimage-2387-39701.html?replacer_pid=39701", it just "reload" the page.


Anyone knows how can I fix it? =/

Thanks!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: phill104 on July 30, 2010, 11:13:26 pm
I've never tried those 2 together. In fact I have never used either of these plugins. Have you tried altering the order of the plugins?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: ThunderBolt on July 31, 2010, 12:47:09 am
I've never tried those 2 together. In fact I have never used either of these plugins. Have you tried altering the order of the plugins?

Yes I did. I think that some changes need to be made on .htaccess, but I don't know much about it.

Code: [Select]
#
# Rewrite displayimage urls
#
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html(.*) displayimage.php?album=$1&cat=$2&pid=$3$4 [NC]

RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)\.html(.*) displayimage.php?album=$1&pid=$2$3 [NC]

RewriteRule displayimage-([0-9]+)\.html(.*) displayimage.php?pid=$1$2 [NC]

RewriteRule slideshow-([0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html(.*) displayimage.php?album=$1&pid=$2&slideshow=$3$4 [NC]

RewriteRule slideshow-([a-z]+)-([\-]?[0-9]+)-([0-9]+)-([0-9]+)\.html(.*) displayimage.php?album=$1&cat=$2&pid=$3&slideshow=$4$5 [NC]
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 31, 2010, 07:00:52 pm
Everything is ok there. I made a little change to the flie_replacer plugin, please try the latest SVN version:
Download SVN Version of File Replacer Plugin (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/file_replacer.tar.gz?view=tar)

Does this fix your problem?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 31, 2010, 07:10:25 pm
Same was valid for the custom_thumb plugin, I changed that, too. There was something wrong with the changelog file as it seems (it was gone); I added it again.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: ThunderBolt on August 01, 2010, 11:04:52 pm
Everything is ok there. I made a little change to the flie_replacer plugin, please try the latest SVN version:
Download SVN Version of File Replacer Plugin (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/file_replacer.tar.gz?view=tar)

Does this fix your problem?

Yes, fixed! Thanks! :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on August 11, 2010, 12:37:06 pm
There was something wrong with the changelog file as it seems (it was gone); I added it again.
I deleted them, as they weren't complete and I personally don't need changelogs for my plugins, as I document the changes in the svn log. I'll delete that files again and release the new versions soon.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Bobses on August 14, 2010, 08:06:01 pm
Sef-urls_v1.4 plugin don't work for me: I receive only 404 error. I mention that is the only plugin enabled.
This is my incipient gallery: www.feroviarul.ro/foto
Any idea?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on August 14, 2010, 08:24:42 pm
Seems that the required htaccess file doesn't exist or contains error. Please check.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Bobses on August 14, 2010, 08:42:47 pm
First of all, thanks for your quick answer.
Second, you are right: .htacces doesn't exist. Well, it's easy to create it, but what will it contain?
Thanks.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on August 14, 2010, 08:49:38 pm
Please read the docs and look at the example files that are in the package.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Bobses on August 14, 2010, 08:55:31 pm
Hm, I can't edit previous post...
Well, I've renamed ht.txt in .htaccess, then I  copied this file in my gallery. Likes everything to be okay now, but I dont't like the urls:
Quote
http://www.feroviarul.ro/foto/index-2.html
instead
Quote
http://www.feroviarul.ro/foto/accidente
Can anything be done about it? I would like the url contain the category or file name... :) Is it too much? :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on August 14, 2010, 09:16:43 pm
You have to edit codebase.php. But you always need information you can process by the htaccess rewrite rules. So it would be the best to just add some more stuff to the url, but not remove anything.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Bobses on August 14, 2010, 09:20:56 pm
It is too hard for me... :( Thanks anyway.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on August 20, 2010, 10:29:02 am
Timo you have done e great job with the Speaking URL functionality!
But would like to see a few things more.
Would be great if each file have unique urls.
E.g. instead of an url like this: http://pics.timos-welt.de/bild-neueste-0-1108-_Dresdner_Frauenkirche_.html to have only this http://pics.timos-welt.de/bild-1108-_Dresdner_Frauenkirche_.html
I mean permalinks everywhere in the gallery, no matter if we are viewing a photo from the Last viewed, Last additions or Last comments, etc. The same thing for the photos in the film strip and previous and next file. In the moment we have multiple urls for the same photo and you know this is not good at all.
I hope you will take into consideration this post.

Cheers
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on August 20, 2010, 10:57:52 am
I mean permalinks everywhere in the gallery, no matter if we are viewing a photo from the Last viewed, Last additions or Last comments, etc. The same thing for the photos in the film strip and previous and next file. In the moment we have multiple urls for the same photo and you know this is not good at all.
The additional information is required to use the meta albums. If you drop that information, you always get the regular album view.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on August 20, 2010, 01:35:01 pm
Hm it could be possible if I would take the site referer into account and/or would save the current meta album in a cookie. But that would make it even more risky to use this plugin, so I tend not to do it.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on August 20, 2010, 04:46:32 pm
Hm it could be possible if I would take the site referer into account and/or would save the current meta album in a cookie. But that would make it even more risky to use this plugin, so I tend not to do it.

I understand.
Than this situation can be solved using the canonical tag (http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html). Every file has an unique url, as well every album and every category. Adding them the canonical tag would solve the problem with the multiple urls. Can you do this? Please.
Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on August 20, 2010, 04:48:54 pm
Maybe this hack here can be useful http://forum.coppermine-gallery.net/index.php/topic,49953.0.html ?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: papukaija on August 20, 2010, 06:35:50 pm
Adding them the canonical tag would solve the problem with the multiple urls. Can you do this? Please.
There's already a plugin (http://forum.coppermine-gallery.net/index.php/topic,64647.msg321065.html#msg321065) which adds <link rel="canonical ... /> to meta type pictures (lastup, most viewed, search, last comment, top rated).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: wbnp on September 07, 2010, 10:43:14 pm
I'm having trouble with the installation of this plugin.

The button that would allow me to configure does not show up, it looks like it is missing a bit of code.  Please see attached photo.

I've downloaded the files a couple of times so I'm not sure if there is a problem with the download, the extract or???

Thanks!

www.whyboysneedparents.com/Coppermine
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: papukaija on September 08, 2010, 12:12:13 pm
That's possibly a bug in the svn version (v2.1). Is the link working in the latest stable (and supported) version which is currently v.1.8?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: wbnp on September 08, 2010, 05:39:02 pm
HI papukaija,

Is there supposed to be a configure link in 1.8 - if so, no it doesn't show up.  If you mean the link to download 1.8 yes that works.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on September 08, 2010, 05:48:19 pm
As far I can see there's currently no configuration in the latest svn version.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: wbnp on September 08, 2010, 06:26:17 pm
Hi Αndré,

Thanks for clearing that up - when I saw what looked like a broken link to "Configure Search Engine Friendly URLs" in the screen shot above I thought I had hosed something up.

I've gone back through the posts and found that you just change the code.

I did notice on page 4 of this thread you said, "Please read the docs and look at the example files that are in the package."

I didn't notice anything like that when I downloaded the v1.8.zip or the latest SVN snapshot can you point me to where they are located as I've hunted around and am unable to find them.

As always, thanks for your help!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: papukaija on September 08, 2010, 06:36:31 pm
As far I can see there's currently no configuration in the latest svn version.
Actually, there's one (as a placeholder) since rev 7752 (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/sef_urls/configuration.php?r1=7644&r2=7752), but due to coding mistake that link is visible and not invisible.

To fix it, change line 38 of codebase.php from
Code: [Select]
$configuration_link = 'a href="">' . sprintf($lang_plugin_sef_urls['configure_x'], $lang_plugin_sef_urls['name']) . '</a>'; to
Code: [Select]
$configuration_link = '<a href="">' . sprintf($lang_plugin_sef_urls['configure_x'], $lang_plugin_sef_urls['name']) . '</a>';
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on September 08, 2010, 06:42:12 pm
I just wanted to clarify, that there is no configuration code in the plugin. If you correct that link it will do exactly the same as before: nothing.

you just change the code
I never contributed code to this plugin. My post was an answer at Timo.

I did notice on page 4 of this thread you said, "Please read the docs and look at the example files that are in the package."

I didn't notice anything like that
The 'documentation' is the .htaccess stuff.


Please read the posts carefully (and in context to the whole thread) to not draw wrong conclusions.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: wbnp on September 08, 2010, 07:57:20 pm
Hi Αndré,

I just wanted to clarify, that there is no configuration code in the plugin. If you correct that link it will do exactly the same as before: nothing.

It might help so that some users don't conclude that there is a missing configuration page so that is at least a little something.

Quote from: Αndré
I never contributed code to this plugin. My post was an answer at Timo.

I wasn't suggesting that you personally did any coding rather the "you" (the end user) change (edit) the code to configure the plugin.

Quote from: Αndré
The 'documentation' is the .htaccess stuff.


Please read the posts carefully (and in context to the whole thread) to not draw wrong conclusions.

No matter how carefully I read the posts I doubt I would ever conclude that "Please read the docs and look at the example files that are in the package" meant look at the .htaccess file.  :)

Anyway, thanks for your help you have cleared up the issues I was having!!!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on September 08, 2010, 08:04:05 pm
I wasn't suggesting that you personally did any coding rather the "you" (the end user) change (edit) the code to configure the plugin.
Sorry, I misread that sentence.

thanks for your help you have cleared up the issues I was having!!!
That pleases me :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: wbnp on September 08, 2010, 08:08:11 pm
Sorry, I misread that sentence.

No problem!

Quote
That pleases me :)

You are way too easy to please LOL!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on September 14, 2010, 12:58:49 pm
Trying to get around to do the swedish translation and got stuck on two terms. $str_topn? It's not toprated or most viewed? And $1top_display_media$2?
Thanks

Give me a swedish language file / codebase snip, a swedish replacement list for special characters, a swedish htaccess.txt, and I will add it to the plugin. Give me complaints, and I will ignore them. It's really that easy. I don't speak swedish (although I wish I did with respect to your royal princesses).  ;D
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: nickelas on September 19, 2010, 12:00:08 pm
Swedish translation:

Code: [Select]
   $str_thumbnails = 'miniatyrer';
        $str_displayimage = 'bild';
        $str_toprated = 'topplista';
        $str_topn = 'mestvisade';
        $str_lastcomby = 'kommenteradeav';
        $str_lastcom = 'kommenterade';
        $str_page = 'sida';
        $str_profile = 'anvaendare';
        $str_lastupby = 'senasteav';
        $str_lastup = 'senaste';
        $str_search = 'soek';
        $str_contact = 'kontakt';
        $str_tdm = 'upp';
        $str_usermgr = 'anvaendarlista';

.htaccess

Code: [Select]
RewriteRule soek.html(.*) search.php$1 [NC]

RewriteRule kontakt.html(.*) contact.php$1 [NC]

RewriteRule (.*)topplista(.*) $1toprated$2 [NC]

RewriteRule (.*)mestvisade(.*) $1topn$2 [NC]

RewriteRule (.*)kommenteradeav(.*) $1lastcomby$2 [NC]

RewriteRule (.*)kommenterade(.*) $1lastcom$2 [NC]

RewriteRule (.*)sida(.*) $1page$2 [NC]

RewriteRule (.*)anvaendarlista(.*) $1usermgr$2 [NC]

RewriteRule (.*)anvaendare(.*) $1profile$2 [NC]

RewriteRule (.*)oeverblick(.*) $1thumbnails$2 [NC]

RewriteRule (.*)bild(.*) $1displayimage$2 [NC]

RewriteRule (.*)senasteav(.*) $1lastupby$2 [NC]

RewriteRule (.*)senaste(.*) $1lastup$2 [NC]

RewriteRule (.*)soek(.*) $1search$2 [NC]

RewriteRule (.*)upp(.*) $1top_display_media$2 [NC]

Replacement characters here:
http://forum.coppermine-gallery.net/index.php/topic,42568.msg329207.html#msg329207

Did I post it the right way? Would be great if it could be added any time soon
Cheers
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on September 22, 2010, 02:14:56 pm
Added Swedish translation in r7926 (http://coppermine.svn.sourceforge.net/viewvc/coppermine?revision=7926&view=revision).
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: tomvanhell on October 28, 2010, 04:10:25 pm
bad plugin. database crashed. don.t works >:( >:( >:(
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on October 28, 2010, 04:49:01 pm
bad plugin. database crashed. don.t works >:( >:( >:(
Maybe you've done something wrong?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: poubao on October 28, 2010, 06:24:28 pm
Don't use CPG 1.5 plugin on <!--Coppermine Photo Gallery 1.4.25 (stable)-->
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 29, 2010, 10:55:08 pm
On latest svn codebase.php:

-Italian:        $str_contact = 'contatto'    and not 'contacto'

-Italian         maybe $str_tdm = '#top'; is better than $str_tdm = '#inalto';
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 12:53:32 pm
Oh, another thing:

Let's say that a title of a photo contains an unicode character such as "ù", as in this photo (Piazza del Gesù): http://www.test.com/gallery/mostra-cerca-0-1-_Piazza_del_Ges_.html#top
Any way to rewrite that "ù" so that it becomes a "u" in the link?
http://www.test.com/gallery/mostra-cerca-0-1-_Piazza_del_Ges_.html#top  --> http://www.test.com/gallery/mostra-cerca-0-1-_Piazza_del_Gesu.html#top

The same should apply for "à è ò"...

Bye
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 11, 2010, 01:49:09 pm
Any way to rewrite that "ù" so that it becomes a "u" in the link?
We have a transliteration database in cpg1.5.x:
Code: [Select]
require_once('include/transliteration.inc.php');
$str = transliteration_process($str, '_');
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 02:40:54 pm
So, if I got it well, the issue can't be handled by the plugin.

Thanks.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 11, 2010, 02:53:10 pm
No, it has to be changed in the plugin! I had a short look at codebase.php and found hardcoded umlauts replacement, which could also be handled by the transliteration library. Search the code for $urlname and try to change that lines if you know your way around. Otherwise you'll have to wait until someone fixes that issue.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 03:01:37 pm
Oh, I tought that the transliteration function was hardcoded in the headers of the gallery itself.

I tried with &#249 and &#89, the two representations of the "ù", but nothing happend
Code: [Select]
if ($sef_language == 'italian')
            {
            $urlname = str_replace('&#89','u',$urlname);
            }

Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 03:14:14 pm
...and same thing with
Code: [Select]
%26#249%3B, which should be the CORRECT form.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 11, 2010, 03:53:57 pm
which should be the CORRECT form
'ù' is the only correct form of 'ù' imo. The transliteration library only processes characters, but not entities. You have to decode them if they're encoded.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 03:57:55 pm
Code: [Select]
if ($sef_language == 'italian')
            {
$urlname = str_replace('ù','u',$urlname);
            }

Still no results.
I used the html form of "ù" because I copied the german version of the str_replace function.

Code: [Select]
            if ($sef_language == 'german')
            {
              $urlname = str_replace('%C3%B6','oe',$urlname);
              $urlname = str_replace('%C3%BC','ue',$urlname);
              $urlname = str_replace('%C3%9F','ss',$urlname);
              $urlname = str_replace('%C3%A4','ae',$urlname);
              $urlname = str_replace('%C3%9C','Ue',$urlname);
              $urlname = str_replace('%C3%84','Ae',$urlname);
              $urlname = str_replace('%C3%96','Oe',$urlname);
            }
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 11, 2010, 04:04:22 pm
Feel free to change codebase.php to your needs, but I don't support individual issues for this plugin.
if you know your way around. Otherwise you'll have to wait until someone fixes that issue.
I want to get rid of the hard-coded character replacement and use the transliteration library instead, that's why I replied to your question.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 11, 2010, 04:12:45 pm
I'll let you know in case the library will do the trick.
In this case, I'd delete theese hardcoded german letters.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: dance with dragon on November 18, 2010, 02:10:07 am
I have installed this plugin. It is very cool! Thanks and it's my web:http:www.diggers.tk Welcome!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: drownedgod on November 19, 2010, 04:17:57 am
I have uninstalled this but i can't seem to find the .htaccess. now all my images are broken. what do i do?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 19, 2010, 09:15:43 am
The .htaccess file is in your gallery root directory. Some hosts don't list hidden files. In that case, ask your provider to remove that file or use a little php script that removes that file for you:
Code: [Select]
<?php unlink('.htaccess'); ?>
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on January 05, 2011, 04:11:03 pm
This a beta version!

New in version 2.0beta:
- Speaking URL functionality. This means that if you like, the picture title (or its filename if no title is given) will be included into the URL.

Open codebase.php with a text editor and configure the plugin as you wish (lines 42-45) before installing it.

Please note:
The previous versions of this plugin are not 100% stable, and this beta may be even more unstable. So please test carefully before installing this in a productive gallery.

Edit: Removed file, use latest SVN snapshout from first post instead

How to enable the speaking URLs?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on January 05, 2011, 04:26:36 pm
How to enable the speaking URLs?
Please read the docs:
Quote
Open codebase.php with a text editor and configure the plugin as you wish (lines 42-45) before installing it.
Code: [Select]
    // Configure here
    $sef_language              = 'english';  // set to english, german, french, italian or spanish
    $speakingpic_placeholder   = '-9b6o4';  // set to '' (empty string) to disable speaking URL functionality for files
    $speakingalbum_placeholder = '-65o4c';  // set to '' (empty string) to disable speaking URL functionality for albums
    $speakinguser_placeholder  = '-89occ';  // set to '' (empty string) to disable speaking URL functionality for users
    $number_of_url_chars       = 42;        // max number of chars in speaking URL functionality
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on January 05, 2011, 10:22:36 pm
Thanks André.
I have another question. Is there any easy way to replace the words "thumbnails" with "foto" and "displayimage" with "img". The rest is fine for me, just those two want to change.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on January 05, 2011, 10:26:42 pm
You can of course replace them in codebase.php. But keep in mind to update the htaccess file, too. I don't know if it creates some odd behavior. I don't recommend to modify the plugin that way, nor can I assist you.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on January 05, 2011, 10:37:57 pm
I tried but it gives me errors.
Maybe the author of the plugin can say something more about this.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: profili on January 05, 2011, 11:30:55 pm
Of course you can modify the plugin to only use that variant: http://coppermine-gallery.net/demo/cpg15x/displayimage.php?pid=6 - but that limits the functionality of Coppermine substantially.

Could you achieve this? I don't really care about the meta-albums. Maybe a little hack could be useful for those like me.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: alanz01 on March 09, 2011, 07:30:35 pm
I have noticed some interaction behavior with this plug-in and other plug-ins that when installed include a button to go to the support thread here at the board. This issue was briefly mentioned on pages 1 and 2 of this thread but it looks like it was dropped with no further comment.

If I examine the support thread URL in the php code of a given plug-in, the URL will look something like this:

Code: [Select]
http://forum.coppermine-gallery.net/index.php/topic,42568.0.html
but what gets displayed in the far lower left browser window and what gets sent to the server is:

Code: [Select]
http://forum.coppermine-gallery.net/index.html/topic,42568.0.html
which generates a 404 because the "index.php" portion of the URL is converted to "index.html."

Is there some way I can exclude the conversion of "index.php" to "index.html" in the case of URLs that point to this forum?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on March 29, 2011, 11:25:29 pm
Hey Folks,

Excellent plugin, thank you.

I've installed it, and it's working well, no issues at all, on cpg1.5.12 for me.

One query I have is can I, and if so how, remove the first and last underscore from the text it writes?

Example:

http://www.skolaiimages.com/stock/thumbnails-92-_Wrangell_St_Elias_National_Park_Coastal_R.html

if possible, without too much hassle, I'd like it to read

http://www.skolaiimages.com/stock/thumbnails-92-Wrangell_St_Elias_National_Park_Coastal_R.html

or

http://www.skolaiimages.com/stock/thumbnails-92_Wrangell_St_Elias_National_Park_Coastal_R.html

If the album name is shorter than the truncated point, then I get:

http://www.skolaiimages.com/stock/thumbnails-13-_Grizzly_Bears_Photos_.html

which I'd like to be:

http://www.skolaiimages.com/stock/thumbnails-13-Grizzly_Bears_Photos.html

Is something like this possible? I'd really rather the underscores all the regular dashes, like

http://www.skolaiimages.com/stock/thumbnails-13-Grizzly-Bears-Photos.html

but that's not a big concern, and I figure that would involve quite a big more hacking to configure, no?
I looked at the htaccess file, but wasn't sure where or how to make these changes. Everything I tried didn't work.

Thanks so much.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: lineart on April 02, 2011, 03:49:18 pm

How i can auto-add "file name" (such as nice_picture.jpg) in page adress?

Sample:

in codebase.php

$html = preg_replace('/displayimage\.php\?album=([a-z0-9]+)(\&|\&amp;)pos=([\-0-9]+)/i','nice_picture-$1-$3.html',$html); 

and in .htaccess

RewriteRule nice_picture-([a-z0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&pos=$2 [NC]

Help or explain me please.. ???

Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on April 05, 2011, 01:06:11 am
Hey Folks,

This is probably needless, but the query I asked above is solved. Extra underscores are gone. Please continue to ignore this post (http://forum.coppermine-gallery.net/index.php/topic,42568.msg348019.html#msg348019).

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: alanz01 on April 05, 2011, 01:37:21 am
What did you do to solve it? I would like to have the same feature.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on April 05, 2011, 01:46:42 am
Hey Alanz01,

What did I do? this (http://forum.coppermine-gallery.net/index.php/topic,71724.msg348263.html#msg348263). :)

I wish I could tell you. Foulu did the work, and I'm not sure entirely what he did, but solved it right up.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on April 05, 2011, 01:44:38 pm
Foulu did the work, and I'm not sure entirely what he did
You could try find out the changes with a diff viewer. I suggest to do that asap, otherwise your gallery will become one of many galleries that lacks many versions behind, because the administrators have paid somebody to install/customize their gallery and they don't know how to update their galleries.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on April 05, 2011, 08:24:10 pm
Hey André

Thanks - yes, I'll see if I can find out. I'm putting out fires one at a time, and right now, that info is not too high on my list, but I'll try to see if I can find out as I get some other, more pressing, things attended to.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on April 07, 2011, 02:31:17 am
hey Folks,

I haven't had time to sift through it yet and see what might have been changed, but I'll upload the codebase.php file from my site and you're free to see if it works for you. I believe that is the only file that has changed.

See attached file.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: alanz01 on April 07, 2011, 07:10:05 am
Looks like the changes are at lines 229 to 234 and lines 248 to 251 of the new codebase.php
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: elwave on May 20, 2011, 11:15:48 am
hm, I enabled this but nothing seems to have changed. However if I edit this bit:

Code: [Select]
#  Uncomment the following line if your webserver's
#  URL is not directly related to physical file paths.
#  Update "YOUR_COPPERMINE_ROOT" (just / for root)

# RewriteBase /

I definitely get a reaction (usually it breaking in some way lol)

My gallery is simply at /home/xxxxx/public_html/gallery, and it seemed to edit the .htaccess file just fine when I enabled it. Do I need to change the RewriteBase line? I would guess not...

Hm, I wonder why nothing is renamed!

I'll have to continue to investigate this o.O
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: enriquei on June 24, 2011, 05:15:50 am
i have problem in search and i didnt get the right help
http://photos.myhotels.ws/thumbnails-search.html?keywords=on?search=%D9%81%D9%86%D8%A7%D8%AF%D9%82,%D8%AA%D8%A7%D9%8A%D8%A8%D9%8A%D9%87,%D8%AA%D8%A7%D9%8A%D9%88%D8%A7%D9%86
not working

and if work it should be like this
http://lebnights.net/photos/thumbnails-search-جميلات,لبنان,بنات,لبنان.html
waiting yr help
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on July 03, 2011, 03:55:55 am
Hi,

Sorry if this is a stupid question  :( but do I need to do anything after I install plug-in?  The sef_url is installed, but I am still getting the old url's. 

I didn't see any instructions included in the plug-in package, and I read through most of the forum  :-[
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on July 08, 2011, 06:40:37 am
/bump
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 08, 2011, 08:54:25 am
No, normally you don't need to do anything with this plugin. It consists out of two components:
- a page filter will replace all links in each coppermine page with SEF ones
- a .htaccess-file will make your Apache webserver re-translate them

The .htaccess file can be overwritten when installing this plugin (if it already exists), and you will be ask if it should be deleted when uninstalling it.

I recommend to place it as the last plugin in the chain, meaning to move it all the way down on plugin manager page in the list of installed plugins.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on July 11, 2011, 07:03:39 am
I am using the plug-in from the first post of this topic, and it's still not working  :(. 

I feel kinda stupid, since I don't know what's wrong.  I checked with my webserver and my website is on a Linux server running Apache, so that's okay.  SEF_URL is also the last plug-in.

Stupid question, but it seems like there should be a .htaccess file created in the root of my Coppermine gallery, correct?  I don't see this file. 



Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Timos-Welt on July 11, 2011, 09:12:43 am
Install it and post a link to your gallery please.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on July 15, 2011, 01:11:49 am
Gallery link: http://universeofmen.com/charly/index.php

Also, I attached a picture of my Plugin Manager showing that SEF_URL should be installed.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on July 24, 2011, 03:13:22 am
/bump  :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: enriquei on July 25, 2011, 04:38:30 am
i really dont know why no one help me here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
you reply to other post and not to mine
still waiting yr help since many days !!
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: enriquei on August 10, 2011, 12:59:15 am
i hope to get your help !
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: pols1337 on September 10, 2011, 04:59:51 pm
i hope to get your help !

@enriquei I don't think this plug-in works, and it definitely doesn't look like it is supported anymore.  My suggestion is to uninstall it. 
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: zapotex on October 11, 2011, 05:51:04 pm
Hi All!

I tried to install the plugin, but unfortunately it transforms index.php into index.html, which gives a broken link problem. Is there a simple fix to the .htaccess file to solve this problem?

Thanks everyone!

ZapoTeX
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on January 23, 2012, 03:37:56 am
hello Folks,

Is this possible/simple?

I really want a slight adjustment to the the Category section in the SEF plugin

Currently each category is displayed with index-#.html

http://www.skolaiimages.com/stock/index-4.html

Would it be possible to change that to the category name?

http://www.skolaiimages.com/stock/alaska-photos.html

Does that affect any other pages/search functions at all? It doesn't look like it to me. Would it affect the home page, index.html? It'd be good if not, but just the url for each category.

I looked at codebase.php but I don't know what I would have to change.

Thanks so much.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on February 22, 2012, 01:42:40 pm
I think that it would be nice to know if further development has been officially stopped.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on March 22, 2012, 10:47:01 pm
I noticed that "most viewed" link shows no photos.
If I use the regular address, I can see the photos in "most viewed" page.
http://www.test.com/gallery/thumbnails.php?album=topn&cat=0 -> works
http://www.test.com/gallery/miniature-popolari.html -> doesn't work

From .htaccess: RewriteRule (.*)popolari(.*) $1topn$2 [NC]

From codebase.php:  $str_topn = 'popolari';
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: purplefreak3 on January 13, 2013, 02:06:47 am
Is there any more support for this plugin, I have used it since 1.5 came out and has always worked wonderfully but then one day it just stopped working and no longer able to use it. If I enable it every link/image you click on will send user to a 404 page but on the other hand not using it any bookmarked links or links from search engines from the SEO links are then sent to a 404 page. I created a special 404 page just for the gallery but would really like to be able to keep using the SEO plugin as made the links readable and users were able to find the content of the gallery much better through search engines.

My site is
http://www.beautifuljodelle.com/gallery/ (http://www.beautifuljodelle.com/gallery/)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: purplefreak3 on January 13, 2013, 03:43:50 am
Well I got the plugin working again but I can't get the speaking urls to work again though I added the code below but does not give the speaking urls my site link is in above post.

Please read the docs:
Code: [Select]
    // Configure here
    $sef_language              = 'english';  // set to english, german, french, italian or spanish
    $speakingpic_placeholder   = '-9b6o4';  // set to '' (empty string) to disable speaking URL functionality for files
    $speakingalbum_placeholder = '-65o4c';  // set to '' (empty string) to disable speaking URL functionality for albums
    $speakinguser_placeholder  = '-89occ';  // set to '' (empty string) to disable speaking URL functionality for users
    $number_of_url_chars       = 42;        // max number of chars in speaking URL functionality
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: purplefreak3 on January 13, 2013, 03:49:47 am
All solved  ;D
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on January 13, 2013, 10:42:29 am
I have a question on this plugin.

Is this a bug?

The plugin is set to work like Jeff says in this thread here

http://forum.coppermine-gallery.net/index.php/topic,75311.msg362718.html#msg362718

He gives an example of how the plugin will display the urls. That example shows a page as

http://www.jjsphotos.co.uk/cpgallery/displayimage-7-25.html

what I'm finding is that if you add anything after the .html, it links to real pages .. when it should not ... obviously if you make that url finish in

http://www.examplewebsite.com/cpgallery/displayimage-7-25.html-howaboutyou

it should give a 404 page; but it doesn't. If you put anything after the ".html" the link still works.

The problem is then if a search engine hits some url with something tacked on to the end (all it took for my site was someone to post 2 links together, with no space between them .. so it went www.siteurl.com/lbum/displayimage-2-23.htmlhttp://www.siteurl.com/display .. and so on ... and the engine then tried to crawl the entire site, with that set of relative links.

Is there someway this can be corrected? I don't know enough about regex, etc, but it seems, from my understanding, that maybe the rewrite code in the plugin should have a "$" after the ".html" so that the re-routed url will ONLY work for .html, and anything after that (or whatever it's supposed to end in) will give a 404. Instead the rules seem to end in ".html(.*)" .. which means anything after the .html actually works. This causes problems.

I've had both Bing and Google crawl my site trying to find thousands upon thousands of links which don't exist, and have never existed. All because they found a link somewhere (google found it through the thread linked below, before Andre edited it) - and then tried to crawl the entire site with that extra piece tacked on the end of the correct urls. I had a thread on this forum asking about it, and the problem ended up being related to how this plugin works.
http://forum.coppermine-gallery.net/index.php/topic,74808.msg360407.html

http://forum.coppermine-gallery.net/index.php/topic,74804.0.html

Those threads both relate to this problem - somehow the engines got "inside" my site and will tack on some weird combination of urls together

mysite.com/stock/thumbnails-106-Juvenile-Bald-Eagle-Photos.html/displayimage-106-1516-Juvenile-bald-eagle-photo.html

You can see that is clearly 2 urls stacked together. If you replace "mysite" with "skolaiimages" you'd see a page that is actually a rendering of my main cpg page ... until I used the Redirect Match to send it to a 410. However, I'll end up having to do this with an almost infinite combination of urls.

Anyway, I hope that makes some sense to someone. I'm still dealing with issues on my site because of this. The plugin is great, but it seems this should be tidied up a bit .... I could be wrong, but that's what I'm seeing from my site, which is www.skolaiimages.com I've corrected the error, months ago, but search engines still try to crawl links that don't exist.

I hope this might be corrected? I'm also unsure what to do about it on my situation at this point.

Thanks so much.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on January 17, 2013, 08:49:12 am
A followup to the above post.

So the relative urls come from the navigation that cpg provides in the SYS Menu and Sub Menu ... so whenever a search crawler finds a bad link, and that page actually displays, all relative links on the page then get messed up.

Part of this problem started when google started following any text that is written with a url in it, even if it's not an actual link. So forums and all kinds of pages out there have a url written with some text after it, or truncate the url, and the search engine tries to crawl that .. and if the page it goes to doesn't show a 404, but shows an actual page (with a bad or wrong url), then, with this plugin, the crawler tries to find all those bad relative links.

Somehow google is trying to crawl a link on my site that says
/stock/thumbnails-53-Alaska-Stock-Phot/

that's a truncated link it got from somewhere around the web. I've now blocked it with a redirect .. but this is an incorrect workaround. There is no page on my site /stock/thumbnails-53-Alaska-Stock-Phot/ anywhere .. but the way this plugin works it causes a problem.

and it then tries to crawl everywhere - such as this one
/stock/thumbnails-53-Alaska-Stock-Phot/login.php?referer=contact.html%3Freferer%3Dindex.html%253Fcat%253D5

I see dozens, if not hundreds, of 404 pages on google webmasters tools once it finds one bad url to my site.

Here's an example. I have this page on my site.

http://www.skolaiimages.com/

stock/thumbnails-51-Bald-Eagle-Photos.html

and you'll come to the bald eagle page. Correctly. Truncate "Photos.html" to something like "Pho.html" and you'll still arrive at the page. This shouldn't work, as far as I can tell.

If anyone who can work on this plugin is interested in resolving this, or at least suggesting how to resolve it, or if its resolvable, your help would be most appreciated. Or, if the plugin is abandoned and no longer supported, maybe that could be cleared up?

I don't want to drop the plugin, as I just spent hours doing a site map and so on, and would need to redo everything if the urls change .. but as it is, it doesn't seem to work correctly.

Thank you.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Jeff Bailey on January 18, 2013, 12:28:46 am
Try replaceing the contents of your .htaccess with this
Code: [Select]
##/**************************************************
##  Coppermine 1.5.x Plugin - sef_urls
##  *************************************************
##  Copyright (c) 2003-2007 Coppermine Dev Team
##  *************************************************
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; either version 3 of the License, or
##  (at your option) any later version.
##  ********************************************
##  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/sef_urls/ht-english.txt $
##  $Revision: 7195 $
##  $LastChangedBy: timoswelt $
##  $Date: 2010-02-03 17:58:36 +0100 (Mi, 03 Feb 2010) $
##  **************************************************/

#Options FollowSymLinks SymLinksIfOwnerMatch

RewriteEngine on

#  Uncomment the following line if your webserver's
#  URL is not directly related to physical file paths.
#  Update "YOUR_COPPERMINE_ROOT" (just / for root)

#RewriteBase /YOUR_COPPERMINE_ROOT

#
# Search and contact
#

RewriteRule search.html(.*) search.php$1 [NC]

RewriteRule contact.html(.*) contact.php$1 [NC]


#
# Rewrite usrmgr urls
#

RewriteRule usermgr-page-([0-9]*).html(.*) usermgr.php?page=$1$2 [NC]

RewriteRule usermgr.html(.*) usermgr.php$1 [NC]

#
# Rewrite index urls
#

RewriteRule index.html(.*) index.php$1 [NC]

RewriteRule ^index-([0-9]*)\.html$ index.php?cat=$1 [NC]

RewriteRule ^index-([0-9]*)-page-([0-9]*)\.html$ index.php?cat=$1&page=$2 [NC]


#
# Rewrite thumbnail urls
#

RewriteRule ^thumbnails-lastupby-([0-9]+)\.html$ thumbnails.php?album=lastupby&uid=$1 [NC]

RewriteRule ^thumbnails-lastcomby-([0-9]+)\.html$ thumbnails.php?album=lastcomby&uid=$1 [NC]

RewriteRule ^thumbnails-lastupby-([0-9]+)-([0-9]+)-page-([0-9]+)\.html$ thumbnails.php?album=lastupby&cat=$1&uid=$2&page=$3 [NC]

RewriteRule ^thumbnails-lastcomby-([0-9]+)-([0-9]+)-page-([0-9]+)\.html$ thumbnails.php?album=lastcomby&cat=$1&uid=$2&page=$3 [NC]

RewriteRule ^thumbnails-([a-z0-9]*)-([\-]?[0-9]*)\.html$ thumbnails.php?album=$1&cat=$2 [NC]

RewriteRule ^thumbnails-([a-z0-9]*)-page-([0-9]*)\.html$ thumbnails.php?album=$1&page=$2 [NC]

RewriteRule ^thumbnails-([a-z0-9]*)-([\-]?[0-9]*)-page-([0-9]*)\.html$ thumbnails.php?album=$1&cat=$2&page=$3 [NC]

RewriteRule ^thumbnails-([0-9a-z]*)\.html$ thumbnails.php?album=$1 [NC]

RewriteRule ^thumbnails-search-(.*)\.html$ thumbnails.php?album=search&search=$1 [NC]


#
# Rewrite displayimage urls
#

RewriteRule ^displayimage-lastcom-([\-]?[0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)-page-([\-]?[0-9]+).html$ displayimage.php?album=lastcom&cat=$1&pid=$2&msg_id=$3&page=$4 [NC]

RewriteRule ^displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html$ displayimage.php?album=$1&cat=$2&pid=$3&uid=$4&msg_id=$5&page=$6 [NC]

RewriteRule ^displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html$ displayimage.php?album=$1&cat=$2&pid=$3&uid=$4 [NC]

RewriteRule ^displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html$ displayimage.php?album=$1&cat=$2&pid=$3 [NC]

RewriteRule ^displayimage-([a-z0-9]+)-([\-]?[0-9]+)\.html$ displayimage.php?album=$1&pid=$2 [NC]

RewriteRule ^displayimage-([0-9]+)\.html$ displayimage.php?pid=$1 [NC]


#
# Rewrite users profiles
#

RewriteRule ^profile-op-([a-z0-9_]+)\.html$ profile.php?op=$1 [NC]

RewriteRule ^profile-([0-9]+)\.html$ profile.php?uid=$1 [NC]
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on January 18, 2013, 11:11:37 am
Hey Jeff

Thanks for that. But, no, that didn't work .. it's closer, I guess, as everything turns to a 404 ... which in some ways is more accurate .. because as the plugin works right now .. if urls aren't correct, the page still displays ... so 404 errors are, in a way, closer to being correct. :)

The way the reg-ex seems to be working is to define the album # (and image # for full size image pages) and then anything after that, followed by .html ... and that's part of the problem .. it should define exactly what the url is, not allow any random combination of text and/or characters.

Further, it's not rewriting things completely. Even with the plugin activated and  running, the dynamic url still loads

site.com/stock/thumbnails.php?album=91

=

site.com/stock/thumbnails-91-Wrangell-St-Elias-Winter-Photos.html

A correct htaccess rewrite, from what I understand, would actually rewrite that url and display the correct url in the toolbar, no?

I'm cautious to uninstall, as I'm uncertain if, after doing that, to test a few things, I can just reinstall or reactivate the plugin and it will work as before? What I worry about is uninstalling it, testing a few things (which will invariably not work, because I don't know anything about this stuff) and then when I try to reinstall it or reactivate it, if it doesn't work I'm in a bigger mess.

I appreciate your help, thanks.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on January 18, 2013, 12:20:04 pm
Hi,
a strange thing I noticed is that the plugin prevents foo.com/bar to be rewrited to www.foo.com/bar

The htaccess in my root folder contains:
Code: [Select]
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

This works for the root folder and for the others subfolders but NOT for gallery subfolder.
If I type flapane.com/gallery the url doesn't get rewrited to www.flapane.com/gallery
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on March 25, 2013, 11:54:20 am
I have a question

Would it be possible to extract also the name of the categories?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on September 07, 2013, 11:23:45 pm
Googlebot (but not other bots) screws hundreds of gallery links if this plugin is enabled:
Quote
66.249.66.76 - - [07/Sep/2013:06:29:19 +0200] "GET /gallery/mostra-35-1531-_DSC_8162_1280_jpg_.htmlalbums/viaggio-parigi/albums/viaggio-londra/thumb_DSC_6873_1280.jpg HTTP/1.1" 301 180 "-" "Googlebot-Image/1.0"

I don't know from where it grabs and why it appends the bold part.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on September 11, 2013, 06:55:14 pm
Check the difference with bingbot:
Quote
157.55.35.96 - - [11/Sep/2013:17:34:36 +0200] "GET /gallery/mostra-1-891-_Gaiola_Calata_Trentaremi_2_.html HTTP/1.1" 200 9432 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on September 11, 2013, 06:58:41 pm
msnbot-media
Quote
65.55.215.97 - - [11/Sep/2013:07:11:51 +0200] "GET /gallery/albums/viaggio-newyork/normal_DSC_1187.jpg HTTP/1.1" 200 100679 "-" "msnbot-media/1.1 (+http://search.msn.com/msnbot.htm)"
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on September 16, 2013, 11:47:35 am
I forgot another error which is peculiar to googlebot:
Code: [Select]
[Mon Sep 16 11:44:43 2013] [error] [client 66.249.73.104] File does not exist: /foo/bar/public_html/displayimage.php
Actually, it should be /foo/bar/public_html/gallery/displayimage.php
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 01, 2013, 12:18:14 pm
It also causes redirect loops:
Code: [Select]
[Tue Oct 01 10:29:40 2013] [error] [client 66.249.66.62] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Also, hundreds of 404 errors noticed in Google Webmaster Tools.
If this suddenly started in September with googlebot only, then Google maybe changed googlebot algorithms. Unfortunately, Google brings the majority of referral traffic on 99% of the website, and I have no idea of any workarounds.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 05, 2013, 05:42:02 pm
Hello flapane,

I suggest you use the flags [QSA,NC,L] instead of [NC] to rewrite all urls.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 05, 2013, 07:02:08 pm
Hello Niecher.
Thanks for your contribution, I'll let you know if anything changes.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 05, 2013, 07:47:22 pm
Here's the error log from the last 20 minutes. Thye're from a spanish ip, is that you?
Did you get any http 500 messages? Those seems to be redirect loops.
Code: [Select]
CUT
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 05, 2013, 08:00:58 pm
Yes, I am.

I was watching your gallery, and you have some errors in different albums.

If you can post your code htaccess in a text file (sef_urls part only, of course) and codebase.php file (both, in a zip file) there may be a solution.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 05, 2013, 08:06:26 pm
where you have the htaccess file in your root folder or in your gallery folder?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 05, 2013, 08:07:10 pm
Sure, here's the .htaccess (in gallery folder. Also, I tried enabling and disabling RewriteBase without luck) http://pastebin.com/G4dD1iD0
Attached is codebase.php.
In the meanwhile, I've noticed http500 errors on any "most viewed" (popolari.html) and "most voted" (migliori.html) pages.

Just as a sidenote, a few days ago I tried to download the plugin from scratch, and use the english version of .htaccess. There were the same errors I posted in the last weeks.
Thanks a lot for your help.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 05, 2013, 08:14:50 pm
Ok, I'll come back here later. I will look.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 06, 2013, 10:15:19 am
Hello flapane,

In your codebase.php file you should remove the hash mark in specific language replacement as well as in all str_tdm variables, except for the Swedish language is right.

The most important problem, error 500, for the albums mentioned, part of the previous point and this is because you use the word top to rewrite top_display_media in both codebase.php and htaccess files.

I suggest that if you want to use top_display_media as it's, delete the corresponding line in your htaccess file or otherwise use in_alto, alto, up or any other synonym for both files also.

Another mistake that is not noticeable, because that is not strictly marking a beginning and an end to the rule (^ $), you will find it to the variable $str_contact = 'contatto' (and its counterpart) in the htaccess file RewriteRule ^contatti.html(.*) contact.php$1

And for RewriteBase, I suggest you use RewriteBase /gallery/

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 06, 2013, 11:12:48 am
Hello,
- I've removed the hash mark in language replacement line (303) and in str_tdm but for Swedish (where there wasn't a hash mark and I added it).
- I've deleted the top_display_media line in .htaccess (good point, I never noticed that).
- $str_contact variable has been replaced with "contatti"
- contatti.html(.*) in .htaccess has been replaced with ^contatti.html(.*). I wonder if I should do the same thing for the cerca.html(.*) rewrite rule.
- Rewritebase path has been updated

I'll check the error log and keep you updated.
In the meanwhile, thank you so much.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 06, 2013, 11:59:48 am
I meant that you should not put hash mark on the line 303 and also on any variable str_tdm for any language as it appears in the Swedish language properly. (Perhaps the google translation was not correct  :o  ::) ). Therefore, do not add hash mark to Swedish.

You had problems with the English language because it also had hash mark.

You have removed the line RewriteRule (.*)top(.*) $1top_display_media$2, but remember that the variable str_tdm in Italian language should be $str_tdm = 'top_display_media';

I just visited your gallery, and there is no 500 error for the albums mentioned.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 06, 2013, 04:05:01 pm
Sure, I removed the hash mark from line 303, I didn't put it. ;)
Code: [Select]
$html = str_replace('top_display_media',$str_tdm,$html);
I removed the hash mark from Swedish and now there aren'y any hashes inside $str_tdm variables.
Let's hope Googlebot likes the new configuration, we'll see in the next hours.  :)
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 06, 2013, 04:32:01 pm
Surely you will not get google errors now.

Google errors were being shown when the googlebot tracked the popolari and migliore albums since visiting these albums returned 500 error.

These albums work well now.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 06, 2013, 04:36:37 pm
Glad to hear it, thanks again.
What amazes me is that such errors weren't shown in the error log on the previous server where I hosted my website until August, and in Google Webmaster Tools too.
It's a pity that the original developer disappeared and can't update the original plugin.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 06, 2013, 10:26:17 pm
Unfortunately, Googlebot still tries to crawl weird urls such as
Quote
66.249.66.62 - - [06/Oct/2013:22:05:04 +0200] "GET /gallery/displayimage-1-8.htmlalbums/userpics/10001/albums/viaggio-newyork/mostra-cerca-0-12-_Via_Caracciolo_dinverno_.html HTTP/1.1" 200 5435 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

I wonder if I should add start ^ and end $ of the rule on EVERY line of .htaccess file.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 06, 2013, 10:51:45 pm
Just a short test: I added ^ and $ delimitators on ALL the rewrite rules, but nothing changed. Still htmlalbums-like urls being crawled from Googlebot.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 06, 2013, 11:50:01 pm
Hello flapane,

I think you have a little concern with all of these prompts. These are not mistakes of his gallery.

The 500 error is solved successfully.

You have been indexed by google with different urls, and google searches to check the contents, for example:

http://www.test.com/gallery/displayimage-1-8.html
http://www.test.com/gallery/mostra-8-_Golfo_di_Napoli_al_tramonto_.html

Regards.

[Edit André: replaced URL by request]
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 07, 2013, 11:22:32 am
Hello,
actually, googlebot is crawling weird URLs, as the one I posted above. If it's crawling them, there should be a reason (and they're showing off as thousands of http404s as shown in the attached image, even if they look like http200s in the access log).
http://www.test.com/gallery/displayimage-1-8.htmlalbums/userpics/10001/albums/viaggio-newyork/mostra-cerca-0-12-_Via_Caracciolo_dinverno_.html isn't an URL googlebot should crawl, because it's non-existent and it seems a mixture of 2 URLs.
Thanks
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 07, 2013, 12:40:58 pm
The log is written that way, perhaps because googlebot accessed at the same instant to 4 different url:

http://www.test.com/gallery/displayimage-1-8.html
http://www.test.com/gallery/albums/userpics/10001/
http://www.test.com/gallery/albums/viaggio-newyork/
http://www.test.com/gallery/mostra-cerca-0-12-_Via_Caracciolo_dinverno_.html

If you believe that, seeing as it is written, is part of a single url and you try to access that url, it obviously does not exist.

Regards.

[Edit André: replaced URL by request]
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 07, 2013, 12:47:08 pm
I already asked that to my web hosting some time ago, and they confirmed that the log shows one access per line only (in fact there are several accesses at the same time from "real" users and other bots, and they're displayed on different lines per URL). Also, this wouldn't explain all those errors in Google Webmaster Tools I posted in the previous message.
I don't know what Google changed in Googlebot code, why it's happening, and how to fix it, because it never happend until Mid August.
Thanks
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Niecher on October 07, 2013, 12:54:25 pm
It may be what you say,

For a long time I ignore anything that says google.

Regards.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on October 07, 2013, 12:55:54 pm
Somebody considers it as the most wise choice. ;)
Regards
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Walkinman on November 13, 2013, 08:08:09 am
flapane

I had exactly the same problem with this plugin .. http://forum.coppermine-gallery.net/index.php?topic=74808.0

The major error is that the rewrite allows for any text or characters in the url, and doesn't end anything.. Test it. You can basically write your correct url and add whatever you want in the url after the par # and it'll come up fine.

replace domain.com with skolaiimages.com

domain.com/stock/thumbnails-2-Camping-photos.html

correct.

Change it to, for example:

domain.com/stock/thumbnails-2-Caing-photos.htmltesta

shows the same page. Google would then go and try to find every url on the site with that kind of line as a prefix. I had thousands of 404s, and ended up having server usage issues, and on and on.

Another issue is that the plugin doesn't actually rewrite anything ... you can still go to your dynamic cpg urls and browse the albums that way. Which is what should happen.

I really wish someone would fix this so it works correctly. I'd definitely not recommend the plugin to anyone. I'm somewhat stuck with it now, as I have links everywhere to the 'sep friendly' urls, and on and on .. but I can assure you the plugin is most definitely NOT seo friendly. My site continues to go down on google rankings, and I'm about 95% sure all of the problems lie with this plugin.

This page here (static html page)
domain.com/alaska/wrangell-st-elias-photos.html

WAY outranks this one (cpg)
domain.com/stock/thumbnails-25-Wrangell-St-Elias-National-Park-Photos.html

I've also tested with wordpress

This page:
domain.com/alaska-polar-bear-photos/

WAYYYYY outranks this one
domain.com/stock/thumbnails-122-Polar-Bear-Photos.html

Yet that cpg page is older, has many more images, and so on. Both are in the site map, linked to correctly, and so on. The wordpress galleries outrank the cpg pages on my site virtually every time.

My site was loved by google before these kinds of problems started up. It sees double content,  and bad urls and so on and this hurts the site.

Why not a plugin that allows the user to set a url path when s/he creates a gallery? And then it's set, with any incorrect url returning a 404 (which is what should happen). It could even allow full size images to be manually set as urls as well, but really, I think for most folks, just rewriting the main album is what's most important.

One of the reasons this stuff happens a lot now is because google crawls and looks for any url it finds, even truncated urls that are not actual links. Many site aggregators now truncated the tex of a url, and so google will look for yoursite.com/albums/whatever-the-nam.... instead of whatever-the-name-of-the-page-is.html

And with this plugin, those do not return 404s, but google crawls them, and sees duplicate content.

I'm not a coder, so I can't begin to fix this. But here a couple of rules I wrote trying to solve the problem on the backdoor, and return 410s (no impact on server load)


ErrorDocument 410 "File no longer exists"
This was suggested but didn't fix it.
# RewriteRule ^(.*)\.htmlhttp\:\/ - [G,L]

I believe this below is what actually fixed it
RedirectMatch 410 ^/stock/thumbnails-18-Whitetail-Deer-Photos.htmlhttp:/

And here are 2 others I added
RedirectMatch 410 ^/stock/thumbnails-53-Alaska-Stock-Phot/
RedirectMatch 410 ^/stock/thumbnails-106-Juvenile-Bald-Eagle-Photos.html/

I'll reiterate, to anyone wanting to use the plugin, I advise against it.

Cheers

Carl
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on November 13, 2013, 11:13:52 am
The major error is that the rewrite allows for any text or characters in the url, and doesn't end anything.. Test it. You can basically write your correct url and add whatever you want in the url after the par # and it'll come up fine.

Another issue is that the plugin doesn't actually rewrite anything ... you can still go to your dynamic cpg urls and browse the albums that way. Which is what should happen.

Hello Carl,
yes, I noticed that.

My site continues to go down on google rankings, and I'm about 95% sure all of the problems lie with this plugin.

My site was loved by google before these kinds of problems started up. It sees double content,  and bad urls and so on and this hurts the site.

Don't tell me... the amount of visits on my gallery almost dropped to zero sice I first noticed the problem.

I'll try to modify and test the .htaccess rules you proposed and will report the changes.

In my humble opinion, a modern gallery should (well, in theory it "must") offer the option to flawlessy rewrite URLs (more or less in the same way WP does), nowadays it's a crucial feature.
Unfortunately, I haven't the skills to investigate further into the problems with this plugin, and the development of coppermine has been really slow in the last years (mainly because of devs dropping out of the project). That's a pity, because I loved cpg since v1.3.
If I find a way of batch converting every photo/title/description into another open source gallery which handles URLs rewrites, I may sadly consider to do it.

Thanks,
Flavio
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 11, 2014, 07:37:05 pm
hello,
New user I install the plugin and when I go on an image I get this url: http://www.ldft.fr/photo-6.html I want to know how to change photo-6.html by name the photo.html

I apologized for my language I'm french and uses google translation
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on April 13, 2014, 06:32:03 pm
In codebase.php you may want to comment the if statement on lines 198,199 and 207, so that the umlaut transliterations work with every language (just in case you want to use germanic words).
I noticed that I was getting "Rmerberg" instead of "Roemerberg".
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 16, 2014, 12:18:38 pm

Sorry I do not understand too because the lines that I have discussed are:

198 :         </span>
199 : there is nothing on this line
207 : there is nothing on this line

here is my code.php what should I change?

Code: [Select]
<?php
/**************************************************
  Coppermine 1.5.x Plugin - sef_urls
  *************************************************
  Copyright (c) 2003-2007 Coppermine Dev Team
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/sef_urls/codebase.php $
  $Revision: 7208 $
  $LastChangedBy: timoswelt $
  $Date: 2010-02-06 11:07:11 +0100 (Sa, 06 Feb 2010) $
  **************************************************/

if (!defined('IN_COPPERMINE')) { die('Not in Coppermine...');}

// Add plugin_install action
$thisplugin->add_action('plugin_install','sef_urls_install');

// Add plugin_uninstall action
$thisplugin->add_action('plugin_uninstall','sef_urls_uninstall');

// Add plugin_configure action
$thisplugin->add_action('plugin_configure','sef_urls_configure');

// Add plugin_cleanup action
$thisplugin->add_action('plugin_cleanup','sef_urls_cleanup');

// Add page_html filter
$thisplugin->add_filter('page_html','sef_urls_convert');


/**
 * Convert urls to search-engine friendly (SEF) urls
 */
function sef_urls_convert($html) {
    
    
$sef_language 'french';
    
    
// Language translation
    
if ($sef_language == 'german')
    {
        
$str_thumbnails 'uebersicht';
        
$str_displayimage 'bild';
        
$str_toprated 'beste';
        
$str_topn 'beliebteste';
        
$str_lastcomby 'kommentiertvon';
        
$str_lastcom 'kommentierte';
        
$str_page 'seite';
        
$str_profile 'benutzer';
        
$str_lastupby 'neuestevon';
        
$str_lastup 'neueste';
        
$str_search 'suche';
        
$str_contact 'kontakt';
        
$str_tdm 'oben';
        
$str_usermgr 'benutzerliste';
    }
    else if (
$sef_language == 'french')
    {
        
$str_thumbnails 'apercu';
        
$str_displayimage 'photo';
        
$str_toprated 'tresbien';
        
$str_topn 'populaire';
        
$str_lastcomby 'comentairede';
        
$str_lastcom 'comentaire';
        
$str_page 'page';
        
$str_profile 'client';
        
$str_lastupby 'neuvede';
        
$str_lastup 'neuve';
        
$str_search 'recherche';
        
$str_contact 'contacter';
        
$str_tdm 'enhaut';
        
$str_usermgr 'fichierclient';
    }
    else if (
$sef_language == 'spanish')
    {
        
$str_thumbnails 'resumen';
        
$str_displayimage 'cromo';
        
$str_toprated 'mejor';
        
$str_topn 'querido';
        
$str_lastcomby 'comentarde';
        
$str_lastcom 'comentar';
        
$str_page 'pagina';
        
$str_profile 'usuario';
        
$str_lastupby 'nuevode';
        
$str_lastup 'nuevo';
        
$str_search 'busca';
        
$str_contact 'contacto';
        
$str_tdm 'alto';
        
$str_usermgr 'usuariolistado';
    }
    else
    {
        
$str_thumbnails 'thumbnails';
        
$str_displayimage 'displayimage';
        
$str_toprated 'toprated';
        
$str_topn 'topn';
        
$str_lastcomby 'lastcomby';
        
$str_lastcom 'lastcom';
        
$str_page 'page';
        
$str_profile 'profile';
        
$str_lastupby 'lastupby';
        
$str_lastup 'lastup';
        
$str_search 'search';
        
$str_contact 'contact';
        
$str_tdm 'top_display_media';
        
$str_usermgr 'usermgr';
    }

    
// Rewrite usermgr.php
    
$html preg_replace('/usermgr\.php\?page=([0-9]+)/i',$str_usermgr.'-'.$str_page.'-$1.html',$html);
    
$html preg_replace('/usermgr\.php/i',$str_usermgr.'.html',$html);

    
// Rewrite index.php
    
$html preg_replace('/index\.php\?cat=([0-9]+)(\&|\&amp;)page=([0-9]+)/i','index-$1-'.$str_page.'-$3.html',$html);
    
$html preg_replace('/index\.php\?cat=0/i','index.html',$html);
    
$html preg_replace('/index\.php\?cat=([0-9]+)/i','index-$1.html',$html);
    
$html preg_replace('/index\.php/i','index.html',$html);
    
    
// Rewrite thumbnails.php
    
$html preg_replace('/thumbnails\.php\?album=lastupby(\&|\&amp;)uid=([0-9]+)/i',$str_thumbnails.'-'.$str_lastupby.'-$2.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=lastcomby(\&|\&amp;)uid=([0-9]+)/i',$str_thumbnails.'-'.$str_lastcomby.'-$2.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=([a-z0-9]+)(\&|\&amp;)cat=([\-0-9]+)(\&|\&amp;)page=([0-9]+)/i',$str_thumbnails.'-$1-$3-'.$str_page.'-$5.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=([a-z0-9]+)(\&|\&amp;)cat=([\-0-9]+)/i',$str_thumbnails.'-$1-$3.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=([a-z0-9]+)(\&|\&amp;)page=([0-9]+)/i',$str_thumbnails.'-$1-'.$str_page.'-$3.html',$html);
    
$html preg_replace('/thumbnails\.php\?search=([^"]+)(\&|\&amp;)album=search/i',$str_thumbnails.'-'.$str_search.'-$1.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=search(\&|\&amp;)search=([^"]+)/i',$str_thumbnails.'-'.$str_search.'-$2.html',$html);
    
$html preg_replace('/thumbnails\.php\?album=([a-z0-9]+)/i',$str_thumbnails.'-$1.html',$html);

    
// Rewrite displayimage.php
    
$html preg_replace('/displayimage\.php\?album=lastcom(\&|\&amp;)cat=([\-0-9]+)(\&|\&amp;)pid=([\-0-9]+)(\&|\&amp;)msg_id=([\-0-9]+)(\&|\&amp;)page=([\-0-9]+)/i',$str_displayimage.'-lastcom-$2-$4-$6-'.$str_page.'-$8.html',$html);
    
$html preg_replace('/displayimage\.php\?album=lastcomby(\&|\&amp;)cat=([\-0-9]+)(\&|\&amp;)pid=([\-0-9]+)(\&|\&amp;)uid=([\-0-9]+)(\&|\&amp;)msg_id=([\-0-9]+)(\&|\&amp;)page=([\-0-9]+)/i',$str_displayimage.'-'.$str_lastcomby.'-$2-$4-$6-$8-$10.html',$html);
    
$html preg_replace('/displayimage\.php\?album=lastupby(\&|\&amp;)cat=([\-0-9]+)(\&|\&amp;)pid=([\-0-9]+)(\&|\&amp;)uid=([\-0-9]+)/i',$str_displayimage.'-'.$str_lastupby.'-$2-$4-$6.html',$html);
    
$html preg_replace('/displayimage\.php\?album=([a-z0-9]+)(\&|\&amp;)cat=([\-0-9]+)(\&|\&amp;)pid=([\-0-9]+)/i',$str_displayimage.'-$1-$3-$5.html',$html);
    
$html preg_replace('/displayimage\.php\?album=search(\&|\&amp;)pid=([\-0-9]+)/i',$str_displayimage.'-'.$str_search.'-$2.html',$html);
    
$html preg_replace('/displayimage\.php\?album=([a-z0-9]+)(\&|\&amp;)pid=([\-0-9]+)/i',$str_displayimage.'-$1-$3.html',$html);
    
$html preg_replace('/displayimage\.php\?pid=([0-9]+)/i',$str_displayimage.'-$1.html',$html);
    
    
// Rewrite profile.php
    
$html preg_replace('/profile\.php\?uid=([0-9]+)/i',$str_profile.'-$1.html',$html);
    
$html preg_replace('/profile\.php\?op=([a-z0-9_]+)/i',$str_profile.'-op-$1.html',$html);
    
    
// language specific replacements
    
if ($sef_language != 'french')
    { 
        
$html preg_replace('/-toprated/i','-'.$str_toprated,$html);
        
$html preg_replace('/-topn/i','-'.$str_topn,$html);
        
$html preg_replace('/-lastcom/i','-'.$str_lastcom,$html);
        
$html preg_replace('/-lastup/i','-'.$str_lastup,$html);
        
$html preg_replace('/top_display_media/i',$str_tdm,$html);
        
$html preg_replace('/'.$str_displayimage.'-search-/i',$str_displayimage.'-'.$str_search.'-',$html);
    }
    
    
// contact and search.php
    
$html preg_replace('/contact.php/i',$str_contact.'.html',$html);
    
$html preg_replace('/search.php/i',$str_search.'.html',$html);
    
    
// albums in cat=0
    
$html preg_replace('/'.$str_thumbnails.'-([a-z0-9]+)-0\.html/i',$str_thumbnails.'-$1.html',$html);
    
    
// Return modified HTML
    
return $html;
}


/**
 * Configure plugin for install
 */
function sef_urls_configure($action) {
    global 
$thisplugin;

    if (
$action===1) {
        
$code implode('',file($thisplugin->fullpath.'/ht.txt'));
        echo <<< EOT
    <form name="cpgform" id="cpgform" action="{$_SERVER['REQUEST_URI']}" method="post">
        <p>
            You already have a .htaccess file in your root Coppermine folder.<br />
            Is it ok to overwrite it?
        </p>
        <div style="margin:25;">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td><input type="radio" name="create" value="1" /></td>
                <td>Yes</td>
            </tr>
            <tr>
                <td><input type="radio" name="create" checked="checked" value="0" /></td>
                <td>No</td>
            </tr>
        </table>
        </div>
        <span>
           <input type="submit" name="submit" value="Submit" /> &nbsp;&nbsp;&nbsp;
            <input type="button" name="cancel" onClick="window.location='pluginmgr.php';" value="Cancel" />
        </span>

        <p>&nbsp;</p>

        <p style="color:red;font-weight:bold;">STOP! READ THE FOLLOWING!</p>

        <p>
            If you don't want your .htaccess file to be overwritten, you'll have to insert the following code:
        </p>

        <div align="right">
            <a class="link" href="
{$thisplugin->fullpath}/ht.txt" target="_blank">Open in a seperate window</a>
        </div>
        <pre style="border:1;border-color:black;background-color:white;font-family:fixedsys;">
            
$code
        </pre>
    </form>
EOT;
    }
}


/**
 * Display cleanup options for uninstall
 */
function sef_urls_cleanup($action) {
    if (
$action===1) {
        echo <<< EOT
    <form name="cpgform" id="cpgform" action="{$_SERVER['REQUEST_URI']}" method="post">
        <p>
            Delete the .htaccess file in your Coppermine root? (If this file was created by this plugin,
            It's ok to delete it.)
        </p>
        <div style="margin:25;">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td><input type="radio" name="delete" value="1" /></td>
                <td>Yes</td>
            </tr>
            <tr>
                <td><input type="radio" name="delete" checked="checked" value="0" /></td>
                <td>No</td>
            </tr>
        </table>
        </div>
        <span>
           <input type="submit" name="submit" value="Submit" /> &nbsp;&nbsp;&nbsp;
            <input type="button" name="cancel" onClick="window.location='pluginmgr.php';" value="Cancel" />
        </span>
    </form>
EOT;
    }
}


/**
 * Install the plugin'
 */
function sef_urls_install() {
    global 
$thisplugin;
    
$sef_language 'french';
    
$sef_superCage Inspekt::makeSuperCage();
    if (
$sef_superCage->post->keyExists('create')) 
    {
      
$create $sef_superCage->post->getInt('create');
    }
      

    
// There's no .htaccess file or user has clicked 'yes' on the create form
    
if (!file_exists('.htaccess') || $create) {
        
copy($thisplugin->fullpath.'/ht-'.$sef_language.'.txt','.htaccess');
        return 
true;

    
// An htaccess file exists; display the configure form
    
} elseif (!isset($create)) {
        return 
1;

    
// User has clicked 'no' on the configure form. Install plugin. Don't create .htaccess file
    
} else {
        return 
true;
    }
}


/**
 * Uninstall the plugin
 */
function sef_urls_uninstall() {
    global 
$thisplugin;

    
$sef_superCage Inspekt::makeSuperCage();
    if (
$sef_superCage->post->keyExists('delete')) 
    {
      
$delete $sef_superCage->post->getInt('delete');
    }

    
// There's an .htaccess file and user has clicked 'yes' on the cleanup form; delete the .htaccess file
    
if (file_exists('.htaccess') && $delete) {
        
unlink('.htaccess');
        return 
true;

    
// An .htaccess file exists; display the cleanup form
    
} elseif (file_exists('.htaccess') && !isset($delete)) {
        return 
1;

    
// User has clicked 'no' on the cleanup form. Uninstall plugin. Don't delete '.htaccess' file
    
} else {
        return 
true;
    }
}
?>
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on April 16, 2014, 12:47:55 pm
Sorry for the misunderstanding, I wasn't referring to your problem. It was just a general advice.
By the way, the lines are:
198-199
Code: [Select]
            if ($sef_language == 'german') //modifiche mie per translitterazioni
            {

207
Code: [Select]
}
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 16, 2014, 01:16:27 pm
please upload your codebase.php
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on April 16, 2014, 01:42:29 pm
It comes from the last svn linked in the first post of the thread.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 16, 2014, 01:50:54 pm

yes I download version 1.8 but apparently it is not the same as yours because I can not have the name of the image. html at the end of my url

visit my website to : http://www.ldft.fr

for example in this picture I have this url

http://www.ldft.fr/displayimage-22.html

but I would like the title of the picture at the end of the url locations displayImage-22.html
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 16, 2014, 01:58:17 pm

when I copy the codebase.php which can be found here
http://sourceforge.net/p/coppermine/code/HEAD/tree/branches/cpg1.5.x/plugins/sef_urls/codebase.php

and I replace my code I get this error when I click an pictures

http://sourceforge.net/p/coppermine/code/HEAD/tree/branches/cpg1.5.x/plugins/sef_urls/codebase.php
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 16, 2014, 02:58:39 pm
all things considered I managed to put all its up I copy a file that this is the url
http://sourceforge.net/p/coppermine/code/HEAD/tree/branches/cpg1.5.x/plugins/sef_urls/

and updated my plugin by changing two lines in code.php

sef_language $ = 'English';

with my tongue

$ sef_language = 'french';

and all works great thank you for the help anyway
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 17, 2014, 01:01:48 pm
I still have a problem when I want to upload an image in an album at the end of the download I have this message:

albums/userpics/10001/thumb_shot_001.jpg

But when I return to the home page after you got this message the image was upload.

How to fix the problem?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: fekasatete on April 17, 2014, 01:17:45 pm
sorry this message :

Download the failed
albums/userpics/10001/thumb_shot_001.jpg
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: SimonG on February 11, 2015, 12:06:36 pm
Sorry for pushing an topic that is over 120 days inactive, I just want to underline the importance of this plugin.

There are two kinds of coppermine users. Those who run private gallerys and those who have public gallerys.
For the last group, it is very important to have meaningful URLs for their gallery. Not only because of Google Rankings, also because people share links on social networks and its kinda creepy to open "blind" links like gallery.com/displayimage822-7281.html instead of gallery.com/animals/cute_dogs/happypuppy-8892.html

So it would be very useful to keep the development on this plugin active. I wish I could support the developer in some way. My coding skills are sadly crap. Would be a donation helpful?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: flapane on February 11, 2015, 12:47:54 pm
Please check whether Googlebot and Bingbot are not crawling broken random URLs as it happend to me.
Something like:
Code: [Select]
66.249.66.62 - - [06/Oct/2013:22:05:04 +0200] "GET /gallery/displayimage-1-8.htmlalbums/userpics/10001/albums/viaggio-newyork/mostra-cerca-0-12-_Via_Caracciolo_dinverno_.html HTTP/1.1" 200 5435 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
It's taking months for recovering from this issue (over 100.000 broken links), with search engine spiders finally starting to remove those broken links from their databases.
Almost all of my images had been removed from Google. It's a pity, because the plugin, in theory, is great, but I had to remove it.
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: sajeevs on November 15, 2015, 08:15:58 pm
why you people not updating this plugin..seo plugin..r u going to stop the updation of the gallery
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: Αndré on November 17, 2015, 11:03:55 am
Obviously there's currently nobody who feels "responsible" for the plugin, so there are also no updates. As far as I know the plugin works as expected (at least it worked for me when I tested it some years ago), so what exactly needs to be updated in your opinion?
Title: Re: SEF_URLs plugin for cpg1.5.x
Post by: sajeevs on November 17, 2015, 12:03:35 pm
Hello sir ok leave it.I asked another few question in another board can u give me a solution

here is the link to that board - http://forum.coppermine-gallery.net/index.php/topic,78473.msg380116.html#msg380116