coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: kiwibrit on December 14, 2006, 11:25:52 PM

Title: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 14, 2006, 11:25:52 PM
I'd like to display "Click on image to view larger image" below the intermediate image where the final picture is larger than the intermediate image.  At first look, this seems doable, since the option to click in such situations is inherently there already.

I suspect someone has already thought of this - in which case please point me at the reference - but I have studied the config page, the documentation, and searched the forum, and not found the answer.

If I can be pointed at where the image is given the link capability, I think I have enough php knowledge to take it from there.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: Nibbler on December 15, 2006, 12:29:41 AM
Check theme_html_picture() in the theme system.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 15, 2006, 07:37:04 PM
Thanks.  I haven't figured it out,yet, But I'll play with that.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 16, 2006, 01:16:04 PM
Getting there.  I've gone to include/makers/themes.inc.php

then to line 714

and reserved the line, as it were:


<!-- BEGIN Advice to click for larger image -->
<tr>
<td class="tableb"><center><em>Click image for larger display if available.</em></center></td>
</tr>
<!-- END advice to click for larger image -->

Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: Joachim Müller on December 16, 2006, 02:27:35 PM
Quote from: kiwibrit on December 16, 2006, 01:16:04 PM
Getting there.  I've gone to include/makers/themes.inc.php
Such a file doesn't exist. The file you're refering to probably is include/themes.inc.php. However, you mustn't edit that file - under no circumstances. Edit themes/yourtheme/theme.php instead.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 16, 2006, 04:08:40 PM
Quote from: GauGau on December 16, 2006, 02:27:35 PM
Such a file doesn't exist. The file you're refering to probably is include/themes.inc.php. However, you mustnÄt edit that file - under no circumstances. Edit themes/yourtheme/theme.php instead.

My bad for the file address, thanks for pointing that out, and the need to leave that file alone. Following code now appears themes/yourtheme/theme.php :


// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2" cellpadding="0" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN Advice to click for larger image -->
<tr>
<td class="tableb"><center><em>Click image for larger display if available.</em></center></td>
</tr>
<!-- END advice to click for larger image -->

<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;


Text appears where it should.  Next step will be to dig out image width/height so that larger image text appears when needed only.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 18, 2006, 01:26:06 PM
Quote from: Nibbler on December 15, 2006, 12:29:41 AM
Check theme_html_picture() in the theme system.

Thanks, I deleted my earlier coding in theme.php and inserted the following inside function theme_html_picture()

if ($CURRENT_PIC_DATA['pwidth']>400) {$CURRENT_PIC_DATA['caption']=$CURRENT_PIC_DATA['caption']."<br /><br /> <em>Click picture for larger image</em>";}//intermediate picture width is 400.


That achieves the immediate result I was after.  However, it would be nice to have the  variable for the intermediate picture width in the line, rather than 400, in case I set a different width.  I haven't spotted the variable - could you tell me what it is?
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: Joachim Müller on December 18, 2006, 08:02:26 PM
$CONFIG['picture_width'] should do the trick.
Title: Re: Inserting "Click on image to view larger image" below intermediate image
Post by: kiwibrit on December 18, 2006, 08:59:43 PM
Yup, it does.  Thank you for your help, guys.  Problem fully resolved.