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.