Advanced search  

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]

Pages: [1]   Go Down

Author Topic: I would make a very little and easy modification of coppermine!  (Read 2957 times)

0 Members and 1 Guest are viewing this topic.

foxus777

  • Coppermine newbie
  • Offline Offline
  • Posts: 5

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 !!
« Last Edit: May 23, 2006, 06:38:41 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: I would make a very little and easy modification of coppermine!
« Reply #1 on: May 22, 2006, 07:26:30 am »

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.
Logged

foxus777

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: I would make a very little and easy modification of coppermine!
« Reply #2 on: May 22, 2006, 01:57:40 pm »

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
« Last Edit: May 22, 2006, 02:40:09 pm by foxus777 »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: I would make a very little and easy modification of coppermine!
« Reply #3 on: May 22, 2006, 07:22:08 pm »

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

foxus777

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: I would make a very little and easy modification of coppermine!
« Reply #4 on: May 22, 2006, 10:52:58 pm »

GauGau thanks :)

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

 ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: I would make a very little and easy modification of coppermine!
« Reply #5 on: May 23, 2006, 06:38:18 am »

You have been warned:
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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.