SEF_URLs plugin for cpg1.4.x - Page 2 SEF_URLs plugin for cpg1.4.x - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

SEF_URLs plugin for cpg1.4.x

Started by Joachim Müller, September 08, 2007, 01:04:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Makc666

#20
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:
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:

  • Last uploaded file. Click to see all uploads by RedFalcon
  • Last comment. Click to see all comments made by RedFalcon
now also have a correct links

3. When you click on any of this two links:

  • Last uploaded file. Click to see all uploads by RedFalcon
  • Last comment. Click to see all comments made by RedFalcon
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:

  • Backup your Galleries .htaccess file
  • Delete Old Version via Config
  • Re-apload plugin's files with new one
  • Update manually .htaccess if you have your own lines there, or you can update it automatically via plugin's install if you don't have such lines
  • Install New Vesion via Config with overwriting .htaccess if you don't have your own lines there

UPDATED: Search for the latest version in this thread.

Makc666

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]
---------------------------------

Joachim Müller

Please do always count up the version instead of just replacing the archive. There is a reason why we use version numbers.

Makc666

Quote from: 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.
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 :)

marecki

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?

Nibbler

Neither. I expect you are using the linked files (album keywords) feature. Not related to this plugin.

marecki

You're right. I've changed keywords and now it seems to be ok.

cl9m

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  :-[

Makc666

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

cl9m


Makc666

#30
Quote from: 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
Search Engine Friendly URLs

QuoteHistory

v1.4 (2008.10.13) (Makc666)

- Lines added to: codebase.php
---------------------------------
// 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
---------------------------------
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 ***
---------------------------------
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 ***
---------------------------------
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:

  • Backup your Galleries .htaccess file
  • Delete Old Version via Config
  • Re-apload plugin's files with new one
  • Update manually .htaccess if you have your own lines there, or you can update in automatically via plugin's install if you don't have such lines
  • Install New Vesion via Config with overwriting .htaccess if you don't have your own lines there

UPDATED: Search for the latest version in this thread.

cl9m


cl9m

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?


Makc666

Quote from: 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
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.

Makc666

#34
Quote from: 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?
Download v1.41

QuoteHistory

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
---------------------------------
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:

  • Backup your Galleries .htaccess file
  • Delete Old Version via Config
  • Re-apload plugin's files with new one
  • Update manually .htaccess if you have your own lines there, or you can update in automatically via plugin's install if you don't have such lines
  • Install New Vesion via Config with overwriting .htaccess if you don't have your own lines there

UPDATED: Search for the latest version in this thread.

cl9m

QuoteThe 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

cl9m

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
$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
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?  ???

Joachim Müller

Why don't you post a real URL instead of a dummy placeholder?

cl9m

For the moment my project is configurate in locallost

Makc666

#39
Quote from: 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
Download v1.42

QuoteHistory

v1.42 (2008.10.17) (Makc666)

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

- Changed in file codebase.php lines:
*** FROM ***
---------------------------------
// 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 ***
---------------------------------
// 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.