Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3   Go Down

Author Topic: mod_rewrite crash course: what and how  (Read 63168 times)

0 Members and 1 Guest are viewing this topic.

emrcia

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: mod_rewrite crash course: what and how
« Reply #20 on: September 13, 2004, 01:37:11 am »

This is something important in order to let google spyder the gallery. This is needed in order to let adsense work in our galleries. Are you so kind to explain this modification a little bit more detailed?
It seem to work in my server, but I don't know wich variables an a href to change. I need a little more help in this.
Thank you.
 
Logged

Lombi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 25
  • Never lick a gift horse in the mouth.
    • Surreal Art Prints
Re: mod_rewrite crash course: what and how
« Reply #21 on: September 15, 2004, 06:21:35 am »

Perhaps someone should find this handy as well:
http://www.lombergar.com/v4/posts-q227-last.htm

I made a quick blog while upgrading the system to do mod_rewrites and it should reflect the changes his contribution had untill 1.3.2.
Logged
While you are looking at some surreal art prints or just some surrealistic art you might get yourself some windows xp boot screens.

emrcia

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: mod_rewrite crash course: what and how
« Reply #22 on: September 18, 2004, 01:48:28 am »

Thank you!!
Every thing seem to be ok, but there is a problem with the last images thumbnails. When I click on them I obtain a 404 error and they all have the same url:
http://www.mysite.com/galery/album/lastup&cat=0/img/0
Logged

emrcia

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: mod_rewrite crash course: what and how
« Reply #23 on: September 29, 2004, 11:31:34 am »

and so on with last comments and others...
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: mod_rewrite crash course: what and how
« Reply #24 on: September 29, 2004, 11:35:16 am »

emrcia,

It would have been more useful if you gave us a URL to an actual site.
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: mod_rewrite crash course: what and how
« Reply #25 on: September 30, 2004, 12:07:00 am »

This is a real sweet mod, I spend a bout an hour or two getting al the links working but it was worth it. :)
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: mod_rewrite crash course: what and how
« Reply #26 on: September 30, 2004, 06:52:41 pm »

@emrcia : The problem you are describing is caused by an issue in your theme.php file in the theme_display_thumbnails function. As far as I can tell this has not been modifed correctly. I hade the same issue but that has been solved in my theme.

The line that starts with:
Code: [Select]
$cat_link = is_numeric($aid) ? '' is the one thats causing the trouble...

Also make sure you look at the stuff under:     
Code: [Select]
foreach($thumb_list as $thumb) { in the same function that also needs changing it is not listed in the mod but it needs to be altered as well.  ;)
Logged

julian

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: mod_rewrite crash course: what and how
« Reply #27 on: November 16, 2004, 11:37:15 pm »

hi

i ahve used the hack in the appropriate way and that's fine except for the languages.So..when i call the URL http://mysite.com/lang/italian
(non default)   it displays me an 404 erorr but when i try in the same way but now with the default language it's ok.How it's possible? Maybe i haven't uderstand the way to call the URL's expecially the /lang URL's.
can i have an answer ??
thanx in advance
Logged

farhan

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: mod_rewrite crash course: what and how
« Reply #28 on: December 30, 2004, 05:07:31 pm »

can someone please explain the step 5 in a little detail ?

especially this part

Quote
I've changed cat with category and pos with img.
To know how to replace urls, use the code above (in .htaccess section) as a guide, example: replace thumbnails.php?album=$album with /album/$album or displayimage.php?album=$album&pos=$id for album/$album/img/$id

Thanks
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: mod_rewrite crash course: what and how
« Reply #29 on: March 16, 2005, 02:19:16 am »

Thank you rbl for your explications !
It's good for me !!
If someone want something mail me !
I have just one probleme to rewrite the slideshow link  ???
my website for kids in french http://www.coloriages.biz

Here is for the breadcrumb include/functions.inc

