forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Joachim Müller on September 08, 2007, 01:04:34 pm

Title: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on September 08, 2007, 01:04:34 pm
In all versions of cpg1.4.x before cpg1.4.13, 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.4.13 (and future versions) 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.


[Edit GauGau 2010-03-05]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_sef-urls_v1.45.zip/download
[/Edit]
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: jaiak on October 02, 2007, 08:30:33 pm
Where Can I download this plugin?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: just_some_guy on October 02, 2007, 10:19:54 pm
in spanish: ^^^ Allí ^^^ en la primero mensaje.

in english: ^^^ There  ^^^ in the first post.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: jaiak on October 02, 2007, 11:17:15 pm
Thanks just_some_guy!

I try this plugin with a new instalaccion of cpg1.4.13 and work ok.

This is my experience... my cpg is hosted in bluehost.com

Regards from spain!
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: just_some_guy on October 02, 2007, 11:18:26 pm
de nada,
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: byrev on October 16, 2007, 03:33:37 am
Is not the best solution!!!

This link:
http://moka.t2i.info/displayimage-185-6.html

must become like this:

http://moka.t2i.info/Butterflys/Multi-Colored-Butterfly-on-Flowers-002/Multi-colored-Butterfly_display-16-0.html (#post_)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on October 16, 2007, 08:06:06 am
You're welcome to re-write the plugin accordingly. ::)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: byrev on October 16, 2007, 07:21:19 pm
yes but how can i retrive current album name for photo ?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on December 01, 2007, 11:10:14 am
I didn't know why this one fix -> http://forum.coppermine-gallery.net/index.php?topic=37271
was not included in archive in first post (version 1.1)
as GauGau said before:
Added suggested changes to devel branch. Can a dev team member confirm, so this can be applied to the stable branch as well?
and
Confirmed.

All sort codes are 2 digits, so the preg_match could be more specific, ie [a-z]{2} instead of [a-z]+

So I attached version 1.2 with these changes.

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cryptq1 on December 29, 2007, 02:53:43 pm
Hi

Installed and works after an initial problem. Just in case anyone else has the problem, here's what happened and the solution.

I have CPG installed as a sub-directory within a Joomla install and use a bridge to link the two. After installation I had a 404 error. My error log showed the following :
Quote
Options ExecCGI is off in this directory: /home/xxx/public_html/copper/index.php

The problem was solved by adding the following to the .htaccess in the CPG directory:
Quote
Options +ExecCGI
just after:
Quote
Options FollowSymLinks SymLinksIfOwnerMatch
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Phill Luckhurst on December 29, 2007, 07:46:23 pm
I tried this on Lycos and it caused a 500 server error locking me out of my test gallery. After deleting the .htaccess via ftp I was able to get back into pluginmgr and remove this plugin.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: kidler on January 04, 2008, 04:01:48 pm
I greet.  After installation this plugin  near the test of the entry on the side: I ask for the help...

Code: [Select]
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, test@test.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Nibbler on January 04, 2008, 04:10:16 pm
Did you even read this thread? Delete the .htaccess file and uninstall the plugin.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: kidler on January 04, 2008, 05:58:32 pm
I greet. I did just so and nothing helped ....
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: TigerClaw on January 27, 2008, 05:22:59 pm
I have installed the plugin it works correctly :)
I have two questions strictly related to the plugin:

1) The rewrite rule works correctly but when someone asks for the old URLs apache do not redirect the page to the new URLs. I tried to add R=301 to the option and modify the htaccess but without luck. Someone knows how to do it?

2)

yes but how can i retrive current album name for photo ?

Can we have an hint on how we can do it?  ???

Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on January 28, 2008, 03:52:11 pm
I have installed the plugin it works correctly :)
I have two questions strictly related to the plugin:

1) The rewrite rule works correctly but when someone asks for the old URLs apache do not redirect the page to the new URLs. I tried to add R=301 to the option and modify the htaccess but without luck. Someone knows how to do it?
Maybe you forgot to install the plugin's part for .htaccess file?

For me old urls work without any problem.

