Hi ,
is there a way to get a PM for a new comment on a picture ? so that every user how has upload a pic in my album become a PM for every Comment that another user have post for this picture ?! :|
that would be so great :roll:
FAP CUSTOMIZATION - PM At New Comment
Subject: Re: PM At New Comment
I've started to code this once ago... but then I've stopped and dropped it... :roll:
The reason was because I didn't find a good solution for who should be the recipient of the notification... the pics author, who posted a comment for the pics or both? Or maybe all the users which have this option enabled in their profile?
The reason was because I didn't find a good solution for who should be the recipient of the notification... the pics author, who posted a comment for the pics or both? Or maybe all the users which have this option enabled in their profile?
Subject: Re: PM At New Comment
I think it could be fine to do like for normal posting in forums: You can choose whether to subscribe that picture (topic) or not...
Mighty Gorgon wrote: [View Post]
I think it could be fine to do like for normal posting in forums: You can choose whether to subscribe that picture (topic) or not...
Subject: Re: PM At New Comment
If possible, I would recommend, the pics author ought to get a msg by default (unless they unticked the button) but also users which have this option enabled for that pic.
(like in watching a topic).
For me, it does not have to be a PM, an email would be great too but there may not be a difference with regard to coding difficulties.
I found this when looking googling around, installed it on my test board but it didn't work. Have not had a chance to look at it closely why not...
but maybe thought it could give an idea or base.
Mighty Gorgon wrote: [View Post]
If possible, I would recommend, the pics author ought to get a msg by default (unless they unticked the button) but also users which have this option enabled for that pic.
(like in watching a topic).
For me, it does not have to be a PM, an email would be great too but there may not be a difference with regard to coding difficulties.
I found this when looking googling around, installed it on my test board but it didn't work. Have not had a chance to look at it closely why not...
but maybe thought it could give an idea or base.
Subject: Re: PM At New Comment
Just for info and maybe interim solution.
The mod that I found in the above post does work, i just forgot to insert the sql :roll:
The only thing you need to change is any reference to album_comment should be album_showpage. :)
The mod that I found in the above post does work, i just forgot to insert the sql :roll:
The only thing you need to change is any reference to album_comment should be album_showpage. :)
Subject: Re: PM At New Comment
i think this is a great mod, i also found it on smartor's site but it points to the same dead link
I get
can someone post the code for this mod?
I get
Quote:
can someone post the code for this mod?
Subject: Re: PM At New Comment
um, I did not save it since I had the link :roll:
I can try to recreate the steps that were mentioned and put them down.
I can try to recreate the steps that were mentioned and put them down.
Subject: Re: PM At New Comment
if you have the time that would be cool, otherwise, i can try to contact the mod author or wait for a reply on smartor's site. no hurry, perhaps the site is just down at the moment as it's just a time-out error.
Subject: Re: PM At New Comment
i might do it anyway. in case i want to uninstall it and the site is no longer there i would rather have something available ...
Subject: Re: PM At New Comment
I used MOD-Studio for the first time, not bad at all to make it look pretty plus it saves time :)
Then create a file called comment_notify.tpl
and paste this in it
and save it in language/lang_english/email.
You may wish to include this in the corresponding admin pages too so that an admin can change the settings of users (if necessary) as well rather than going directly into the DB.
NOTE: Please make a backup first in case I missed a line.
##############################################################
## MOD Title: Email notification when comments on pic
## MOD Author: adidap < invalid@invalid.invalid > (Not given) http://invalid.invalid/
## MOD Description: This will notify the poster of an image if a comment has been posted on his picture. Option to turn it off via the profile.
## MOD Version: 0.0.0
##
## Installation Level: Easy
## Installation Time: 11 minutes
## Files To Edit: includes/usercp_register.php
## language/lang_english/lang_main.php
## album_showpage.php
## templates/subSilver/profile_add_body.tpl
## Included Files:
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
## Generator: Phpbb.ModTeam.Tools
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: http://www.adidap.com/projects/email-notification-on-comments-for-smartor-album/
##
## Above link was not working so in order for others to use it I recreated the steps and made it work for FAP as well
##############################################################
## MOD History:
##
## 2007-01-28 - Version 0.0.0
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users ADD user_notify_co TINYINT(1) DEFAULT '1';
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifyco = ( isset($HTTP_POST_VARS['notifyco']) ) ? ( ($HTTP_POST_VARS['notifyco']) ? TRUE : 0 ) : TRUE;
#
#-----[ FIND ]------------------------------------------
#
SET " . $username_sql
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm = $notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_notify_co = $notifyco
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_notify_co
#
#-----[ FIND ]------------------------------------------
#
VALUES ($user_id, '" . str_replace("'", "''", $username)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $notifyco
#
#-----[ FIND ]------------------------------------------
#
$notifypm = $userdata['user_notify_pm'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifyco = $userdata['user_notify_co'];
#
#-----[ FIND ]------------------------------------------
#
display_avatar_gallery($mode
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $notifyco
#
#-----[ FIND ]------------------------------------------
#
'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'NOTIFY_CO_YES' => ( $notifyco ) ? 'checked="checked"' : '',
'NOTIFY_CO_NO' => ( !$notifyco ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_NOTIFY_ON_COMMENT' => $lang['Notify_on_Comment'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Notify_on_privmsg'] =
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Notify_on_Comment'] = 'Notify on new Comment of own Pictures';
#
#-----[ OPEN ]------------------------------------------
#
album_showpage.php
#
#-----[ FIND ]------------------------------------------
#
// --------------------------------
// Complete... now send a message to user
// --------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//email the user who received a new comment
$pic = "SELECT * FROM ". ALBUM_TABLE ." WHERE pic_id = $pic_id";
$script_name = preg_replace('/^/?(.*?)/?$/', "1", trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/album_showpage.'.$phpEx : 'album_showpage.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
if ( !($result = $db->sql_query($pic)) )
{
$error = TRUE;
$error_msg = "error";
}
$pic_data = $db->sql_fetchrow($result);
$picuserid = $pic_data['pic_user_id'];
$to = "SELECT * FROM ". USERS_TABLE ." WHERE user_id = '$picuserid'";
if ( !($result = $db->sql_query($to)) )
{
$error = TRUE;
$error_msg = "error";
}
$to_data = $db->sql_fetchrow($result);
if (($comment_user_id != $picuserid) && ($to_data['user_notify_co']))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->use_template('comment_notify');
$emailer->email_address($to_data['user_email']);
$emailer->assign_vars(array(
'USERNAME' => $to_data['username'],
'C_NAME' => $comment_username,
'PIC_TITLE' => $pic_data['pic_title'],
'Comment_TEXT' => $comment_text,
'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "n", "-- n" . $board_config['board_email_sig']) : '',
'U_Comment' => $server_protocol . $server_name . $server_port . $script_name . '?pic_id='. $pic_id)
);
$emailer->send();
$emailer->reset();
}
//email the user who received a new comment
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_PRIVMSG}:</span></td>
<td class="row2">
<input type="radio" name="notifypm" value="1" {NOTIFY_PM_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="notifypm" value="0" {NOTIFY_PM_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_COMMENT}:</span></td>
<td class="row2">
<input type="radio" name="notifyco" value="1" {NOTIFY_CO_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="notifyco" value="0" {NOTIFY_CO_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
## MOD Title: Email notification when comments on pic
## MOD Author: adidap < invalid@invalid.invalid > (Not given) http://invalid.invalid/
## MOD Description: This will notify the poster of an image if a comment has been posted on his picture. Option to turn it off via the profile.
## MOD Version: 0.0.0
##
## Installation Level: Easy
## Installation Time: 11 minutes
## Files To Edit: includes/usercp_register.php
## language/lang_english/lang_main.php
## album_showpage.php
## templates/subSilver/profile_add_body.tpl
## Included Files:
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
## Generator: Phpbb.ModTeam.Tools
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: http://www.adidap.com/projects/email-notification-on-comments-for-smartor-album/
##
## Above link was not working so in order for others to use it I recreated the steps and made it work for FAP as well
##############################################################
## MOD History:
##
## 2007-01-28 - Version 0.0.0
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users ADD user_notify_co TINYINT(1) DEFAULT '1';
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifyco = ( isset($HTTP_POST_VARS['notifyco']) ) ? ( ($HTTP_POST_VARS['notifyco']) ? TRUE : 0 ) : TRUE;
#
#-----[ FIND ]------------------------------------------
#
SET " . $username_sql
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm = $notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_notify_co = $notifyco
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_notify_pm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_notify_co
#
#-----[ FIND ]------------------------------------------
#
VALUES ($user_id, '" . str_replace("'", "''", $username)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $notifyco
#
#-----[ FIND ]------------------------------------------
#
$notifypm = $userdata['user_notify_pm'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$notifyco = $userdata['user_notify_co'];
#
#-----[ FIND ]------------------------------------------
#
display_avatar_gallery($mode
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$notifypm
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $notifyco
#
#-----[ FIND ]------------------------------------------
#
'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'NOTIFY_CO_YES' => ( $notifyco ) ? 'checked="checked"' : '',
'NOTIFY_CO_NO' => ( !$notifyco ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_NOTIFY_ON_COMMENT' => $lang['Notify_on_Comment'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Notify_on_privmsg'] =
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Notify_on_Comment'] = 'Notify on new Comment of own Pictures';
#
#-----[ OPEN ]------------------------------------------
#
album_showpage.php
#
#-----[ FIND ]------------------------------------------
#
// --------------------------------
// Complete... now send a message to user
// --------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//email the user who received a new comment
$pic = "SELECT * FROM ". ALBUM_TABLE ." WHERE pic_id = $pic_id";
$script_name = preg_replace('/^/?(.*?)/?$/', "1", trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/album_showpage.'.$phpEx : 'album_showpage.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
if ( !($result = $db->sql_query($pic)) )
{
$error = TRUE;
$error_msg = "error";
}
$pic_data = $db->sql_fetchrow($result);
$picuserid = $pic_data['pic_user_id'];
$to = "SELECT * FROM ". USERS_TABLE ." WHERE user_id = '$picuserid'";
if ( !($result = $db->sql_query($to)) )
{
$error = TRUE;
$error_msg = "error";
}
$to_data = $db->sql_fetchrow($result);
if (($comment_user_id != $picuserid) && ($to_data['user_notify_co']))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->use_template('comment_notify');
$emailer->email_address($to_data['user_email']);
$emailer->assign_vars(array(
'USERNAME' => $to_data['username'],
'C_NAME' => $comment_username,
'PIC_TITLE' => $pic_data['pic_title'],
'Comment_TEXT' => $comment_text,
'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "n", "-- n" . $board_config['board_email_sig']) : '',
'U_Comment' => $server_protocol . $server_name . $server_port . $script_name . '?pic_id='. $pic_id)
);
$emailer->send();
$emailer->reset();
}
//email the user who received a new comment
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_PRIVMSG}:</span></td>
<td class="row2">
<input type="radio" name="notifypm" value="1" {NOTIFY_PM_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="notifypm" value="0" {NOTIFY_PM_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_COMMENT}:</span></td>
<td class="row2">
<input type="radio" name="notifyco" value="1" {NOTIFY_CO_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="notifyco" value="0" {NOTIFY_CO_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Then create a file called comment_notify.tpl
and paste this in it
Subject: New Comment on your picture: {PIC_TITLE}
Charset: iso-8859-1
Hello {USERNAME},
{C_NAME} has entered the following comment on your picture "{PIC_TITLE}".
--------------------------------------------------
{Comment_TEXT}
--------------------------------------------------
You can view the new comment by clicking on the following link:
{U_Comment}
{EMAIL_SIG}
Charset: iso-8859-1
Hello {USERNAME},
{C_NAME} has entered the following comment on your picture "{PIC_TITLE}".
--------------------------------------------------
{Comment_TEXT}
--------------------------------------------------
You can view the new comment by clicking on the following link:
{U_Comment}
{EMAIL_SIG}
and save it in language/lang_english/email.
You may wish to include this in the corresponding admin pages too so that an admin can change the settings of users (if necessary) as well rather than going directly into the DB.
NOTE: Please make a backup first in case I missed a line.
Subject: Re: PM At New Comment
no problem, but the credit goes to the guy whose line seems to be on the limp at the moment :mrgreen: all i did was trying to remember where I pasted stuff :LOL:
Page 1 of 2
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.2158s (PHP: 11% SQL: 89%)
SQL queries: 13 - Debug Off - GZIP Enabled