Editing displayimage.php Editing displayimage.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

Editing displayimage.php

Started by rocks, June 06, 2008, 03:03:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rocks

Hi!
I Need to modify the displayimage.php file to display the image in the left side instead of center & display the 'File information' next to the image.
   But I do not get,from where the image is called.Please tell me which file to edit.


steveeh131047

Rocks,

Try not to edit core cpg files like displayimage.php unless it's absolutely necessary.

Take a look in themes/sample/theme.php for the code around
Quote// HTML template for intermediate image display
That should enable you to shift the tables containing the intermediate image. Remember, you copy the code you need to modify from themes/sample/theme.php into themes/mytheme/them.php.

You may need to do something different to move the "File information". Look towards the end of themes/sample/theme.php (around line 1924 in my text editor) and you'll see that the File Info table is defined as a "Div". You may be able to do something with CSS positioning of this Div, unless it's already wrapped up in another table.

Hope that helps some.

Steve

steveeh131047

Rocks,

Some more info which may be relevant. I'm not really sure quite what layout you're trying to achieve, but if it is to put the Intermediate image and its containing boxes to the left of the screen, rather than just put the image to the left of its box, you'll need to do something slightly different.

In themes/sample/theme.php find the function definition for "function theme_display_image". Where this function calls up the function starttable() to output the navigation bar and the image, change the function call to something like starttableleft(). For example:

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

    starttable();
    echo $picture;
    endtable();


becomes:

    starttableleft();
    echo $nav_menu;
    endtable();

    starttableleft();
    echo $picture;
    endtable();


Then copy the themes/sample/theme.php version of starttable() to themes/yourtheme/theme.php, rename it to starttableleft(), and change the alignement to "left" like this:

function starttableleft($width = '-1', $title = '', $title_colspan = '1')
{
    global $CONFIG;

    if ($width == '-1') $width = $CONFIG['picture_table_width'];
    if ($width == '100%') $width = $CONFIG['main_table_width'];
    echo <<<EOT

<!-- Start standard table -->
<table align="left" width="$width" cellspacing="1" cellpadding="0" class="maintable">

EOT;
    if ($title) {
        echo <<<EOT
        <tr>
                <td class="tableh1" colspan="$title_colspan">$title</td>
        </tr>

EOT;
    }
}


Once the Intermediate image is moved to the left, the Information panel seems to automatically float to the right of the image. I haven't checked this extensively, so I'm not sure how robust it is. But this is the way to go about it, rather than hacking core CPG files.

Steve

dwo

The displayimage and surrounding is edited in the functions you copy to theme.php


//start editing picture display
// HTML template for intermediate image display
if (!isset($template_display_media)) { //{THEMES}

Here, edit the <table> tag before {image}  accordingly.


and:

//start editing picture display II order items
if (!function_exists('theme_display_image')) {  //{THEMES}







rocks

Steve/dwo,

Thank you very much for your detailed  reply.It has helped a lot.

I tried the solution given by you to display the image to the left in the table,by adding the function in the themes/mytheme/theme.php file.This worked perfectly fine.
Actually now I want to display the "File Information" in the same table,where the image is displayed,instead of a totally separate table below.
Any help would be highly appreciated.



   

steveeh131047

Rocks,

It's quite difficult giving you precise instructions without understanding exactly the layout you want.

The best guidance I can give is to look at:

Quotefunction theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
to set the overall table structure and positioning for the various elements. In here, for example, you could place the picture information into the same table as the image.

Quote// HTML template for intermediate image display
$template_display_media

// HTML template for the image navigation bar
$template_img_navbar

// HTML template for the image rating box
$template_image_rating

etc etc
to detail the various elements.

You might also want to take a look at
Quotefunction theme_html_picinfo(&$info)
for the detailed structure of the Information block.

Steve