I would make a very little and easy modification of coppermine! I would make a very little and easy modification of coppermine!
 

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

I would make a very little and easy modification of coppermine!

Started by foxus777, May 22, 2006, 12:01:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

foxus777

Hello all  ;)

i would make a little modification of coppermine, really easy i think...

i would add a field in upload picture section (or use one default field), for add an url link !

And after, When you see your thumbnails on your album, i would associate this url link with this thumbnail, and hen you click on the thumbnails, you go on this url (the original link for go on original image will do not exist)..

You understand ?

You can help me, or begin of explain for resolve my query ?

It's really important for me, it's will be the best day of my life if this little modification run :)

best regars and thanks !!

Joachim Müller

not an easy hack. Additional input fields require additional database fields and the code to fill it in the upload / edit forms and additional code to display it as expected on the display pages.
You could use one of the custom fields and label them as you see fit, which will only leave you with the task to edit the code of the display pages to do what you're up to. This requires modifications of the code that creates the links for the thumbnails.

foxus777

Thank you for this fast reply GauGau.

yesterday, i have search during 2 hours the solution, i have 2 way :

1)  i discover the code for link of thumbnails in include/theme.inc.php (in bold) :




Quote$i = 0;
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            if ($aid == 'lastalb') {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            } else {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos=".$lang_picinfo['title']."$uid_link", (i have modified the line after "pos", for try to give the variable of title of current image in url without sucess  :( )
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            }
        } else {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );
        }
        echo template_eval($thumb_cell, $params);

        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }
    }




My simple question is : what is the variable to give, for show the title image field in url ? the title image who is show on bottom of every thumbnails, when hi is available...


2) in include/theme.inc.php :

Quote// HTML template for thumbnails display
$rere3 = "dff";
if (!isset($template_thumbnail_view))  //{THEMES}
$template_thumbnail_view = <<<EOT

<!-- BEGIN header -->
        <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} // here is show the title of the picture, with others pic information : how i can show only the title of image here (the {title} tag don't run )
                                        {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>
<!-- 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;
thanks very much

Joachim Müller

don't edit include/themes.inc.php, under no circumstances. Instead, edit themes/yourtheme/theme.php

foxus777

GauGau thanks :)

i have modified function.inc.php and theme.inc.php and all is alright ,after 3hours of research :(

;)

Joachim Müller

You have been warned:
Quote from: GauGau on May 22, 2006, 07:22:08 PM
don't edit include/themes.inc.php, under no circumstances. Instead, edit themes/yourtheme/theme.php
Everything that can be done in themes.inc.php can be accomplished in theme.php as well. You're making it hard to impossible to upgrade in the future, so you should do as I suggested.