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] 2   Go Down

Author Topic: from thumbnail to full-size pop-up (skip intermediate page)  (Read 52679 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

This mod will skip the intermediate page and send users from the thumbnails directly to the full-size pop-up. Of course you'll lose all features that exist on the intermediate page (rating, comments, pic info, ecards, prev/next etc.).

This mod is for cpg1.4.x only - it has been adopted from the similar hack for cpg1.3.x. It has originally evolved in the thread Intermediate page in popup, read it for details.
This mod goes unsupported from my side, as I can't see the reason why anyone would like to skip the intermediate page at all (there are much simpler photo gallery scripts that only come with a thumbnails->full-size mechanism that you could use). However, I'm posting this mod simply because users keep on asking for it.

It comes "as-is", so don't request additional features. For the next coppermine version (cpg1.5.x, not released as of now), this feature will be part of the core (as admin settable option).

Here's the instructions:
1) Edit include/functions.inc.php
Find
Code: [Select]
                        $thumb_list[$i]['aid'] = $row['aid'];and add after it (into a new line)
Code: [Select]
                        $thumb_list[$i]['pid'] = $row['pid'];   //added for thumb to fullsize mod
                        $thumb_list[$i]['pwidth'] = $row['pwidth'];
                        $thumb_list[$i]['pheight'] = $row['pheight'];

2) edit themes/yourtheme/theme.php
Find
Code: [Select]
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')a) If this function exists in your custom theme:
find
Code: [Select]
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link",and replace with
Code: [Select]
//                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link", // commented out for the mod 'from thumbnail to pop-up'
                    '{LINK_TGT}' => "javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid={$thumb['pid']}&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width={$thumb['pwidth']},height={$thumb['pheight']}')",
The code you're suppossed to replace may (or may not) exist twice in your theme (one time inside the function definition that you're suppossed to edit, one in another function that determines the look of the filmstrip. You're suppossed to replace the search string within the above mentioned function, but it won't hurt if you replace the string twice, as nobody will see the filmstrip any longer if you apply this mod.
b) If the above mentioned function does not exist in your custom theme (themes/yourtheme/theme.php)
Paste
Code: [Select]
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
{
    global $CONFIG;
    global $template_thumb_view_title_row,$template_fav_thumb_view_title_row, $lang_thumb_view, $template_tab_display, $template_thumbnail_view, $lang_album_list;

    static $header = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $row_separator = '';
    static $footer = '';
    static $tabs = '';
    static $spacer = '';

    if ($header == '') {
        $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
        $tabs = template_extract_block($template_thumbnail_view, 'tabs');
        $header = template_extract_block($template_thumbnail_view, 'header');
        $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
        $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
        $footer = template_extract_block($template_thumbnail_view, 'footer');
        $spacer = template_extract_block($template_thumbnail_view, 'spacer');
    }

    $cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
    $uid_link = (isset($_GET['uid']) && is_numeric($_GET['uid'])) ? '&uid=' . $_GET['uid'] : '';

    $theme_thumb_tab_tmpl = $template_tab_display;

    if ($mode == 'thumb') {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
    } else {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
    }

    $thumbcols = $CONFIG['thumbcols'];
    $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';

    $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
    // The sort order options are not available for meta albums
    if ($sort_options) {
        $param = array('{ALBUM_NAME}' => $album_name,
            '{AID}' => $aid,
            '{PAGE}' => $page,
            '{NAME}' => $lang_thumb_view['name'],
            '{TITLE}' => $lang_thumb_view['title'],
            '{DATE}' => $lang_thumb_view['date'],
            '{SORT_TA}' => $lang_thumb_view['sort_ta'],
            '{SORT_TD}' => $lang_thumb_view['sort_td'],
            '{SORT_NA}' => $lang_thumb_view['sort_na'],
            '{SORT_ND}' => $lang_thumb_view['sort_nd'],
            '{SORT_DA}' => $lang_thumb_view['sort_da'],
            '{SORT_DD}' => $lang_thumb_view['sort_dd'],
            '{POSITION}' => $lang_thumb_view['position'],
            '{SORT_PA}' => $lang_thumb_view['sort_pa'],
            '{SORT_PD}' => $lang_thumb_view['sort_pd'],
            );
        $title = template_eval($template_thumb_view_title_row, $param);
    } else if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) { //Lots of stuff can be added here later
       $param = array('{ALBUM_NAME}' => $album_name,
                             '{DOWNLOAD_ZIP}'=>$lang_thumb_view['download_zip']
                               );
       $title = template_eval($template_fav_thumb_view_title_row, $param);
    }else{
        $title = $album_name;
    }


    if ($mode == 'thumb') {
        starttable('100%', $title, $thumbcols);
    } else {
        starttable('100%');
    }

    echo $header;

    $i = 0;
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            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']}$uid_link", // commented out for the mod 'from thumbnail to pop-up'
                    '{LINK_TGT}' => "javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid={$thumb['pid']}&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width={$thumb['pwidth']},height={$thumb['pheight']}')",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            }
        } else {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );
        }
        echo template_eval($thumb_cell, $params);

        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }
    }
    for (;($i % $thumbcols); $i++) {
        echo $empty_cell;
    }
    echo $footer;

    if ($display_tabs) {
        $params = array('{THUMB_COLS}' => $thumbcols,
            '{TABS}' => $tabs_html
            );
        echo template_eval($tabs, $params);
    }

    endtable();
    echo $spacer;
}
into a new line before
Code: [Select]
?>
Logged

