Edit picture views plugin for cpg1.5.x Edit picture views plugin for cpg1.5.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Edit picture views plugin for cpg1.5.x

Started by Αndré, July 02, 2014, 02:37:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

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.


casp3r

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

Αndré

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.

casp3r

The multli picture edit is all that I need :)

lsuarez

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?

Αndré


lsuarez

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.

lsuarez

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?

Αndré

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.

Αndré

In codebase.php, try to replace the whole function edit_pic_views_page_html with
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;
}

lsuarez


Αndré

Added support for video files in version 1.1 (attached to initial post).

Αndré

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

Bkangel1505

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

Αndré

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

Johnfromhere

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.

Johnfromhere

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

I will post my question under 1.6 subjects.

Again, apologies.

Cheers.

John