Advanced search  

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

Pages: [1]   Go Down

Author Topic: Permanent image links in albums  (Read 24227 times)

0 Members and 1 Guest are viewing this topic.

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Permanent image links in albums
« on: January 22, 2008, 07:39:57 am »

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:
Code: [Select]
} 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:
Code: [Select]
} 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 ??
« Last Edit: January 22, 2008, 09:24:39 am by Joachim Müller »
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: Permanent image links in albums
« Reply #1 on: January 22, 2008, 07:44:09 am »

Splitt and moved as suggested
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Permanent image links in albums
« Reply #2 on: January 22, 2008, 08:04:11 am »

For the film strip pictures to have permanent links:

Open include/functions.inc.php

Find:

Code: [Select]
$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:
Code: [Select]
                       
$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:
   
Code: [Select]
    $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:
Code: [Select]
    $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}' => ''
                );
Logged

Kapsel

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 3
    • Company webpage
Re: Permanent image links in albums
« Reply #3 on: May 20, 2008, 04:14:03 pm »

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!
Logged

olti

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 68
    • Galeria Shqiptare - Albanian Gallery
Re: Permanent image links in albums
« Reply #4 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!!
Logged

olti

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 68
    • Galeria Shqiptare - Albanian Gallery
Re: Permanent image links in albums
« Reply #5 on: June 12, 2008, 11:46:07 pm »

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

?

Thank you.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Permanent image links in albums
« Reply #6 on: June 13, 2008, 08:17:41 am »

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!
Logged

net

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: Permanent image links in albums
« Reply #7 on: July 09, 2008, 02:01:10 pm »

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!!
Logged

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Permanent image links in albums
« Reply #8 on: July 29, 2008, 06:17:38 am »

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..
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Permanent image links in albums
« Reply #9 on: July 29, 2008, 07:25:17 am »

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

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Permanent image links in albums
« Reply #10 on: August 06, 2008, 02:20:32 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Permanent image links in albums
« Reply #11 on: August 06, 2008, 08:59:58 pm »

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.
Logged

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: Permanent image links in albums
« Reply #12 on: December 12, 2008, 11:05:23 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?
Logged

Killswitch

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Permanent image links in albums
« Reply #13 on: December 14, 2008, 08:16:52 am »

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
Logged

kylemj

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Permanent image links in albums
« Reply #14 on: August 17, 2010, 03:40:10 pm »

just what i'm after, going to install when got some time :)
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.