forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: mr.bena 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?
-
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
******************************************************************************/
-
Hi, Andre. I did apply the code to theme.php, unfortunately it does not work.. any alternate solution?
-
Please post a link to your gallery and attach your whole theme as zip file to your next reply.
-
Hi, Andre. My gallery is www.zofate.com and I attach my curve theme as a zip file below.
-
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.
-
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.
-
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.
-
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)
-
. 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
-
Great Help, Andre. It does work! :D
-
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
Template 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
-
Thank you.. I did as suggested.
-
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?
-
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.
-
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.. :-[
-
Why not just adjust that mod (http://forum.coppermine-gallery.net/index.php/topic,74737.0.html) to let the uploader see the votings?
-
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...
-
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.
-
Great help! It works again.. Andre. Thank you so much..
-
I may be a little annoying, Andre. I think adjusting the mod we have discussed here (http://"http://forum.coppermine-gallery.net/index.php/topic,74737.0.html") would be better again. If that mod (http://"http://forum.coppermine-gallery.net/index.php/topic,74737.0.html") could be adjusted to show the Rating only for admin & the picture uploader, it seems better because the uploader will not have to click a link. The show details link function we have discussed here would be the same anyway with the request adjustment.
I adjust that mod like this..
if (GALLERY_ADMIN_MODE && USER_ID == $CURRENT_PIC_DATA['owner_id'])
{
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf(($CURRENT_PIC_DATA['aid'] == 13 ? '(Current rating : %s)' : $lang_rate_pic['rating']), round(($CURRENT_PIC_DATA['pic_rating'] / 2000) / (5/$rating_stars_amount), 1), $rating_stars_amount, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
}
else
{
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf(($CURRENT_PIC_DATA['aid'] == 13 ? '.' : $lang_rate_pic['rating']), round(($CURRENT_PIC_DATA['pic_rating'] / 2000) / (5/$rating_stars_amount), 1), $rating_stars_amount,$CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
}
I do not know why.. it does not work...
-
Double post: http://forum.coppermine-gallery.net/index.php/topic,74737.msg360000.html#msg360000
Please don't ask unrelated questions in this thread. Your question resides well in the other thread. I already answered there.
-
My apology. It was my mistake. :-\