Code: [Select]
// Build the breadcrumb
function breadcrumb($cat, &$breadcrumb, &$BREADCRUMB_TEXT)
{
        global $album, $lang_errors, $lang_list_categories;
        global $CONFIG,$CURRENT_ALBUM_DATA, $CURRENT_CAT_NAME;
        if ($cat != 0) { //Categories other than 0 need to be selected
                $breadcrumb_array = array();
                if ($cat >= FIRST_USER_CAT) {
                        $user_name = get_username($cat - FIRST_USER_CAT);
                        if (!$user_name) $user_name = 'Mr. X';

                        $breadcrumb_array[] = array($cat, $user_name);
                        $CURRENT_CAT_NAME = sprintf($lang_list_categories['xx_s_gallery'], $user_name);
                        $row['parent'] = 1;
                } else {
                    $result = db_query("SELECT name, parent FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '$cat'");
                        if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_cat'], __FILE__, __LINE__);
                        $row = mysql_fetch_array($result);

                        $breadcrumb_array[] = array($cat, $row['name']);
                        $CURRENT_CAT_NAME = $row['name'];
                        mysql_free_result($result);
                }

                while($row['parent'] != 0){
                    $result = db_query("SELECT cid, name, parent FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '{$row['parent']}'");
                        if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['orphan_cat'], __FILE__, __LINE__);
                        $row = mysql_fetch_array($result);

                        $breadcrumb_array[] = array($row['cid'], $row['name']);
                        mysql_free_result($result);
                } // while

                $breadcrumb_array = array_reverse($breadcrumb_array);
                $breadcrumb = '<a href=index.php>'.$lang_list_categories['home'].'</a>';
                $BREADCRUMB_TEXT = $lang_list_categories['home'];

                foreach ($breadcrumb_array as $category){
                        $link = "<a href=/category/{$category[0]}>{$category[1]}</a>";
                        $breadcrumb .= ' > ' . $link;
                        $BREADCRUMB_TEXT .= ' > ' . $category[1];
                }

        }else{ //Dont bother just add the Home link  to breadcrumb
                $breadcrumb = '<a href=index.php>'.$lang_list_categories['home'].'</a>';
                $BREADCRUMB_TEXT = $lang_list_categories['home'];
        }
        //Add Link for album if aid is set
        if (isset($CURRENT_ALBUM_DATA['aid'])){
                $link = "<a href=/album/".$CURRENT_ALBUM_DATA['aid']."> Coloriage ".$CURRENT_ALBUM_DATA['title']."</a>";
                $breadcrumb .= ' > ' . $link;
                $BREADCRUMB_TEXT .= ' > ' . $CURRENT_ALBUM_DATA['title'];
        }
}

thanks by !!
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Please help
« Reply #30 on: March 16, 2005, 05:37:30 pm »

Hello
All is OK for my rewrite but i have one problem !
When I clic coloriages.biz/index.php it's OK
But when i do coloriages.biz i have this error

L'album/la photo demandé(e) n'existe pas !

Fichier: /var/www/html/coloriages/include/functions.inc.php - Ligne: 863

debug say

Code: [Select]
USER:
------------------
Array
(
    [ID] => c0f08bf1d692090d03ce1e3f3516d045
    [am] => 1
    [liv] => Array
        (
            [0] => 168
            [1] => 1153
            [2] => 2
            [3] => 1200
            [4] => 1225
        )

    [sort] => da
    [lap] => 1
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_group] => 1
    [user_active] => YES
    [user_name] => isa
    [user_password] => ********
    [user_lastvisit] => 2005-03-16 16:12:49
    [user_regdate] => 2005-02-13 18:54:41
    [user_group_list] =>
    [user_email] =>
    [user_website] =>
    [user_location] =>
    [user_interests] =>
    [user_occupation] =>
    [user_actkey] =>
    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 0
    [group_name] => Administrateurs
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
    [groups] => Array
        (
            [1] => 1
        )

)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content FROM cpg132_filetypes;
    [1] => SELECT * FROM cpg132_users WHERE user_id='1'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = 'b1f0d0142c7d8dfe494a2af0fd3ac491'
    [2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg132_usergroups WHERE group_id in (1)
    [3] => SELECT group_name FROM  cpg132_usergroups WHERE group_id= 1
    [4] => DELETE FROM cpg132_banned WHERE expiry < 1110990892
    [5] => SELECT * FROM cpg132_banned WHERE ip_addr='82.66.25.34' OR ip_addr='82.66.25.34' OR user_id=1
)

