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: Removal of Imagelinks for "last uploaded"  (Read 4194 times)

0 Members and 1 Guest are viewing this topic.

lamme

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Removal of Imagelinks for "last uploaded"
« on: March 14, 2005, 01:07:26 am »

Hi

I the problem that my users often click on the last uploaded pictures at the buttom of my gallery, and then they get to view the newest pictures in the wrong order eg. If I have uploaded a series of pictures from a party.
I can remove the hole thing (the veiw of newest pictures on the front page), but I would like them to be shown but without the links (non-clickable) or even better if the links could be directed to the first picture in the album where it belongs and not to the newest-picture-list.

I hope you can get what I mean.

Thanks
Jakob
« Last Edit: March 21, 2005, 09:00:30 pm by TranzNDance »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Removal of Imagelinks for "last uploaded"
« Reply #1 on: March 14, 2005, 07:46:41 am »

Following changes will take the user to first pic of the album where it belongs.

Edit themes/yourtheme/theme.php (You will have to make these changes in every theme you use)

Replace

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

with

Code: [Select]
if ($aid == 'lastalb') {
    $params = array('{CELL_WIDTH}' => $cell_width,
        '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
        '{THUMB}' => $thumb['image'],
        '{CAPTION}' => $thumb['caption'],
        '{ADMIN_MENU}' => $thumb['admin_menu']
        );
} elseif ($aid == 'lastup') {
    $params = array('{CELL_WIDTH}' => $cell_width,
        '{LINK_TGT}' => "displayimage.php?album={$thumb['aid']}&pos=0",
        '{THUMB}' => $thumb['image'],
        '{CAPTION}' => $thumb['caption'],
        '{ADMIN_MENU}' => $thumb['admin_menu']
        );
} else {
    $params = array('{CELL_WIDTH}' => $cell_width,
        '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",
        '{THUMB}' => $thumb['image'],
        '{CAPTION}' => $thumb['caption'],
        '{ADMIN_MENU}' => $thumb['admin_menu']
        );
}
Logged
Chief Geek at Ranium Systems

lamme

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Removal of Imagelinks for "last uploaded"
« Reply #2 on: March 14, 2005, 11:54:59 am »

Thanks, man!
That did the trick. I changed it so that it points to album view instead of the first pics. Works perfectly!

Now, to make this complete, I thought of showing the album name under the 'lastup'-pics on the front page, like a title. Now, this would be even better if I could sort out pictures from the same album, so that it will show only the newest picture from each album.
Can you help me with one or both changes?
- All help will be highly appreciated.

Thanks a lot.
Jakob

« Last Edit: March 14, 2005, 01:34:57 pm by lamme »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Removal of Imagelinks for "last uploaded"
« Reply #3 on: March 14, 2005, 01:45:09 pm »

Edit include/functions.inc.php

Replace (around line 617)

Code: [Select]
if ($set_caption) foreach ($rowset as $key => $row){
        $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : '';
        $caption = $user_link.'<span class="thumb_caption">'.localised_date($row['ctime'], $lastup_date_fmt).'</span>';
        $rowset[$key]['caption_text'] = $caption;
}

with

Code: [Select]
                if ($set_caption) foreach ($rowset as $key => $row){
                $result = db_query("SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '{$row['aid']}'");
                $row = mysql_fetch_array($result);
                $albumName = $row['title'];
                        $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : '';
                        $caption = $user_link.'<span class="thumb_caption">'.$albumName." - ".localised_date($row['ctime'], $lastup_date_fmt).'</span>';
                        $rowset[$key]['caption_text'] = $caption;
                }
Logged
Chief Geek at Ranium Systems

lamme

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Removal of Imagelinks for "last uploaded"
« Reply #4 on: March 14, 2005, 03:07:25 pm »

Thanks again!

had to replace:              
Code: [Select]
$row = mysql_fetch_array($result);
$albumName = $row['title'];

with:
Code: [Select]
$row2 = mysql_fetch_array($result);
$albumName = $row2['title'];
because it showed the date as "Jan 1. 1970"

But now it works.

Can you give me a hint to where I can add some code that sorts out subsequent thumbs of the same album? This way only one picture from each of the newest updated albums will be shown.

Thanks
Jakob
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Removal of Imagelinks for "last uploaded"
« Reply #5 on: March 17, 2005, 11:56:52 am »

Why dont you use last updated meta album instead of last uploaded pics?

Go to config and under " The content of the main page" change lastup,2 to lastalb,2

By doing this you will be getting all the updated albums instead of latest uploaded pics on main page.
Logged
Chief Geek at Ranium Systems

lamme

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Removal of Imagelinks for "last uploaded"
« Reply #6 on: March 21, 2005, 08:48:37 pm »

Yeah, thats easy.

Thanks for all your help!

Jakob
Logged

lamme

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Removal of Imagelinks for "last uploaded"
« Reply #7 on: March 22, 2005, 02:57:31 pm »

Just one last modification request:

Now, the last updated album shows the thumbnailpics for the first picture added to the updated album and not the last picture added... How can i change this?


Thanks
Jakob
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: Removal of Imagelinks for "last uploaded"
« Reply #8 on: March 23, 2005, 06:16:47 am »

That is a bug which will be fixed in the next version, which will be released when it is ready :)
Logged
SANIsoft PHP applications for E Biz
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.