forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 email => Topic started by: heavensportal 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
-
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?
-
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.
-
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.
-
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
-
Because there aren't appropriate language strings, this is what comes closest to what I had in mind:
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.
-
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?
-
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 (http://forum.coppermine-gallery.net/index.php/topic,77314.0.html) in SVN revision 8816 (version 1.5).
To add the functionality in earlier versions than cpg1.5.40, open addfav.php, find
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
and above, add
// 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.
-
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 (http://forum.coppermine-gallery.net/index.php/topic,77314.0.html) in SVN revision 8816 (version 1.5).
To add the functionality in earlier versions than cpg1.5.40, open addfav.php, find
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
and above, add
// 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.