Removal of Imagelinks for "last uploaded" Removal of Imagelinks for "last uploaded"
 

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]

Main Menu

Removal of Imagelinks for "last uploaded"

Started by lamme, March 14, 2005, 01:07:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lamme

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

Abbas Ali

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


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


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']
        );
}
Chief Geek at Ranium Systems

lamme

#2
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


Abbas Ali

Edit include/functions.inc.php

Replace (around line 617)


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


                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;
                }
Chief Geek at Ranium Systems

lamme

Thanks again!

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


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

Abbas Ali

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.
Chief Geek at Ranium Systems

lamme

Yeah, thats easy.

Thanks for all your help!

Jakob

lamme

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

Tarique Sani

That is a bug which will be fixed in the next version, which will be released when it is ready :)
SANIsoft PHP applications for E Biz