Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: Hide Diplay File Information Button.  (Read 6669 times)

0 Members and 1 Guest are viewing this topic.

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Hide Diplay File Information Button.
« on: April 02, 2012, 04:25:38 pm »

Could you please let me know how to disable/hide the file information button that appears above the intermediate picture..for registered members and guest?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #1 on: April 03, 2012, 12:54:13 pm »

Copy this to your theme's theme.php file:
Code: [Select]
/******************************************************************************
** Section <<<$template_img_navbar>>> - START
******************************************************************************/
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="{LOCATION}images/navbar/thumbnails.png" align="middle" border="0" alt="{THUMB_TITLE}" /></a></td>
<!-- BEGIN pic_info_button -->
<!-- END pic_info_button -->
<!-- BEGIN slideshow_button -->
                <!-- button will be added by displayimage.js -->
                <td id="slideshow_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END slideshow_button -->
                <td align="center" valign="middle" class="navmenu" width="100%">{PIC_POS}</td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}" rel="nofollow"><img src="{LOCATION}images/navbar/report.png" border="0" align="middle" alt="{REPORT_TITLE}" /></a></td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}" rel="nofollow"><img src="{LOCATION}images/navbar/ecard.png"  border="0" align="middle" alt="{ECARD_TITLE}" /></a></td>
<!-- END ecard_button -->
<!-- BEGIN nav_start -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{START_TGT}" class="navmenu_pic" title="{START_TITLE}"><img src="{LOCATION}images/navbar/{START_IMAGE}" border="0" align="middle" alt="{START_TITLE}" /></a></td>
<!-- END nav_start -->
<!-- BEGIN nav_prev -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="{LOCATION}images/navbar/{PREV_IMAGE}" border="0" align="middle" alt="{PREV_TITLE}" /></a></td>
<!-- END nav_prev -->
<!-- BEGIN nav_next -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="{LOCATION}images/navbar/{NEXT_IMAGE}" border="0" align="middle" alt="{NEXT_TITLE}" /></a></td>
<!-- END nav_next -->
<!-- BEGIN nav_end -->
                <td align="center" valign="middle" class="navmenu" width="48"><a href="{END_TGT}" class="navmenu_pic" title="{END_TITLE}"><img src="{LOCATION}images/navbar/{END_IMAGE}" border="0" align="middle" alt="{END_TITLE}" /></a></td>
<!-- END nav_end -->

        </tr>

EOT;
/******************************************************************************
** Section <<<$template_img_navbar>>> - END
******************************************************************************/
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #2 on: April 03, 2012, 02:18:38 pm »

Hi, Andre. I did apply the code to theme.php, unfortunately it does not work.. any alternate solution?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #3 on: April 03, 2012, 03:09:47 pm »

Please post a link to your gallery and attach your whole theme as zip file to your next reply.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #4 on: April 03, 2012, 03:40:56 pm »

Hi, Andre. My gallery is www.zofate.com and I attach my curve theme as a zip file below.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #5 on: April 03, 2012, 03:54:51 pm »

Works as expected in my gallery. Probably a plugin overwrites the changes in your theme.php file. There's a button "Click to view full size image" in your navbar that doesn't exist by default. Check which plugin (or maybe a mod) adds that button.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #6 on: April 03, 2012, 04:21:01 pm »

It is the Lightbox Plugin. I saw from the thread http://forum.coppermine-gallery.net/index.php/topic,62905.120.html. Here, a user called "almeidap" face the same problem and post some code saying..

"As a little contribution and for a more unobtrusive approach, here is a little script that anyone can add in their template to change the behavior of the default Coppermine slideshow button. And, as a bonus, it also starts the LightBox slideshow automatically"

Could the code be a solution? I do not really get him when he says "anyone can add in their template", when I paste his code to my template.html, no changes is observed at all.. Lightbox plugin is really great and I do not feel like removing to be honest, but I really wish there is a way to hide this file information button.. I do not want my user to see the files information.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #7 on: April 03, 2012, 04:31:40 pm »

In that plugin directory, open codebase.php, find
Code: [Select]
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
and remove it completely.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #8 on: April 03, 2012, 05:34:59 pm »

Thank you very much, Andre.. The problem is more or less solved. But, now that even the admin cannot see the file info button, how will I see the file info of a picture as for me the admin. The file info show the voting statistics link which is very useful. Is there a way to see the vote statistics of a particular file as for me the admin, now that the file info button is hidden? (pardon me if I am out of topic)
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1503
  • aka 'i-imagine'
    • Home Page
Re: Hide Diplay File Information Button.
« Reply #9 on: April 04, 2012, 12:28:23 am »