2) Can we have an hint on how we can do it?  ???
This one needs a total rewrite of plugin.
There is no easy implementation for the current version.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Eirene on March 14, 2008, 07:02:19 am
Thank you for this mod. I have instaled it on my gallery. It's working fine, but there is one problem.
The link for slide show must to look like "slideshow-[album]-[pid]-[interval].html", but the link is looking like "displayimage-[album]-[category]-[position].html?album=[album]&pid=[pid]&slideshow=[interval]".
And in file informathion fild the file link must be "displayimage-[pid].html", but in real it's "displayimage-[album]-[category]-[position].html?pos=-[pid]". Why this problem happen?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on March 15, 2008, 01:20:03 pm
Thank you for this mod. I have instaled it on my gallery. It's working fine, but there is one problem.
The link for slide show must to look like "slideshow-[album]-[pid]-[interval].html", but the link is looking like "displayimage-[album]-[category]-[position].html?album=[album]&pid=[pid]&slideshow=[interval]".
And in file informathion fild the file link must be "displayimage-[pid].html", but in real it's "displayimage-[album]-[category]-[position].html?pos=-[pid]". Why this problem happen?
Way be you use some custom skin?
Can you post the link to your gallery.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Eirene on March 17, 2008, 02:56:19 pm
I use my own skin, but I just changed template.html
This problem i resolved. I added some additional rules to "codebase.php":

Code: [Select]
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)pos=([\-0-9]+)/i','displayimage-$3-$5.php',$php);

$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)-([\-0-9]+)\.php\?pos=-([0-9]+)/i','displayimage-$4.php',$php);
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?pos=-([0-9]+)/i','displayimage-$3.php',$php);

$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)cat=([\-0-9]+)(\&|\&)pid=([0-9]+)(\&|\&)slideshow=([0-9]+)/i','slideshow-$4-$6-$8-$10.php',$php);
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)pid=([0-9]+)(\&|\&)slideshow=([0-9]+)/i','slideshow-$3-$5-$7.php',$php);

There is i also changed .html to .php, i'm feeling it's better for my site.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on March 18, 2008, 08:01:15 pm
I use my own skin, but I just changed template.html
This problem i resolved. I added some additional rules to "codebase.php":

Code: [Select]
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)pos=([\-0-9]+)/i','displayimage-$3-$5.php',$php);

$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)-([\-0-9]+)\.php\?pos=-([0-9]+)/i','displayimage-$4.php',$php);
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?pos=-([0-9]+)/i','displayimage-$3.php',$php);

$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)cat=([\-0-9]+)(\&|\&)pid=([0-9]+)(\&|\&)slideshow=([0-9]+)/i','slideshow-$4-$6-$8-$10.php',$php);
$php = preg_replace('/displayimage-([a-z0-9]+)-([\-0-9]+)\.php\?album=([a-z0-9]+)(\&|\&)pid=([0-9]+)(\&|\&)slideshow=([0-9]+)/i','slideshow-$3-$5-$7.php',$php);

There is i also changed .html to .php, i'm feeling it's better for my site.

Eirene, thanks for your reply and code! :)
Title: Search Engine Friendly URLs v1.3
Post by: Makc666 on June 03, 2008, 02:04:23 pm
Search Engine Friendly URLs v1.3

History
v1.3 (2008.06.03) (Makc666)


---------------------------------
Lines added to: codebase.php
---------------------------------
- $html = preg_replace('/thumbnails\.php\?album=lastupby(\&|\&)uid=([0-9]+)/i','thumbnails-lastupby-$2.html',$html);
- $html = preg_replace('/thumbnails\.php\?album=lastcomby(\&|\&)uid=([0-9]+)/i','thumbnails-lastcomby-$2.html',$html);
- $html = preg_replace('/displayimage\.php\?album=lastupby(\&|\&)cat=([\-0-9]+)(\&|\&)pos=([\-0-9]+)(\&|\&)uid=([0-9]+)/i','displayimage-lastupby-$2-$4-$6.html',$html);
- $html = preg_replace('/displayimage\.php\?album=lastcomby(\&|\&)cat=([\-0-9]+)(\&|\&)pos=([\-0-9]+)(\&|\&)uid=([0-9]+)/i','displayimage-lastcomby-$2-$4-$6.html',$html);
- $html = preg_replace('/displayimage\.php\?pid=([\-0-9]+)(\&|\&)fullsize=1/i','displayimage-$1-fullsize.html',$html);
- $html = preg_replace('/profile\.php\?uid=([0-9]+)/i','profile-$1.html',$html);
- $html = preg_replace('/ratepic\.php\?pic=([0-9]+)(\&|\&)rate=([0-5])/i','ratepic-$1-$3.html',$html);
---------------------------------

