Advanced search  

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

Pages: [1]   Go Down

Author Topic: Email for favorites  (Read 22989 times)

0 Members and 1 Guest are viewing this topic.

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Email for favorites
« on: September 12, 2015, 11:44:13 pm »

I think this has been asked of in prior versions but can't find it, sorry.

I have been asked by many members if there is a way to get notified when they chose an image as favorite:

1. To be able to get a notification that it was successfully added to their favorites vs just sending them back to home page

2. To be able to choose a favorite artist not just image and get email notification when that artist has a new upload

I told them I would ask you.

Thank you in advance
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email for favorites
« Reply #1 on: September 14, 2015, 10:17:50 am »

1. To be able to get a notification that it was successfully added to their favorites vs just sending them back to home page
Intended behavior is, that they'll stay on the same page. This bug has already been fixed in our SVN repository. Do you still need/want to send email when adding a favorite?


2. To be able to choose a favorite artist not just image and get email notification when that artist has a new upload
How do you choose a favorite artist? Automatically, basing on the pictures you have currently added to your favorites?
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Re: Email for favorites
« Reply #2 on: September 14, 2015, 12:27:44 pm »

Intended behavior is, that they'll stay on the same page. This bug has already been fixed in our SVN repository. Do you still need/want to send email when adding a favorite?

How do you choose a favorite artist? Automatically, basing on the pictures you have currently added to your favorites?

If there could be an email to the artist (member) that they have been added as a favorite by someone then that would be great---I am sure it is something that a lot of users would like.

If not then at least a message stack that says the image was successfully added to favorites wold be great.

Well the way that the favorites right now are chosen is on a per image basis, as you already know. To add an artist/member to favorites would be great and that is done by maybe a click on the member name then a drop list for add to favorites or is it called a contextual menu like when you right click something on the computer.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email for favorites
« Reply #3 on: September 15, 2015, 10:06:57 am »

Summary:
  • Add message that picture was successfully added to/removed from favorites
  • Add artists to favorites
  • Send email to artist when he has been added to someones favorites
  • Send email to users if artist uploads new pictures

Honestly, there's some effort needed to complete all features. I'll have a look if I can solve the first point soon. I doubt I'll have enough spare time to finish the rest.

Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Email for favorites
« Reply #4 on: September 15, 2015, 10:22:48 am »

It is nothing that needs to be done all at once or immediately.

Those I guess could be a wish list?

But I really would like to have the confirmation of the favorite image being added to their "My Favorites". area
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email for favorites
« Reply #5 on: September 15, 2015, 05:17:56 pm »

Because there aren't appropriate language strings, this is what comes closest to what I had in mind:
Code: [Select]
Index: addfav.php
===================================================================
--- addfav.php (revision 8813)
+++ addfav.php (working copy)
@@ -17,6 +17,7 @@
 
 define('IN_COPPERMINE', true);
 define('RATEPIC_PHP', true);
+define('DISPLAYIMAGE_PHP', true);
 
 require('include/init.inc.php');
 
@@ -39,9 +40,13 @@
 // See if this picture is already present in the array
 if (!in_array($pid, $FAVPICS)) {
     $FAVPICS[] = $pid;
+    $message_id = cpgStoreTempMessage($lang_picinfo['addFav']);
+    $message_icon = 'success';
 } else {
     $key = array_search($pid, $FAVPICS);
     unset($FAVPICS[$key]);
+    $message_id = cpgStoreTempMessage($lang_picinfo['remFav']);
+    $message_icon = 'info';
 }
 
 // Adjust redirect for "My Favorites" meta album
@@ -99,6 +104,10 @@
     }
 }
 
+$ref = preg_replace('/#.*/', '', $ref);
+$ref .= strpos($ref, '?') ? '&' : '?';
+$ref .= 'message_id='.$message_id.'&message_icon='.$message_icon.'#cpgMessageBlock';
+
 $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
 header($header_location . $ref);
 pageheader($lang_common['information'], "<meta http-equiv=\"refresh\" content=\"1;url=$ref\">");

Of course you could hard-code appropriate language strings, but I think I'll add a new plugin hook and create a plugin which implements the feature properly.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Email for favorites
« Reply #6 on: September 15, 2015, 09:25:51 pm »

This -- as you always do-- should work until you hook it into the next update. Thank you

Do I add it to a file or create a new .php for it in root?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email for favorites
« Reply #7 on: September 16, 2015, 12:20:17 pm »

Added hidden feature to display confirmation message when adding/removing pictures to/from favorites in SVN revision 8815 (will be part of cpg1.5.40).
Updated hidden features plugin in SVN revision 8816 (version 1.5).

To add the functionality in earlier versions than cpg1.5.40, open addfav.php, find
Code: [Select]
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';and above, add
Code: [Select]
// Prepare message
if (function_exists('hidden_features_page_start')) {
    if (in_array($pid, $FAVPICS)) {
        $message_id = cpgStoreTempMessage($lang_plugin_hidden_features['fav_added']);
        $message_icon = 'success';
    } else {
        $message_id = cpgStoreTempMessage($lang_plugin_hidden_features['fav_removed']);
        $message_icon = 'info';
    }
    $ref .= strpos($ref, '?') !== FALSE ? '&' : '?';
    $ref .= 'message_id='.$message_id.'&message_icon='.$message_icon.'#cpgMessageBlock';
}

Additionally, you have to install version 1.5 or higher of the hidden features plugin.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Re: Email for favorites
« Reply #8 on: September 16, 2015, 10:37:43 pm »

Added hidden feature to display confirmation message when adding/removing pictures to/from favorites in SVN revision 8815 (will be part of cpg1.5.40).
Updated hidden features plugin in SVN revision 8816 (version 1.5).

To add the functionality in earlier versions than cpg1.5.40, open addfav.php, find
Code: [Select]
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';and above, add
Code: [Select]
// Prepare message
if (function_exists('hidden_features_page_start')) {
    if (in_array($pid, $FAVPICS)) {
        $message_id = cpgStoreTempMessage($lang_plugin_hidden_features['fav_added']);
        $message_icon = 'success';
    } else {
        $message_id = cpgStoreTempMessage($lang_plugin_hidden_features['fav_removed']);
        $message_icon = 'info';
    }
    $ref .= strpos($ref, '?') !== FALSE ? '&' : '?';
    $ref .= 'message_id='.$message_id.'&message_icon='.$message_icon.'#cpgMessageBlock';
}

Additionally, you have to install version 1.5 or higher of the hidden features plugin.

OK have added the code then added the plugin and YAY!!  It shows a notification bar that it was successfully added to favorites  when it pops back to the front page after adding it.

Thank you so very much. And as I said the others are a wish for if/when possible.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.