. But, now that even the admin cannot see the file info button, how will I see the file info of a picture

This is untested, but should work. Edit codebase.php after making a backup.

Find:
Code: [Select]
// HTML template for the image navigation bar

Add directly above it:
Code: [Select]
    $button_picinfo = '';
    if (GALLERY_ADMIN_MODE) {
    $button_picinfo = <<<EOT
<!-- BEGIN pic_info_button -->
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END pic_info_button -->
EOT;
}

Find:
Code: [Select]
<!-- BEGIN pic_info_button -->
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
<!-- END pic_info_button -->

Replace with:
Code: [Select]
   {$button_picinfo}


Good luck

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #10 on: April 04, 2012, 01:24:23 am »

Great Help, Andre. It does work! :D
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #11 on: April 04, 2012, 10:29:12 am »

It wasn't me, but Joe who posted the last code modification. However, it's not recommended to remove HTML comments like
Code: [Select]
<!-- BEGIN pic_info_button -->or
Code: [Select]
<!-- END pic_info_button -->as they are needed to remove template blocks. If Coppermine tries to remove that block you'll get an error message like
Quote
Template error - Failed to find block 'pic_info_button'


So you should better use the following code. In codebase.php, find
Code: [Select]
// HTML template for the image navigation bar and above, add
Code: [Select]
    $button_picinfo = '';
    if (GALLERY_ADMIN_MODE) {
    $button_picinfo = <<<EOT
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
EOT;
}

find
Code: [Select]
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>
and replace with
Code: [Select]
$button_picinfo
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #12 on: April 04, 2012, 10:35:54 am »

Thank you.. I did as suggested.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #13 on: April 10, 2012, 05:24:37 pm »

One more thing please, I want this button to available as well for the uploader of that particular picture, meaning if he is the file uploader he will be able to see the file info button otherwise "no". Could you please help me achieve this?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #14 on: April 12, 2012, 09:18:08 am »

That will be possible, but may add some unintended behavior. If the file information box is expanded or collapsed for a particular user is stored in a cookie, depending on the last choice of the user. Now, if the 'uploader' shows the file information box for his/her own pictures, he/she will also see it for other users' pictures.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #15 on: April 12, 2012, 03:14:05 pm »

Oh, very unlucky... I am running a competition. The file uploader will have a desire to see how much votes they have received as much as they do not want others to see how much they gain.. :-[
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #16 on: April 12, 2012, 03:50:45 pm »

Why not just adjust that mod to let the uploader see the votings?
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #17 on: April 12, 2012, 04:21:12 pm »

Well, Andre, if you can give some suggestion for adjusting the mod you mention regarding to this, it will be somehow useful.

However, why I want to enable the file info button for the uploader is that the file info button has the "show details" link from where we can see the detail votes (vote stats). What I really want is, I want the picture uploader to see his picture's vote statistics, so he will be able to see how many visitors and registered members has given him vote...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Hide Diplay File Information Button.
« Reply #18 on: April 16, 2012, 04:12:33 pm »

Copy this to your theme's theme.php file
Code: [Select]
/******************************************************************************
** Section <<<theme_html_picinfo>>> - START
******************************************************************************/
function theme_html_picinfo(&$info)
{
    global $lang_picinfo, $CONFIG, $CURRENT_PIC_DATA, $LINEBREAK;

    if (!GALLERY_ADMIN_MODE && USER_ID != $CURRENT_PIC_DATA['owner_id']) {
        return '';
    }

    if ($CONFIG['picinfo_movie_download_link']) {
        $path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
        $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
        if ($mime_content['content']=='movie') {
            $info[$lang_picinfo['download_URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic.'">'. $lang_picinfo['movie_player'] .'</a>';
        }
    }

    $html = '';
    $html .= '        <tr><td colspan="2" class="tableh2">'.$lang_picinfo['title'].'</td></tr>' . $LINEBREAK;
    $template = '        <tr><td class="tableb tableb_alternate" valign="top" >%s:</td><td class="tableb tableb_alternate">%s</td></tr>' . $LINEBREAK;
    foreach ($info as $key => $value) {
        $html .= sprintf($template, $key, $value);
    }

    return $html;
}
/******************************************************************************
** Section <<<theme_html_picinfo>>> - END
******************************************************************************/

This will hide the file information box completely, if the user is no admin and hasn't uploaded the picture. I suggest to remove the above mod, so the button itself will be displayed for everybody.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide Diplay File Information Button.
« Reply #19 on: April 16, 2012, 05:07:24 pm »

Great help! It works again.. Andre. Thank you so much..
Logged
Pages: [1] 2   Go Up
 

Page created in 0.03 seconds with 20 queries.