cftranslate

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #1 on: August 01, 2006, 03:53:53 pm »

>>>>>I can't see the reason why anyone would like to skip the intermediate page

People's likes are always diverse but from my view what I might call 'economic browsing' (Browsing and getting info with the least number of clicks possible) is a must. It has always been.

I have been looking for this feature since I installed version 1.2.

This is a guess but I bet most people want a thumbnail page with as many thumbs as possible (broadband allows pretty big ones) and I want to see a full splendorous full size (1024x768) pop-up with a simple click to continue seeing pics by just closing the pop-up. Pop-ups are annoying when you don't request them but if you click on a thumb to get a full size pop-up with a full size fitting pic, this is obviously the way to go.

You can see the contrast clearly in first generation amateurish or custom-made galleries where you had captions like gallery 1, gallery 2 (even without thumbs) and got to galleries with 4 or five pictures. Ridiculous, right??. 'Economic browsing' is just the opposite.

I don't really think comments, strips, send pic etc are useful or frequently used features.

Thanks you for your solution and to the one who gave me an answer and link to this thread in the features request forum!
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #2 on: September 17, 2006, 09:04:37 am »

How about a solution that shows the full image on the page, but there is a link to the more detailed page in the caption? I thought this was really cool when I saw it: http://vikjavev.no/highslide/

I've tried it out in my gallery: http://takethu.com/index.php?theme=highslide_js

I think this navigation model is pretty neat. People can quickly view bigger images without waiting for various pages to load, and then have the option to see the file's details.

If there's interest, I'll post instructions in another thread.
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #3 on: September 17, 2006, 09:12:41 am »

Nice one :)
Also can be done as a plugin instead of new theme
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #4 on: September 17, 2006, 09:29:00 am »

A plugin would be very cool. As it is, I'm too lazy to modify all theme files, and that would make for an inconsistent viewing experience if people change themes.
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #5 on: September 21, 2006, 09:42:28 pm »

If there's interest, I'll post instructions in another thread.

My hand is raised (http://www.jeepsunlimited.com/forums/images/smilies/wavzing.gif)

Nicely done !

Note: I think it would better if, when hitting details, it doesn't open a new window (MO).

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #6 on: September 21, 2006, 11:37:34 pm »

I'm working on a plugin for it , I'll post it soon ;)
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #7 on: September 22, 2006, 12:03:30 am »

Cool! Thanks, Sami. :)
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #8 on: September 28, 2006, 01:06:42 pm »

You can find Sami's cool plugin here - http://forum.coppermine-gallery.net/index.php?topic=36558.0:o
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #9 on: September 28, 2006, 01:27:50 pm »

Thanks billy for pointing that out ... :D
Logged
‍I don't answer to PM with support question
Please post your issue to related board

jardimimperial

  • Translator
  • Coppermine newbie
  • **
  • Offline Offline
  • Posts: 6
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #10 on: May 03, 2007, 05:18:31 pm »

It most usefull! Thank you GauGau! :o
Logged

shiyan

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #11 on: May 09, 2007, 02:19:49 am »

excellent mod GauGau - works like a charm.

in CPG 1.5 will it be possible to show image dimension and file size on the thumbnails page? with this mod and CPG 1.4 the only file info I can show is file name and view number.

many thanks
Logged

Mamps

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #12 on: May 14, 2007, 02:24:15 pm »

I'm kind of new to to php and such. Therefore I dont know how to change this to run with Lightbox (http://forum.coppermine-gallery.net/index.php?topic=35539.msg192915#msg192915).
May anyone help me?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #13 on: May 15, 2007, 08:20:55 am »

Either apply the Lightbox mod or this one. Both of them can not co-exist, as they basically do the same and therefor interfere with the same part of the code.
Logged

Mamps

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #14 on: May 15, 2007, 09:52:09 am »

Really? I just want to the lightbox instead of a new fullsize popup...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #15 on: May 15, 2007, 10:26:31 am »

Then stay out of this thread, as it deals with the mod "from thumbnail to full-size pop-up" only. Apply the Lightbox mod instead.
Logged

shiyan

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #16 on: May 20, 2007, 11:52:32 pm »

I've noticed that the picture view statistics seem to have stopped logging new views after I applied this mod.

Is it a known issue or did I make a mistake somewhere?

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #17 on: May 21, 2007, 07:44:31 am »

You haven't made a mistake: the views counter is being increased when viewing an intermediate image. As this mod skips the intermediate view, the view counter doesn't increase any longer. So: the views counter stopping to increase is a known issue (or missing feature if you want) when using this mod. I don't have a workaround for you, sorry.
Logged

atiba

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #18 on: May 28, 2007, 02:49:08 pm »

"you'll lose all features that exist on the intermediate page", does this mean I lose the ability to delete pictures through the admin?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from thumbnail to full-size pop-up (skip intermediate page)
« Reply #19 on: May 28, 2007, 09:20:42 pm »

1) You can use the "edit files" link next to the thumbnail that represents the album to be able to delete individual pics if this is your only concern
2) In the end, this mod only changes the link on the thumbnails page. You (as admin) can easily enter the URL of the intermediate images page manually into the browser's address bar to be able to access it.
3) You could mod this mod and come up with an additional link to the intermediate sized page for the admin.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.032 seconds with 20 queries.