Hide Diplay File Information Button. Hide Diplay File Information Button.
 

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

Hide Diplay File Information Button.

Started by mr.bena, April 02, 2012, 04:25:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mr.bena

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?

Αndré

Copy this to your theme's theme.php file:
/******************************************************************************
** 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
******************************************************************************/

mr.bena

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

Αndré

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

mr.bena

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

Αndré

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.

mr.bena

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.

Αndré

In that plugin directory, open codebase.php, find
                <!-- 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.

mr.bena

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)

Joe Carver

Quote from: mr.bena on April 03, 2012, 05:34:59 PM
. 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:
// HTML template for the image navigation bar

Add directly above it:

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

<!-- 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:

   {$button_picinfo}



Good luck

mr.bena


Αndré

It wasn't me, but Joe who posted the last code modification. However, it's not recommended to remove HTML comments like
<!-- BEGIN pic_info_button -->
or
<!-- 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
QuoteTemplate error - Failed to find block 'pic_info_button'


So you should better use the following code. In codebase.php, find
// HTML template for the image navigation bar
and above, add
    $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
                <!-- button will be added by displayimage.js -->
                <td id="pic_info_button" align="center" valign="middle" class="navmenu" width="48"></td>

and replace with
$button_picinfo

mr.bena


mr.bena

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?

Αndré

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.

mr.bena

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.. :-[

Αndré

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

mr.bena

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...

Αndré

Copy this to your theme's theme.php file
/******************************************************************************
** 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.

mr.bena

Great help! It works again.. Andre. Thank you so much..