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: keywords for all files in an album  (Read 2458 times)

0 Members and 1 Guest are viewing this topic.

arun

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
keywords for all files in an album
« on: August 24, 2006, 03:03:07 am »

Hi,

here is a quick hack, so that you can add a keyword to all files in an album via the editpics page.
Not sure if this is done in a way that could be used for future versions, support for other languages would need to be added.

cheers
     ARUN

Generated with "diff -u"...

--- editpics.php_old    2006-08-23 17:28:34.000000000 -0700
+++ editpics.php        2006-08-23 17:37:43.000000000 -0700
@@ -104,7 +104,7 @@
                 $aid         = (int)get_post_var('aid', $pid);
                 $title       = get_post_var('title', $pid);
                 $caption     = get_post_var('caption', $pid);
-                $keywords    = get_post_var('keywords', $pid);
+                $keywords    = $_POST['common_keywords']." ".get_post_var('keywords', $pid);
                 $user1       = get_post_var('user1', $pid);
                 $user2       = get_post_var('user2', $pid);
                 $user3       = get_post_var('user3', $pid);
@@ -602,7 +602,18 @@
                             </span>
                         </td>
                     </tr>
+                   <tr>
                 </table>
+                <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-top:5px;padding-bottom:5px">
+               <tr>
+                  <td class="tableb" style="white-space: nowrap;">
+                        Common keywords to all files
+                    </td>
+                    <td width="100%" class="tableb" valign="top">
+                        <input type="text" style="width: 100%" name="common_keywords" maxlength="255" value="" class="textinput" />
+                    </td>
+               </tr>
+               </table>
             </td>
         </tr>
 EOT;
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: keywords for all files in an album
« Reply #1 on: August 24, 2006, 05:37:45 am »

Thanks for your contrib. Windows user are not familiar with diff notation, that's why I converted it to the notation that is common in coppermine:

Edit editpics-php (using a plain-text editor, notepad.exe is fine). Find
Code: [Select]
$keywords    = get_post_var('keywords', $pid);and replace with
Code: [Select]
$keywords    = $_POST['common_keywords']." ".get_post_var('keywords', $pid);
Find
Code: [Select]
                </table>
            </td>
        </tr>
(around lines 605-607) and add after it (into a new line)
Code: [Select]
        <tr>
          <td class="tableb" colspan="3" align="center">
            <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-top:5px;padding-bottom:5px">
              <tr>
                <td class="tableb" style="white-space: nowrap;">
                  Common keywords to all files
                </td>
                <td class="tableb" valign="top">
                  <input type="text" style="width: 100%" name="common_keywords" maxlength="255" value="" class="textinput" />
                </td>
              </tr>
            </table>
          </td>
        </tr>

Save the file, upload it to your server and test.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: keywords for all files in an album
« Reply #2 on: November 10, 2006, 03:33:47 pm »

Modded editpics.php and with good result. It works.

Thanks guys

Cheers!
Hein

p.s. editpics.php with dutch mod attached for the dutch users. Just unpack, backup your existing editpics.php and replace with the one in the zip.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.