---------------------------------
Lines added to: ht.txt
---------------------------------
- RewriteRule thumbnails-lastupby-([a-z0-9]*)\.html thumbnails.php?album=lastupby&uid=$1 [NC]
- RewriteRule thumbnails-lastcomby-([a-z0-9]*)\.html thumbnails.php?album=lastcomby&uid=$1 [NC]
- RewriteRule displayimage-lastupby-([\-]?[0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=lastupby&cat=$1&pos=$2&uid=$3 [NC]
- RewriteRule displayimage-lastcomby-([\-]?[0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=lastcomby&cat=$1&pos=$2&uid=$3 [NC]
- RewriteRule displayimage-([\-]?[0-9]+)-fullsize\.html displayimage.php?pid=$1&fullsize=1 [NC]
- RewriteRule profile-([0-9]*)\.html profile.php?uid=$1 [NC]
- RewriteRule ratepic-([0-9]*)-([0-5])\.html ratepic.php?pic=$1&rate=$2 [NC]
---------------------------------

Fixes for:

1. User Name link is now ok on page:
http://coppermine-gallery.net/demo/cpg14x/displayimage.php?pos=-367
In line:
Code: [Select]
Album name: RedFalcon / Architecture
2. When you click on that User Name you get to page:
http://coppermine-gallery.net/demo/cpg14x/profile.php?uid=22286
On that page two links:
now also have a correct links

3. When you click on any of this two links:
you get to page:
http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=lastupby&uid=22286
or
http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=lastcomby&uid=22286

Urls on that pages are now also OK.

4. Fullsize images now also have Friendly URLs
http://coppermine-gallery.net/demo/cpg14x/displayimage.php?pid=325&fullsize=1

How to Update:

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on June 03, 2008, 03:38:16 pm
I just have update the archive again:

4. Fullsize images now also have Friendly URLs
http://coppermine-gallery.net/demo/cpg14x/displayimage.php?pid=325&fullsize=1

---------------------------------
Lines added to: codebase.php
---------------------------------
- $html = preg_replace('/displayimage\.php\?pid=([\-0-9]+)(\&|\&)fullsize=1/i','displayimage-$1-fullsize.html',$html);
---------------------------------

---------------------------------
Lines added to: ht.txt
---------------------------------
- RewriteRule displayimage-([\-]?[0-9]+)-fullsize\.html displayimage.php?pid=$1&fullsize=1 [NC]
---------------------------------
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on June 03, 2008, 05:36:04 pm
Please do always count up the version instead of just replacing the archive. There is a reason why we use version numbers.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on June 03, 2008, 09:02:03 pm
Please do always count up the version instead of just replacing the archive. There is a reason why we use version numbers.
Joachim, it was a quick update as I thought.
« Reply #20 on: Today at 16:04:23 »
« Reply #21 on: Today at 17:38:16 »

At the beginning I think that I have to set it 1.31 but then I decided that 1 hour change didn't worth it :)

But I will of course try to follow your advice in the future :)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: marecki on September 17, 2008, 04:23:01 pm
I think there is a problem with SEF plugin.

Take a look: http://www.kocjan.pl/index-4.html Album "Wystawa Makiet Rybnik 2008" (second row, first from the left) contains 46 files.
When you open this album or follow link http://www.kocjan.pl/thumbnails-64.html you can see... 97 files :(

Is there a problem with gallery, or with plugin?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Nibbler on September 17, 2008, 04:42:44 pm
Neither. I expect you are using the linked files (album keywords) feature. Not related to this plugin.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: marecki on September 17, 2008, 05:30:18 pm
You're right. I've changed keywords and now it seems to be ok.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 08, 2008, 03:58:58 pm
I try to improve sef url plugin

but i don't understand all in the codebase.php

in codebase.php i add
// Rewrite thumbnails.php?album=lastupby&uid=[userid] URLs to thumbnails-lastupby-[userid]-page-[page].html
$html = preg_replace('/thumbnails\.php\?album=lastupby(\&|\&)uid=([0-9]+)page=([0-9]+)/i','thumbnails-lastupby-$2-page-$3.html',$html);

and .ht i add
RewriteRule thumbnails-lastupby-([a-z0-9]*)-page-([0-9]*)\.html thumbnails.php?album=lastupby&cat=$0&uid=$1&page=$2 [NC]

Please can you tell me what's wrong  :-[
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 08, 2008, 05:10:47 pm
I will check this one tomorrow or today at night and will help you.
As I can see there is some other places need to be fixed for v1.3
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 13, 2008, 11:36:32 am
Makc666

the problem is we can't go to page 2 of last update by user
http://www.mywebsite.com/thumbnails-lastupby-0.html&uid=3&page=2
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 13, 2008, 12:43:41 pm
Makc666

the problem is we can't go to page 2 of last update by user
http://www.mywebsite.com/thumbnails-lastupby-0.html&uid=3&page=2
Search Engine Friendly URLs

Quote
History

v1.4 (2008.10.13) (Makc666)

- Lines added to: codebase.php
---------------------------------
Code: [Select]
// Rewrite thumbnails.php?album=lastupby&cat=[category]&uid=[userid]&page=[page] URLs to thumbnails-lastupby-[category]-[userid]-page-[page].html
$html = preg_replace('/thumbnails\.php\?album=lastupby(\&|\&)cat=([0-9]+)(\&|\&)uid=([0-9]+)(\&|\&)page=([0-9]+)/i','thumbnails-lastupby-$2-$4-page-$6.html',$html);

// Rewrite thumbnails.php?album=lastcomby&cat=[category]&uid=[userid]&page=[page] URLs to thumbnails-lastcomby-[category]-[userid]-page-[page].html
$html = preg_replace('/thumbnails\.php\?album=lastcomby(\&|\&)cat=([0-9]+)(\&|\&)uid=([0-9]+)(\&|\&)page=([0-9]+)/i','thumbnails-lastcomby-$2-$4-page-$6.html',$html);
---------------------------------

- Lines added to: ht.txt
---------------------------------
Code: [Select]
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]
---------------------------------

- Lines changed in: ht.txt
*** FROM ***
---------------------------------
Code: [Select]
RewriteRule thumbnails-lastupby-([a-z0-9]*)\.html thumbnails.php?album=lastupby&uid=$1 [NC]
RewriteRule thumbnails-lastcomby-([a-z0-9]*)\.html thumbnails.php?album=lastcomby&uid=$1 [NC]
---------------------------------
*** TO ***
---------------------------------
Code: [Select]
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]
---------------------------------

How to Update:

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 15, 2008, 01:38:24 pm
for user contrib i found this post : http://forum.coppermine-gallery.net/index.php/topic,50834.0.html

that's change http://www.mysitename.com/thumbnails-lastupby-3.html by  http://www.mysitename.com/-username-

that's interesting for the future version of SEF_URLs plugin
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 15, 2008, 06:09:05 pm
under picture there is tag with link for search when it's a date it does'nt work

http://www.mywebsite.com/thumbnails-search-2006.html :-[

can you tell me what wrong?

Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 15, 2008, 10:34:15 pm
for user contrib i found this post : http://forum.coppermine-gallery.net/index.php/topic,50834.0.html

that's change http://www.mysitename.com/thumbnails-lastupby-3.html by  http://www.mysitename.com/-username-

that's interesting for the future version of SEF_URLs plugin
The original author of "Search Engine Friendly URLs" don't use queries to database.
The MOD you pointed to maked queries to database.
Also there can be, for example, Russian usernames with Cyrillic letters.
There will be also some sort of problem here.

So I don't see this on in future implementation list because of the current specific structure.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 15, 2008, 10:41:32 pm
under picture there is tag with link for search when it's a date it does'nt work
http://www.mywebsite.com/thumbnails-search-2006.html :-[
can you tell me what wrong?
Download v1.41

Quote
History

v1.41 (2008.10.16) (Makc666)

- Changed in file ht.txt quantifier '*' to '+' for all instances, because quantifier '+' means > 1
More you can read here http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule
This change just a cosmetic one

- Move in file ht.txt the line of code
---------------------------------
Code: [Select]
RewriteRule thumbnails-search-(.*)\.html thumbnails.php?album=search&search=$1 [NC]---------------------------------
from line #58 to line #42
not to conflict with another rule

=================================
How to Update:

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 16, 2008, 09:09:43 am
Quote
The original author of "Search Engine Friendly URLs" don't use queries to database.
The MOD you pointed to maked queries to database.
Also there can be, for example, Russian usernames with Cyrillic letters.
There will be also some sort of problem here.

So I don't see this on in future implementation list because of the current specific structure.

ok I understand

thanks so much for v1.41
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 16, 2008, 09:43:32 am
I know SEF URLs plugin is in beta version

and i've found another probleme  :-[

http://www.mywebsite.com/thumbnails-search-0-page-2.html

I try to repare it myself when i add in the codebase.php
Code: [Select]
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)cat=([0-9]+)(\&|\&)uid=([0-9]+)(\&|\&)page=([0-9]+)/i','thumbnails-search-$2-$4-page-$6.html',$html);

