Icy Phoenix

     
 


This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post FAP CUSTOMIZATION - PM At New Comment 
 
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  
 



 
AnemiaSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: PM At New Comment 
 
I agree, that would be a great feature!  
 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
I've started to code this once ago... but then I've stopped and dropped it...

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?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
Mighty Gorgon wrote: [View Post]
Or maybe all the users which have this option enabled in their profile?

      xs_arrowu  xs_arrowu  xs_arrowu

 I vote for this one  
 



 
ArtieSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
Mighty Gorgon wrote: [View Post]
I've started to code this once ago... but then I've stopped and dropped it...

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?




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...
 



 
VortexSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
Mighty Gorgon wrote: [View Post]
I've started to code this once ago... but then I've stopped and dropped it...

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?


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.
 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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  

The only thing you need to change is any reference to album_comment should be album_showpage.
 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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

Quote:
Fatal error: Maximum execution time of 30 seconds exceeded in D:InetpubADIDAPwp-contentpluginsfootnotes.php on line 71


can someone post the code for this mod?
 



 
krisbfunkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
um, I did not save it since I had the link

I can try to recreate the steps that were mentioned and put them down.
 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 



 
krisbfunkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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 ...
 




____________
lefty74
www.zoocrew.eu - help us save our wildlife
 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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

Code: [Download] [Hide] [Select]
##############################################################
## 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>&nbsp;&nbsp;
        <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

Code: [Download] [Hide] [Select]
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}


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.
 




____________
lefty74
www.zoocrew.eu - help us save our wildlife
 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
thanks!

definitely going to try this out tonight.
 



 
krisbfunkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: PM At New Comment 
 
Thank you lefty74, for the contribution
 



 
ArtieSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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   all i did was trying to remember where I pasted stuff  
 



 
lefty74Send private message  
Back to topPage bottom
This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies.  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You 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


  

 

  cron