Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: can't find the way to add "$template_display_media" to my templte (for ads)  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

rokokon

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

I search in the forum and try to add ti my templte the code:
Code: [Select]
// 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 caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;

My style is "My Thank", i want to add banner to the side of the image and zip for "theme":

Please help, Thanks!
Regards,
roko
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

As suggested in the docs: if a particular section that needs editing doesn't exist in your custom theme, copy that "missing" section from the sample theme.

In your particular case, copy
Code: [Select]
// 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 caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;
from themes/sample/theme.php into a new line before
Code: [Select]
?> of themes/yourtheme/theme.php and then modify as you see fit.

It's funny, I have explained that only three days ago, see http://forum.coppermine-gallery.net/index.php/topic,58010.msg286297.html#msg286297 ...

There's no rocket science behind this, but plain HTML - if you want to display your ad at the right of your intermediate-sized image, change the code I have made you paste in above as suggested here:
Code: [Select]
// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center" display_media>
                                                {IMAGE}

                                        </td>
                                        <td align="center" valign="middle">
                                        Your advert code goes here
                                        </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 caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;

For your full ease of use I have modified your custom theme file and attached it to my posting - just download, rename from theme.php.txt to theme.php and replace your existing copy with the modified one.

In the future please respect board rules: posting a link to your gallery is mandatory.
« Last Edit: March 01, 2009, 08:28:08 pm by Joachim Müller »
Logged

rokokon

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

First, Thanks for your help.
secondly i missed you post but i'm really make a serch before post...  :-\

I'm not posting a link to my gallery because i not have gallery
on net I'm working on my PC For edit template first.

I add you code but i don't eant in the right of the image i want right and left like in the image i upload..
I hope you can help me and Thanks again
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

You'll need to edit an entirely different section  of theme.php to accomplish that. Undo your previous edit (the section where you modified $template_display_media). Here's the explanation for everyone: edit themes/yourtheme/theme.php, find
Code: [Select]
function theme_display_imageand edit as suggested below. If that section doesn't exist in your custom theme, copy
Code: [Select]
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}
from themes/sample/theme.php into a new line before
Code: [Select]
?>of the file themes/yourtheme/theme.php, then edit by adding another table construct that wraps the output with additional columns to the left and right. Here's how this is suppossed to look like:
Code: [Select]
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

echo <<< EOT
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="10%">
Your left column advert goes here
</td>
<td valign="top" width="80%">
EOT;
    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
    echo $comments;
    echo "</div>\n";
echo <<< EOT
</td>
<td valign="top" width="10%">
Your right column advert goes here
</td>
</tr>
</table>
EOT;

}
You will have to fine-tune that by adding some CSS properties and finding the values for the column width that matches the desired look, but this should give you the idea.

Attached is the modified file for rokokon. Rename as suggested above.

In the future, try to describe in more detail what you actually want to see accomplished to avoid double effort and misunderstandings.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.