I am using the Profile Comments mod, which I love, but I am finding that often people post comments on each other's profiles and people don't realise!
I guess my users are used to Facebook! But is there a way to notify people than a comment has been made on their profile??
Thanks
Lainaus käyttäjältä: jackregan - joulukuu 27, 2007, 10:49:51 AP
I am using the Profile Comments mod, which I love, but I am finding that often people post comments on each other's profiles and people don't realise!
I guess my users are used to Facebook! But is there a way to notify people than a comment has been made on their profile??
Thanks
I think it would be best if you requested this at smfhacks.com. :) Where the mod was created.
I like your thinking though.
A logical request.
I'm sure it will be well received.
I have actually spent a lot of the day messing with the profile comments mod and I have made it so that you can click links in each post to: return the comment to the sender, view the sender's gallery photos and send a PM.
I would also love to display the avatar and group stars of each member.
I might sniff around SMF-hacks as you all say.
I am thinking about it heh. I keep all the good changes for my forums. I have it right now to a pm to the user when they get a comment.
Thats so cruel and cool :P
But I think I can do something like this, like send a Mail, or send a PM.
lol vb.
Well, the good news is that I have figured it out and ironed out a bug as well.
PLEASE READ THE WHOLE OF THIS BEFORE YOU DO ANYTHINGThe official thread on the mod says that you open sources/Profilecomments.php and find this
Lainaa
function Add2()
{
global $db_prefix, $ID_MEMBER, $sources;
//Guests can't do this stuff
is_not_guest();
isAllowedTo('pcomments_add');
@$subject = htmlspecialchars($_POST['subject'],ENT_NOQUOTES);
@$comment = htmlspecialchars($_POST['comment'],ENT_NOQUOTES);
@$userid = (int) $_POST['userid'];
//if($subject == '')
// fatal_error('You need to enter a comment subject.');
if($comment == '')
fatal_error('You need to enter a comment.');
if($userid == '')
fatal_error('No profile selected.');
$commentdate = time();
$request = db_query("INSERT INTO {$db_prefix}profile_comments
(ID_MEMBER, comment, subject, date, COMMENT_MEMBER_ID)
VALUES ($ID_MEMBER,'$comment','$subject', $commentdate,$userid)", __FILE__, __LINE__);
...and then it says that after that you add this:
Lainaa
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
$subject = 'You have a new profile comment';
$message = 'This is an automated alert that you have a new comment on your profile!';
return sendpm(array('to' => array($_POST['userid']), 'bcc' => array()), $subject, $message);
Doing that puts this new code just above the part of the add2 function which redirects you back to the person's profile afterwards.
The problem is though that the redirect doesn't work with this code. It just takes you to a blank page whcih is just your index.template.php and nothing else, so I have tweaked it a bit and this works for me:
Firstly, in that new code you just added in, remove the word 'return' on the last line, so the new code now becomes:
Lainaa
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
$subject = 'You have a new profile comment';
$message = 'This is an automated alert that you have a new comment on your profile!';
sendpm(array('to' => array($_POST['userid']), 'bcc' => array()), $subject, $message);
...and that seems to work just fine. It sends a PM to the person whose profile you have just commented and if they have the option enabled, it also E-mails them to notify them of the PM.
It then takes you back to their profile!
N.B. I also changed the subject and the content of the message it sends too, which is simple enough to do.
Next, I need to figure out putting avatars and user stars in comments people leave...
Woo hoo! Works perfectly. Thanks for that :D
this is awsome!
but i can see how pesky pms could get aftera few dozen comments.... you know how people love their comments :P
Man, good stuff!! Thank you!
if someone can add a tick box in the profile settings so they can turn on or off the notifications for the comment PMs ... would be the best!