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: image identification  (Read 4103 times)

0 Members and 1 Guest are viewing this topic.

jdsmith

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
image identification
« on: February 02, 2006, 03:56:23 pm »

I use coppermine to let clients view photos I've taken for them - an online proofing system I suppose...  Works great, many thanks to the developers.  I have one problem that I was hoping someone had a fairly easy solution to.  When viewing the intermediate image, the position of the image is displayed above the image (ie.,  12/55).  People invariably take this as the image number since the real filename is less noticeable below.  I've previously gone into coppermine to determine the real filename.  But yesterday I realized (after printing the wrong image) that the 'position' changes depending on where they are viewing it from.  In other words, from the album, the image may be 12/55 but from their favorites it may be 20/88.  Does anyone have a suggestion on how to make the filename more prominent?  Maybe replace the position with the filename?  Many thanks.
« Last Edit: February 02, 2006, 04:59:05 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: image identification
« Reply #1 on: February 02, 2006, 04:11:11 pm »

OK, lets replace the position with the filename. Copy this function into your theme's theme.php file

Code: [Select]
function theme_html_img_nav_menu()
{
    global $CONFIG, $CURRENT_PIC_DATA, $meta_nav, $THEME_DIR ; //$PHP_SELF,
    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_text_dir, $template_img_navbar;

    $cat_link = is_numeric($album) ? '' : '&cat=' . $cat;

    $human_pos = $pos + 1;
    $page = ceil(($pos + 1) / ($CONFIG['thumbrows'] * $CONFIG['thumbcols']));
    $pid = $CURRENT_PIC_DATA['pid'];

    $start = 0;
        $start_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&pos=$start";
        $start_title = $lang_img_nav_bar['go_album_start'];
        $meta_nav .= "<link rel=\"start\" href=\"$start_tgt\" title=\"$start_title\" />
        ";
        $end = $pic_count - 1;
        $end_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$end";
        $end_title = $lang_img_nav_bar['go_album_end'];
        $meta_nav .= "<link rel=\"last\" href=\"$end_tgt\" title=\"$end_title\" />
        ";

    if ($pos > 0) {
        $prev = $pos - 1;
        $prev_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$prev";
        $prev_title = $lang_img_nav_bar['prev_title'];
                                $meta_nav .= "<link rel=\"prev\" href=\"$prev_tgt\" title=\"$prev_title\" />
                                ";
    } else {
        $prev_tgt = "javascript:;";
        $prev_title = "";
    }

    if ($pos < ($pic_count -1)) {
        $next = $pos + 1;
        $next_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$next";
        $next_title = $lang_img_nav_bar['next_title'];
                                $meta_nav .= "<link rel=\"next\" href=\"$next_tgt\" title=\"$next_title\"/>
                                ";
    } else {
        $next_tgt = "javascript:;";
        $next_title = "";
    }

    if (USER_CAN_SEND_ECARDS) {
        $ecard_tgt = "ecard.php?album=$album$cat_link&amp;pid=$pid&amp;pos=$pos";
        $ecard_title = $lang_img_nav_bar['ecard_title'];
    } else {
        template_extract_block($template_img_navbar, 'ecard_button'); // added to remove button if cannot send ecard
        /*$ecard_tgt = "javascript:alert('" . addslashes($lang_img_nav_bar['ecard_disabled_msg']) . "');";
        $ecard_title = $lang_img_nav_bar['ecard_disabled'];*/
    }

                //report to moderator buttons
    if (($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS)) {
        $report_tgt = "report_file.php?album=$album$cat_link&amp;pid=$pid&amp;pos=$pos";
    } else { // remove button if report toggle is off
        template_extract_block($template_img_navbar, 'report_file_button');

    }

                    $thumb_tgt = "thumbnails.php?album=$album$cat_link&amp;page=$page";
        $meta_nav .= "<link rel=\"up\" href=\"$thumb_tgt\" title=\"".$lang_img_nav_bar['thumb_title']."\"/>
        ";

    $slideshow_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pid=$pid&amp;slideshow=".$CONFIG['slideshow_interval'];

    $pic_pos = sprintf($lang_img_nav_bar['pic_pos'], $human_pos, $pic_count);

    if (defined('THEME_HAS_NAVBAR_GRAPHICS')) {
            $location= $THEME_DIR;
        } else {
            $location= '';
        }

    $params = array('{THUMB_TGT}' => $thumb_tgt,
        '{THUMB_TITLE}' => $lang_img_nav_bar['thumb_title'],
        '{PIC_INFO_TITLE}' => $lang_img_nav_bar['pic_info_title'],
        '{SLIDESHOW_TGT}' => $slideshow_tgt,
        '{SLIDESHOW_TITLE}' => $lang_img_nav_bar['slideshow_title'],
        '{PIC_POS}' => $CURRENT_PIC_DATA['filename'], // display filename instead of position
        '{ECARD_TGT}' => $ecard_tgt,
        '{ECARD_TITLE}' => $ecard_title,
        '{PREV_TGT}' => $prev_tgt,
        '{PREV_TITLE}' => $prev_title,
        '{NEXT_TGT}' => $next_tgt,
        '{NEXT_TITLE}' => $next_title,
        '{PREV_IMAGE}' => ($lang_text_dir=='ltr') ? 'prev' : 'next',
        '{NEXT_IMAGE}' => ($lang_text_dir=='ltr') ? 'next' : 'prev',
        '{REPORT_TGT}' => $report_tgt,
        '{REPORT_TITLE}' => $lang_img_nav_bar['report_title'],
        '{LOCATION}' => $location,
        );

    return template_eval($template_img_navbar, $params);
}
Logged

jdsmith

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: image identification
« Reply #2 on: February 02, 2006, 04:40:04 pm »

thanks for the speedy response.  Just to clarify - I use the igames theme and don't allow the users to switch.  So I add the code you provided to that theme.php?  Any particular place?  I'm not replacing anything - just adding?  Sorry for the questions, but I'm not a programmer and I want to do it right...
Logged

Nibbler

  • Guest
Re: image identification
« Reply #3 on: February 02, 2006, 04:49:38 pm »

Add it in just before the ?> at the end of the file.
Logged

jdsmith

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: image identification
« Reply #4 on: February 02, 2006, 04:54:19 pm »

Works perfect!  You are my hero!
Logged

Colliope

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Female
  • Posts: 126
Re: image identification
« Reply #5 on: February 09, 2006, 01:36:58 am »

Great find here on this super-easy change, thanks Nibbler, and thanks JD for asking. Perfect solution for my situation, too.

C
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 20 queries.