Permanent image links in albums Permanent image links in albums
 

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

Permanent image links in albums

Started by copperminepro, January 22, 2008, 07:39:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

copperminepro

I can not create a topic in the Mods forum, if one of the moderators doesn't mind, could you split this topic and move it there? Maybe some other people could contribute.

This is for people who would like their thumbnail pages to have a permalink.

It will make your images have permanent links shown when you are browsing albums (ex. http://coppermine-gallery.net/demo/cpg14x/displayimage.php?pos=-372)

This is a great modification to make if you want search engine traffic. I have a site with 200k pageviews a day and only 2% of my traffic comes from image search. This modification should quadruple my gallery's search traffic in my niche.

The urls can be further SEO'd with rewrites. My images effectively appear as http://coppermine-gallery.net/demo/cpg14x/displayimage-372.html.


Open /includes/themes.inc.php (or your theme.php)

Find:

} else {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );


Replace with:

} else {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?pos=-{$thumb['pid']}",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );


That's it...


There is an issue I have not solved yet... The film strip will NOT have the new friendly URL's, and the Next/Previous tabs will not have the new friendly permalinks.

I am working on these and will post when I have them working... I was told that this required extensive modification but making permalinks really is not much of a modification ??

SaWey


copperminepro

For the film strip pictures to have permanent links:

Open include/functions.inc.php

Find:


$p=$i - 1 + $lower_limit;
                        $p=($p < 0 ? 0 : $p);
                        $thumb_list[$i]['pos'] = $key < 0 ? $key : $p;
                        $thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"$pic_title\" />";
                        $thumb_list[$i]['caption'] = $CONFIG['display_film_strip_filename'] ? '<span class="thumb_filename">'.$row['filename'].'</span>' : '';
                        $thumb_list[$i]['admin_menu'] = '';


Replace With:
                       
$p=$i - 1 + $lower_limit;
                        $p=($p < 0 ? 0 : $p);
                        $thumb_list[$i]['pos'] = $key < 0 ? $key : $p;
$thumb_list[$i]['pid'] = $row['pid'];
                        $thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"$pic_title\" />";
                        $thumb_list[$i]['caption'] = $CONFIG['display_film_strip_filename'] ? '<span class="thumb_filename">'.$row['filename'].'</span>' : '';
                        $thumb_list[$i]['admin_menu'] = '';





Open /include/themes.inc.php

Find:
       $i = 0;
    $thumb_strip = '';
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );


Replace With:
    $i = 0;
    $thumb_strip = '';
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?pos=-{$thumb['pid']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );

Kapsel

Genius script! :)
I had a problem with not-pemanent links in google and I couldn't find good solution. Now everything works great  ;D Thanks!

olti

I use for my gallery Search Engine Friendly URLs plugin made by CPG team, so do I really need this hack?

I tried it but with this changes doesn't work anymore HighSlide plugin!!

olti

Quote from: olti on June 12, 2008, 01:26:33 AM
I use for my gallery Search Engine Friendly URLs plugin made by CPG team, so do I really need this hack?

?

Thank you.

Joachim Müller

This is not a hotline. Respect board rules! >:( You already have a very negative karma record on this board. If you don't play by the rules, you'll get banned. This is the last warning!

net

You sir, is a hero!

I've been looking for this forever, thank you soo much, this makes everything so much better for users who wish to link images from the gallery, no one ever uses the url in the file information section.

Thanks!!

rony446

any one can tell me how can i put image caption upper of the image. normally image caption store in the below of the image. i want to put it upper of the image. can any body solve this plz..

Joachim Müller

You already have an open thread about that. Stop double and triple-posting.

copperminepro

Quote from: olti on June 12, 2008, 01:26:33 AM
I use for my gallery Search Engine Friendly URLs plugin made by CPG team, so do I really need this hack?

I tried it but with this changes doesn't work anymore HighSlide plugin!!

Yes, it's pretty important for SEO

Joachim Müller

The SEF_URLs plugin has been abandoned by the coppermine devs, since it was just too buggy. You're welcome to continue the development of the SEF_URLs plugin.

mahdi1234

Quote from: copperminepro on January 22, 2008, 07:39:57 AM
There is an issue I have not solved yet... and the Next/Previous tabs will not have the new friendly permalinks.

I am working on these and will post when I have them working... I was told that this required extensive modification but making permalinks really is not much of a modification ??

Hi copperminepro - did you get anywhere with the Next/Previous links?

Killswitch

Sweet, I was just about to work on this when I read about the pos causing results to fluctuate.  Saved me alot of hassle :D

kylemj

just what i'm after, going to install when got some time :)