coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: dino bambino on August 05, 2007, 04:42:22 AM

Title: hiding Voting stats
Post by: dino bambino on August 05, 2007, 04:42:22 AM
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!
Title: Re: hiding Voting stats
Post by: Nibbler on August 05, 2007, 01:29:46 PM
Copy the navbar template from the sample theme into your theme.php and comment out the button.
Title: Re: hiding Voting stats
Post by: dino bambino on August 05, 2007, 04:55:13 PM
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!
Title: Re: hiding Voting stats
Post by: dino bambino on August 07, 2007, 08:05:25 PM
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.
Title: Re: hiding Voting stats
Post by: Nibbler on August 07, 2007, 08:16:17 PM
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');
Title: Re: hiding Voting stats
Post by: dino bambino on August 07, 2007, 09:40:30 PM
THANKS!  That worked.

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