and in .ht
Code: [Select]
RewriteRule thumbnails-search-([0-9]+)-([0-9]+)-page-([0-9]+)\.html thumbnails.php?album=search&cat=$1&uid=$2&page=$3 [NC]
but that doesn't works can you tell me what's worng?  ???
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on October 16, 2008, 05:09:57 pm
Why don't you post a real URL instead of a dummy placeholder?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 16, 2008, 05:45:34 pm
For the moment my project is configurate in locallost
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 16, 2008, 06:07:14 pm
I know SEF URLs plugin is in beta version

and i've found another probleme  :-[

http://www.mywebsite.com/thumbnails-search-0-page-2.html
Download v1.42

Quote
History

v1.42 (2008.10.17) (Makc666)

- Changed in file ht.txt line:
*** FROM ***
---------------------------------
Code: [Select]
RewriteRule thumbnails-search-(.*)\.html thumbnails.php?album=search&search=$1 [NC]---------------------------------
*** TO ***
---------------------------------
Code: [Select]
RewriteRule search-thumbnails-(.*)\.html thumbnails.php?album=search&search=$1 [NC]---------------------------------

- Changed in file codebase.php lines:
*** FROM ***
---------------------------------
Code: [Select]
// Rewrite thumbnails.php?album=search&search=[searchterm] URLs to thumbnails-search-[searchterm].html
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','thumbnails-search-$2.html',$htm
---------------------------------
*** TO ***
---------------------------------
Code: [Select]
// Rewrite thumbnails.php?album=search&search=[searchterm] URLs to search-thumbnails-[searchterm].html
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','search-thumbnails-$2.html',$htm
---------------------------------

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 25, 2008, 09:44:53 am
Thanks Makc666 that's work fine if we add "l;" to the end of line ...$html;  ;)

