Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Edit picture views plugin for cpg1.5.x  (Read 5285 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Edit picture views plugin for cpg1.5.x
« on: July 02, 2014, 02:37:47 pm »

This plugin allows you to edit the picture views on the editpics.php form, if you are logged in as admin. There's no configuration. Just install the plugin and you can edit the picture views, see attached screenshot.

« Last Edit: January 10, 2015, 07:39:16 pm by Αndré »
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Edit picture views plugin for cpg1.5.x
« Reply #1 on: July 02, 2014, 02:47:06 pm »

Αndré works perfectly. Again many, many thanks :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Edit picture views plugin for cpg1.5.x
« Reply #2 on: July 02, 2014, 02:52:44 pm »

This plugin could be extended so it can also be used on the edit_one_pic.php form. But as you haven't asked for it in your support thread, I haven't implemented it yet.
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Edit picture views plugin for cpg1.5.x
« Reply #3 on: July 02, 2014, 02:54:31 pm »

The multli picture edit is all that I need :)
Logged

lsuarez

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Edit picture views plugin for cpg1.5.x
« Reply #4 on: October 17, 2014, 08:39:47 pm »

I have tried to get this to work. I need to import a lot of pictures from Twitpic, as this service is shutting down on the 25th of October. I want to keep the views the same as they were on Twitpic. Anyway, when I try to upload the plugin via the web uploader, nothing seems to happen. I have installed the unzipped file via ftp. The folder is there. But when I go to the editpics.php, I can't edit the views...

What have I done wrong?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Edit picture views plugin for cpg1.5.x
« Reply #5 on: October 17, 2014, 09:08:55 pm »

Have you actually installed the plugin after you uploaded it to the plugins directory? http://documentation.coppermine-gallery.net/en/plugins.htm#plugin_manager_install
Logged

lsuarez

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Edit picture views plugin for cpg1.5.x
« Reply #6 on: October 18, 2014, 07:17:27 am »

The things that a person can accomplish when actually thinking while doing them... amazing! But seriously, I don't know how I managed to overlook this... Must be my being new to Coppermine. N00bs...  ::)

Thanks for your help and understanding.
Logged

lsuarez

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Edit picture views plugin for cpg1.5.x
« Reply #7 on: December 22, 2014, 12:46:10 pm »

New question: when I upload video files, I don't seem to be able to edit the views. There's just no editable field. How can I do this?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Edit picture views plugin for cpg1.5.x
« Reply #8 on: December 22, 2014, 08:46:42 pm »

I just uploaded a test video to an album with an existing test picture. Unfortunately, the edit pics form doesn't work as expected in that scenario. That's a bug of the plugin. I'll try to fix it as soon as possible.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Edit picture views plugin for cpg1.5.x
« Reply #9 on: December 22, 2014, 09:47:26 pm »

In codebase.php, try to replace the whole function edit_pic_views_page_html with
Code: [Select]
function edit_pic_views_page_html($html) {
    global $lang_editpics_php, $lang_common;

    // we need to replace the HTML code of the video files first
    $replace = '<input type="hidden" name="pid[]" value="'."\\1".'" />';
    $replace .= sprintf($lang_editpics_php['pic_info_str'], '<input type="text" name="pwidth'."\\1".'" value="'."\\2".'" size="5" maxlength="5" class="textinput" />', '<input type="text" name="pheight'."\\1".'" value="'."\\3".'" size="5" maxlength="5" class="textinput" />', "\\4", '<input type="text" name="hits'."\\1".'" value="'."\\5".'" size="8" class="textinput" />', "\\6");
    $html = preg_replace('/<input type="hidden" name="pid\[\]" value="([0-9]+)" \/>[\s]*'.str_replace('%s', '([0-9]+)', str_replace('%s &times; %s', '<input type="text" name="pwidth[0-9]+" value="%s".*\/> &times; <input type="text" name="pheight[0-9]+" value="%s".*\/>', $lang_editpics_php['pic_info_str'])).'[\s]*<\/td>/Ui', $replace, $html);

    // non-movie files
    $replace = '<input type="hidden" name="pid[]" value="'."\\1".'" />';
    $replace .= sprintf($lang_editpics_php['pic_info_str'], "\\2", "\\3", "\\4", '<input type="text" name="hits'."\\1".'" value="'."\\5".'" size="8" class="textinput" />', "\\6");
    $html = preg_replace('/<input type="hidden" name="pid\[\]" value="([0-9]+)" \/>[\s]*'.str_replace('%s', '([0-9]+)', $lang_editpics_php['pic_info_str']).'[\s]*<\/td>/Ui', $replace, $html);

    return $html;
}
Logged

lsuarez

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Edit picture views plugin for cpg1.5.x
« Reply #10 on: December 24, 2014, 09:21:55 am »

Works! Genius!  :D
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Edit picture views plugin for cpg1.5.x
« Reply #11 on: January 10, 2015, 07:40:35 pm »

Added support for video files in version 1.1 (attached to initial post).
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 22 queries.