==========================
GET :
------------------
Array
(
    [pos] => -
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.10 - OK
------------------
mySQL version: 3.23.58
------------------
Coppermine version: 1.3.2
==========================
Module: gd
------------------
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
==========================
Module: mysql
------------------
Active Persistent Links 0
Active Links 1
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.1.1
Linked Version 1.2.1.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | escapeshellarg, , exec, passthru, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, system | escapeshellarg, , exec, passthru, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, system
file_uploads | On | On
include_path | .:/usr/share/pear | .:/usr/share/pear
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 90 | 90
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.063 seconds - 6 queries in 0.005 seconds - Album set :

I must have forget one / or something when i rewrite!

Thank you i wait  :-\\
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: mod_rewrite crash course: what and how
« Reply #31 on: March 16, 2005, 07:56:14 pm »

That's OK  ;D It was an error the htaccess  :P
Logged

Mike_PL

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: mod_rewrite crash course: what and how
« Reply #32 on: March 27, 2005, 11:03:13 am »

bug  :\'(
does anyone have the modified files in a zip somewhere or write a completed instructions?
Please.
« Last Edit: March 27, 2005, 11:12:08 am by Mike_PL »
Logged

Mike_PL

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: mod_rewrite crash course: what and how
« Reply #33 on: March 29, 2005, 11:35:08 am »

RBL - do you write completed instructions somtime?
This is no complet so I didnt instalation. Bug, bug, bug  :\'( :\'(

btw. Great mod!!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: mod_rewrite crash course: what and how
« Reply #34 on: March 29, 2005, 06:13:37 pm »

bug  :\'(
does anyone have the modified files in a zip somewhere or write a completed instructions?
Please.
RBL - do you write completed instructions somtime?
This is no complet so I didnt instalation. Bug, bug, bug :\'( :\'(

btw. Great mod!!

Be more carefull with your wording: the word "bug" is not a very nice thing to say in this thread! You should take a look at the subject of this thread: this is not a mod, it's just a basic crash course on the mod_rewrite module and how to use it with coppermine. It only exists to give you an idea, if you need more details, you should read the apache http server manual and google for particular issues you have. RBL never said this thread contained all information about mod_rewrite, as it would require several books to show every aspect of it. Basically, my suggestion is: if you don't understand what you're doing, you shouldn't fiddle with mod_rewrite at all.
Instead, you should have read the whole thread, especially
This is not a mod that can easily be put in a zip file and expected to work for everyone who downloads it. If you can't follow the the thread and understand it, you have no business attempting this modification. You are welcome to try it, but do not complain if your entire website goes down.

Mind your manners.
- as you can see, there have been others who didn't even bother to read; your reply won't win you friends here.

Joachim
Logged

LinkBliss

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
  • MapPoint
    • LinkBliss Text Ads Work
Re: mod_rewrite crash course: what and how
« Reply #35 on: March 30, 2005, 12:54:18 am »

has anyone been successful with this hack?

I did use his hack (wish I had found it earlier), but I did something similar posted in another section of this site --
http://forum.coppermine-gallery.net/index.php?topic=12672.0

The gallery is at http://www.rainbowseeker.us

Eric

LinkBliss

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
  • MapPoint
    • LinkBliss Text Ads Work
Re: mod_rewrite crash course: what and how
« Reply #36 on: March 30, 2005, 12:56:49 am »

This is not a mod that can easily be put in a zip file and expected to work for everyone who downloads it. If you can't follow the the thread and understand it, you have no business attempting this modification.

Wordpress has a feature about "permalinks" which uses htaccess, very easy to use for any novice. I wonder if more apps will become smart like this eventually..

eric

JeWelz

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 25
    • Landman Kids
Re: mod_rewrite crash course: what and how
« Reply #37 on: March 30, 2005, 05:43:31 pm »

This is awesome!!!!  Thank you!!! Quite a powerful functionality.

I'm implementing it a little differently but it is a cosmetic differene (I think) (more like the other hack posted on this topic).

I'm writting because I could use some help finding relevant coppermine code. Three things...

Thing #1 - Where do I find the code to make page two also be an html link:
http://www.absolutestockphoto.com/beta/thumbnails91.html (then click on page 2 to see my issue)

Thing #2 - I cannot find in the coppermine code where I can change the album list for a user:
http://www.absolutestockphoto.com/beta/index.php?cat=10020  

Thing #3 - I see in the .htaccess example that searches can be converted but I cannot get the darn "?" out of the url - where do I do this, I may be off base on what I'm trying to change.

Let me know what additional info I should provide.

Any assistance would be greatly apreciated!
Thanks!
Julie
Logged

cmooz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: mod_rewrite crash course: what and how
« Reply #38 on: May 09, 2005, 02:27:30 pm »

can someone pls upload the diplayimage.php for cpg version 1.3.3

thx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: mod_rewrite crash course: what and how
« Reply #39 on: May 09, 2005, 03:43:17 pm »

what's that suppossed to be good for? You can't just use one file from the package, you'll need the full package. I also can't see how this is suppossed to be related to the mod_rewrite thread you've replied to: don't try to hijack threads >:(!
You can get single files from the stable branch of the web cvs; displayimage.php is here for example: http://cvs.sourceforge.net/viewcvs.py/*checkout*/coppermine/stable/displayimage.php?rev=1.11

Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.047 seconds with 19 queries.