[Solved]: adding a table row in thumbnails.php [Solved]: adding a table row in thumbnails.php
 

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

[Solved]: adding a table row in thumbnails.php

Started by Fed, March 15, 2008, 03:05:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fed

Hello guys

I want to add a row at the beginning and at the end of the images table in thumbnails.php but I don't know where I should put this code

the row content will be almost static (I just need to access the search $_POST value) so I am looking for the place where the final HTML code is generated, no need to interact with building the SQL statement etc

where should I look for this piece of code?

Nibbler

Copy the $template_thumbnail_view template from the sample theme into your custom theme's theme.php and modify your copy.

Fed

to clarify I want to add the line immediately below

search results "snow"

see the page with a search for snow http://www.imagetemple.com/gallery/thumbnails.php?album=search&search=snow

and above "64 files on 4 page"

Nibbler

Add new rows into the header and footer sections of the template. Also, update your gallery.

Fed

thank you Nibbler

if I add them into the template I suppose they'll be above the "search results" and below the image counters at the bottom

I might and probably will end doing this way, but what if I wanted to add a row inside the table? say below <td class="tableh1" colspan="4">Search results - "snow"</td>?

Nibbler

Just do as I suggested, eg.


// HTML template for thumbnails display
$template_thumbnail_view = <<<EOT

<!-- BEGIN header -->
<tr>
<td colspan="4">Extra row here</td>
</tr>
        <tr>
<!-- END header -->
<!-- BEGIN thumb_cell -->
        <td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
                <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td align="center">
                                        <a href="{LINK_TGT}">{THUMB}<br /></a>
                                        {CAPTION}
                                        {ADMIN_MENU}
                                </td>
                        </tr>
                </table>
        </td>
<!-- END thumb_cell -->
<!-- BEGIN empty_cell -->
                <td valign="top" class="thumbnails" align="center">&nbsp;</td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr>
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<tr>
<td colspan="4">Extra row here</td>
</tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{THUMB_COLS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

Fed

thank you, I have the rows perfectly running ;)

I might update the gallery shortly, but would I loose all the modifications I've done?

Nibbler

You'd lose any modifications to core code. Plugins and theme changes will be fine.

Fed

I am receiving 500-600 spammy comments/day, would upgrading fix this?

is there a comment approval or spammy IP suspension in the current release?

Joachim Müller

We have a strict "One question per thread" policy that you agreed to respect when signing up. Upgrading will not change comment settings. Search the board for the terms "comment spam", "captcha" and "akismet". Locking