keywords for all files in an album keywords for all files in an album
 

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

keywords for all files in an album

Started by arun, August 24, 2006, 03:03:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arun

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;

Joachim Müller

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 $keywords    = get_post_var('keywords', $pid);and replace with$keywords    = $_POST['common_keywords']." ".get_post_var('keywords', $pid);

Find                </table>
            </td>
        </tr>
(around lines 605-607) and add after it (into a new line)        <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.

Hein Traag

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.