Code: [Select]
// Rewrite thumbnails.php?album=search&search=[searchterm] URLs to search-thumbnails-[searchterm].html
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','search-thumbnails-$2.html',$html;

that will be hard to rewrite minicms url? index.php?file=minicms/cms&id=8  ???
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 26, 2008, 11:42:36 pm
Thanks Makc666 that's work fine if we add "l;" to the end of line ...$html;  ;)
Yes. This is my fault.  :-\

Download v1.43

Quote
History

v1.43 (2008.10.27) (Makc666)

- Fixed two misprints in codebase.php lines:
*** FROM ***
---------------------------------
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','thumbnails-search-$2.html',$htm
---------------------------------
*** TO ***
---------------------------------
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','thumbnails-search-$2.html',$html);
---------------------------------
*** FROM ***
---------------------------------
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','search-thumbnails-$2.html',$htm
---------------------------------
*** TO ***
---------------------------------
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','search-thumbnails-$2.html',$html);
---------------------------------

How to Update:

UPDATED: Search for the latest version in this thread.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 26, 2008, 11:53:42 pm
Code: [Select]
// Rewrite thumbnails.php?album=search&search=[searchterm] URLs to search-thumbnails-[searchterm].html
$html = preg_replace('/thumbnails\.php\?album=search(\&|\&)search=([^"]+)/i','search-thumbnails-$2.html',$html;

that will be hard to rewrite minicms url? index.php?file=minicms/cms&id=8  ???

For codebase.php it will be smth like:
Code: [Select]
$html = preg_replace('/index\.php\?minicms/cms=([0-9]+)/i','minicms-index-$1.html',$html);
For ht.txt it will be smth like:
Code: [Select]
RewriteRule minicms-index-([0-9]+)\.html index.php?file=minicms/cms&id=$1 [NC]
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 27, 2008, 06:38:24 pm
i try it but it don't work  ???
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on October 27, 2008, 09:10:36 pm
i try it but it don't work  ???
1st, I corrected the second line. There were two "==" there.
2nd, which one didn't work?
3rd, give me the url to that plugin you are talking about.

I think it didn't work because that plugin is not the part of Coppermine and that is why the code for it will be different.
Also I think that codebase.php can not be able to help with this plugin.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 28, 2008, 09:31:10 am
I corrected the second line. There were two "==" there but that's don't work, i've a white page with nothing, no links!

when i put the new ligne in codebase.php to coment all links work but not index.php?file=minicms/cms&id=2
Code: [Select]
//$html = preg_replace('/index\.php\?minicms/cms=([0-9]+)/i','minicms-index-$1.html',$html);
i've actually my photo gallery in localhost
but you can find this plugin to the plugin pack on source fourge it's called minicms
and you can see this url whose use minicms

http://ceconn.com/photo_gallery/index.php?file=minicms/cms&id=2

thanks for your help
( :-[ sorry for my little english i'm french )
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on October 30, 2008, 09:17:54 am
i've found another problem

with SEF URLs plugin you can change the language (of coppermine) only on the first gallerie's page.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on November 02, 2008, 04:59:38 pm
i've found another problem

with SEF URLs plugin you can change the language (of coppermine) only on the first gallerie's page.

cl9m, I was trying to make this one.
With the current URLs like "http://coppermine-gallery.net/demo/cpg14x/test.hml" where we have ".html" at the end there is no way to change languages on pages not like index.html
Sorry, but there is really nothing we can do about this one.

If we change the URL to snth like "http://coppermine-gallery.net/demo/cpg14x/test/" with out any ".html" at the end then I think we will be able to change language on any page.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: cl9m on November 02, 2008, 05:26:00 pm
i've try this but I can see just the text, my page search all pictures design and photos to

http://www.nomdusite.com/thumbnails-lastup/images/imagename.jpg
or
http://www.nomdusite.com/thumbnails-lastup/albums/userpics/10001/photoname.jpg
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on November 02, 2008, 10:34:58 pm
Post real links instead of dummy placeholders.
Title: SEF_URLs plugin for cpg1.4.x - Version 1.44
Post by: Makc666 on November 19, 2008, 12:50:52 pm
SEF_URLs plugin for cpg1.4.x
LATEST VERSION IS IN THIS POST


Quote
History

v1.44 (2008.11.19) (Makc666)

- Fixed a misprint in History description for v1.43

- Fixed a misprint in ht.txt lines:
*** FROM ***
---------------------------------
RewriteRule thumbnails-search-(.*)\.html thumbnails.php?album=search&search=$1 [NC]
---------------------------------
*** TO ***
---------------------------------
RewriteRule search-thumbnails-(.*)\.html thumbnails.php?album=search&search=$1 [NC]
---------------------------------

How to Update:
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mreider on December 16, 2008, 08:00:24 pm
Heya,

Thanks for all your work on this!

I've managed to install it with partial success - It will rewrite the links accordingly, however when I click on any of them, it generates a 404 error. The URL's and links all look correct though.

I'm using cpg 1.4.5, and your latest download.

Any ideas what could be causing the 404's? I'm thinking it's something to do with the codebase.php, since it appears the mod_rewrite rules are all working correctly.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Phill Luckhurst on December 16, 2008, 09:05:03 pm


I'm using cpg 1.4.5, and your latest download.


You mean you have upgraded to 1.4.19 I hope and are not using 1.4.5?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mreider on December 16, 2008, 09:07:03 pm
Lol - yes, I always get the version numbers mixed up. I've upgraded to that latest one - 1.4.19 :)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Makc666 on December 18, 2008, 04:38:31 pm
I've managed to install it with partial success - It will rewrite the links accordingly, however when I click on any of them, it generates a 404 error. The URL's and links all look correct though.
You didn't install .htaccess file or there is no mod_rewrite (http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html) support on your server.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mreider on December 19, 2008, 02:13:00 am
Thanks for replying - the mod_rewrite is enabled, and I use it on various other sections on my site.

I'm going to play around with the paths, maybe that's the issue.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mreider on December 19, 2008, 02:30:09 am
Success! I had to change:

Options FollowSymLinks SymLinksIfOwnerMatch

to:
Options +FollowSymlinks -Indexes
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mohamedimran on March 18, 2009, 10:12:58 am
Dear Friends,

Help me to solve this problem...

Recently, I changed my coppermine gallery from One Hosting to Another Hosting.....
In the old hosting, i installed the SEF_URLs Plugin and it worked well. Now in New Hosting, if i tried to install the SEF_URLs Plugin means, i'm getting the "Internal Server Error", so i deleted the plugin.... But the problem is, upto the day i used to change the hosting, i submitted the site URLs (SEF_URLs) in many sites, now if i refer that old links i got error page.

Old URL : http://funnyimgs.co.cc/displayimage-134.html

New URL : http://funnyimgs.co.cc/displayimage.php?pos=-134

Please help me.... site losing it's traffic
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Nibbler on March 18, 2009, 12:17:49 pm
Ask your host about mod_rewrite support.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mohamedimran on March 18, 2009, 05:31:06 pm
I contacted the host about mod_rewrite support and got replied that,

Quote
You may use mod_rewrite with no problems via an .htaccess file in your account with us. Unfortunately we do not offer third party scripts support and we will not be able to assist you properly in this situation.

Please let me know, how is this useful to give solution for my problem.....
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: mohamedimran on March 19, 2009, 06:53:42 pm
Hi Nibbler,

i have recently edited the sef pluging and got installed, now it is showing the SEF urls but the problem is, if i clicked through that link, it displays 404 error page

My site : http://funnyimgs.freehostia.com/ 

Sample SEF url : http://funnyimgs.freehostia.com/thumbnails-16.html      - returns 404 page

consider my previous post for the "mod_rewrite support"....

I'm pleasure to provide more information if u want......
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Nibbler on March 19, 2009, 07:32:58 pm
If you get the 404 that means mod_rewrite is not working.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: rajen on May 19, 2009, 12:36:43 pm
thanks for the plugin guys, it works fine except for one url :(

i would really appreciate if someone can help :)

http://www.lageraho.com/cartoons/index.php

but when i click on "albums list" on the left menu it shows a 404, all other pages work fine

http://www.lageraho.com/cartoons/index-0.html <---this is the link to the albums list

my htaccess file looks like this:

Code: [Select]
Options FollowSymLinks SymLinksIfOwnerMatch

RewriteEngine on

#  Uncomment the following line if your webserver's
#  URL is not directly related to physical file paths.
#  Update "/cartoons" (just / for root)
#RewriteBase /YOUR_COPPERMINE_ROOT
#
# Rewrite index urls
#
RewriteRule index-([0-9]+)cartoons\.html cartoons\index.php?cat=$1 [NC]
RewriteRule index-([0-9]+)-page-([0-9]+)cartoons\.html cartoons\index.php?cat=$1&page=$2 [NC]
#
# Rewrite thumbnail urls
#
RewriteRule search-thumbnails-(.*)\.html thumbnails.php?album=search&search=$1 [NC]
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]+)-sort-([a-z]+)\.html thumbnails.php?album=$1&page=$2&sort=$3 [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-([a-z0-9]+)\.html thumbnails.php?album=$1 [NC]
#
# Rewrite displayimage urls
#
RewriteRule displayimage-lastupby-([\-]?[0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=lastupby&cat=$1&pos=$2&uid=$3 [NC]
RewriteRule displayimage-lastcomby-([\-]?[0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=lastcomby&cat=$1&pos=$2&uid=$3 [NC]
RewriteRule displayimage-([\-]?[0-9]+)-fullsize\.html displayimage.php?pid=$1&fullsize=1 [NC]
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&cat=$2&pos=$3 [NC]
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&pos=$2 [NC]
RewriteRule displayimage-([0-9]+)\.html displayimage.php?pos=-$1 [NC]
RewriteRule slideshow-([0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=$1&pid=$2&slideshow=$3 [NC]
RewriteRule slideshow-([a-z]+)-([\-]?[0-9]+)-([0-9]+)-([0-9]+)\.html displayimage.php?album=$1&cat=$2&pid=$3&slideshow=$4 [NC]
#
# Rewrite users' profiles
#
RewriteRule profile-([0-9]+)\.html profile.php?uid=$1 [NC]
#
# Rewrite Rate this file
#
RewriteRule ratepic-([0-9]+)-([0-5])\.html ratepic.php?pic=$1&rate=$2 [NC]

Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: rajen on May 31, 2009, 01:48:23 am
sorry i dont mean to be pushy but some help would be highly appreciated guys :)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Nibbler on May 31, 2009, 02:04:11 pm
It doesn't work because you've added 'cartoons' into the rewrite rules for no apparent reason.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: rajen on June 14, 2009, 01:00:18 am
thanks mate, removing cartoons from the rewrite rules solved the problem :)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: blickwinkel on January 05, 2010, 10:23:45 pm
Hello!

I am a newbie to coppermine and have installed this plugin. I use coppermine 1.4.25. During the installation a 500 Internal Server Error showed up. Now my gallery was not accessable. Everytime I get this error.Like described i wanted to delete the .htaccess File, but i don't find it in the root-directory. Neither i find the SEF Plugin in the plugins-directory.

Please: anyone tell me what to do.

Thanks
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: blickwinkel on January 05, 2010, 10:35:34 pm
Hello!

I am a newbie to coppermine and have installed this plugin. I use coppermine 1.4.25. During the installation a 500 Internal Server Error showed up. Now my gallery was not accessable. Everytime I get this error.Like described i wanted to delete the .htaccess File, but i don't find it in the root-directory. Neither i find the SEF Plugin in the plugins-directory.

Please: anyone tell me what to do.

Thanks

Ok, found the problem. Filezilla (my ftp client) didn't show the .htcaccess file. I downloaded another client and it worked.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on January 07, 2010, 07:37:21 am
It's a feature in FileZilla to display or hide Lunix system files (i.e. .htaccess) - they call them "dotfiles", i.e. files that start with a dot and you probably have a filter in place. Thanks for resolving your issue, but this plugin as well as any other plugin can be used just fine using FileZilla - in fact, FileZilla is the FTP app the coppermine dev team recommends to use. You should have read the docs that come with FileZilla (help file) that explain how to use the toggle. Subsequently, your recommendation to use another FTP app doesn't apply: use FileZilla and use the corrsponding toggle in the filter dialog there. There are a lot of answers if you google for the right search term, e.g. "filezilla display .htaccess (http://www.google.com/search?q=filezilla+display+.htaccess)".

Joachim

P.S. For the sake of completeness: it's possible that you can not display .htaccess files no matter what on the server side if your webhost doesn't want you to display them, i.e. if the server is configured to hide them no matter what. As suggested, files with a leading dot are system files on Unix/Linux systems that are hidden deliberately. This of course will not change no matter what FTP client you use. In other words: on some server setups, you won't be able to display .htaccess files no matter what client you use. This was obviously not the case for blickwinkel though.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: ronnie66 on February 26, 2010, 10:16:01 pm
Thanks for the plugin guys, it works fine.

But is there already a solution for tjis problem -- >>with SEF URLs plugin you can change the language (of coppermine) only on the first gallerie's page.?

www.wallpapersfree.nl
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joe Carver on February 27, 2010, 02:12:01 pm
If you had searched and read through this thread you would find the author of the plugin wrote:

there is no way to change languages on pages not like index.html
Sorry, but there is really nothing we can do about this one.

You can just add a reminder/pointer/link to your theme asking your visitors to change language on your home page or any page that does not get the rewrite. (...yyyxzzz.php)
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: thapame on March 16, 2010, 10:57:14 pm
Hi,

I'm getting strange problem with this plugin.
I added .htaccess file on the root dir and placed the plugin.
When I tried to install the plugin I got a blank page for the whole site.

But when I try without installing the plugin the sef url is working.

Currently I have not installed the plugin from plugin manager but the url is working (http://www.pictures.com.np/displayimage-1111.html) but at the same time if I install it I'll get a blank page.

Can anyone help me?

Thanks
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: drakefan on June 21, 2010, 09:53:59 am
Hi,

I'm new here. This plugin is working fine for me, the only thing I would like to change is the actual replacement text that is used when the links are made for example my links right now look like this.

http://www.drakepictures.net/thumbnails-123.html

I want them to look more like this

http://www.drakepictures.net/drake-picturethumbs-123.html

Nothing crazy, but I tried to do some work in the htaccess and messed it up so I revert the htaccess to default can some one help this ?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Joachim Müller on June 21, 2010, 02:24:41 pm
Review the discussion on exactly the same issue for the SEF_URLs plugin for cpg1.5.x, but don't ask for a backport. Development for cpg1.4.x has ended, support will run out soon. Consider upgrading to cpg1.5.x
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: drakefan on June 21, 2010, 09:53:12 pm
the only reason I haven't upgraded yet, is because I'm not sure if there's a new stramm version to support that upgrade?
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Phill Luckhurst on June 21, 2010, 10:28:11 pm
Please read the feature list of 1.5.6 and see if all the features you need are there before worrying about the modpack.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: dahoc on August 02, 2010, 01:48:59 am
Will this plugin work on cpg1.5.x?  or has this feature been added directly to the cpg1.5.x branch?

Thanks!
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: treret on June 21, 2012, 12:30:19 pm
This plugin doesn't work with PHP 5.3 and higher.
I installed the cpg1.5.x plugin and works perfectly even on cpg1.4.10. More.. it makes friendly urls even for users profiles, that the 1.4.x ver didn't make.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: treret on June 21, 2012, 12:36:16 pm
 :-\ It's not right:

 it doesn't revrite image urls.

Sorry.
Title: Re: SEF_URLs plugin for cpg1.4.x
Post by: Phill Luckhurst on June 25, 2012, 01:28:53 pm
This is the thread for the cpg1.4.x version which is no longer supported. As such I wil lock this thread. If you are still using CPG1.4.x then please upgrade to CPG1.5.x and use the version built for that.