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: Edit picture views plugin for cpg1.5.x  (Read 18660 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
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: November 06, 2018, 09:40:20 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: 15764
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: 15764
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: 15764
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: 15764
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: 15764
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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Edit picture views plugin for cpg1.5.x
« Reply #12 on: November 06, 2018, 09:40:39 pm »

Version 1.2 (attached to initial post) fixes a possible permission issue.
Logged

Bkangel1505

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Edit picture views plugin for cpg1.5.x
« Reply #13 on: May 20, 2019, 06:47:01 pm »

This plugin seems to no longer work for me. Is there a fix?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Edit picture views plugin for cpg1.5.x
« Reply #14 on: May 21, 2019, 03:11:36 pm »

Works for me as expected with cpg1.5.48. What exactly doesn't work for you?
Logged

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: Edit picture views plugin for cpg1.5.x
« Reply #15 on: July 03, 2020, 10:23:24 am »

Didn't know whether to post this under Plugins for 1.5 or 1.6 but here goes.

Can you tell me if it works under 1.6 please, André.

Many thanks.

John.
Logged

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: Edit picture views plugin for cpg1.5.x
« Reply #16 on: July 04, 2020, 10:09:15 am »

Sorry.  I have just noticed that the thread was marked 'completed'.

I will post my question under 1.6 subjects.

Again, apologies.

Cheers.

John
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 21 queries.