forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: lamme on March 14, 2005, 01:07:26 am

Title: Removal of Imagelinks for "last uploaded"
Post by: lamme 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
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: Abbas Ali 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']
        );
}
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: lamme 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

Title: Re: Removal of Imagelinks for "last uploaded"
Post by: Abbas Ali 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;
                }
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: lamme 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
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: Abbas Ali 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.
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: lamme on March 21, 2005, 08:48:37 pm
Yeah, thats easy.

Thanks for all your help!

Jakob
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: lamme 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
Title: Re: Removal of Imagelinks for "last uploaded"
Post by: Tarique Sani 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 :)