hiding Voting stats hiding Voting stats
 

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

hiding Voting stats

Started by dino bambino, August 05, 2007, 04:42:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dino bambino

I have successfully removed the part on the displayimage.php page under the file that said whatever rating out of so many votes but what I'm also looking to do is disable the function that gives you the clickable button above the image that shows the votes as well in the File Information area. I do want this info shown to the administrator but not the general users.

Is this possible? Anyone have any suggestions on what files I need to modify?

Thanks so much!

Nibbler

Copy the navbar template from the sample theme into your theme.php and comment out the button.

dino bambino

Won't that hide it from everyone though? I would like the admin still to be able to view the voting stats details.

Forgive me if it a stupid question.  Thanks for your help!

dino bambino

I'm still looking for help on this one.
I did comment out the button that toggles the file info but now no one can see the stats.  The site I'm doing is a design competition site so the administrator needs to know what the standings are. 

Anyone have any ideas on how to do this?

Thanks again.

Nibbler

Instead of commenting out the button, tag it like this:


<!-- BEGIN file_info_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0" align="middle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
<!-- END file_info_button -->


Then copy the function theme_html_img_nav_menu() from the sample theme into your theme. In the code you just pasted look for the permissions section:


    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');

    }


After that part, add in code to remove the button if not admin:


if (!GALLERY_ADMIN_MODE)  template_extract_block($template_img_navbar, 'file_info_button');

dino bambino

THANKS!  That worked.

I really appreciate your help. I've been banging my head against a wall trying to figure it out.