Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2007, 02:31 AM
New Pligger
 
Join Date: Sep 2006
Posts: 29
Thanks: 6
Thanked 11 Times in 4 Posts
mail: "there is a new comment in your story"

go to story.php, line 30 and change this:

Code:
	if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			insert_comment();
		}
	}
Code:
	if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			$authormail = $db->get_var("SELECT user_email FROM users WHERE `user_id` = '$link->author';");
			mail($authormail,"there is a new comment in your story","hello, bodytext!");
			insert_comment();
		}
	}
so, every time some one write a comment in a story, the system will send the story author an email.
Reply With Quote
The Following 4 Users Say Thank You to inggenia For This Useful Post:
  #2 (permalink)  
Old 03-13-2007, 04:23 AM
Yankidank's Avatar
Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 1,833
Thanks: 110
Thanked 183 Times in 129 Posts
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
This would be really cool if you built in an option for the author to check a box when submitting the story to subscribe to his article's comments. Good idea.
__________________
Need a Pligg Host?
Get 3 free months
when you buy a year of hosting.
Use the coupon PLIGG at either...
MidPhase hosting starting at $7.95/month.
ANhosting hosting starting as low as $4.95/month.
Reply With Quote
  #3 (permalink)  
Old 03-13-2007, 12:50 PM
New Pligger
 
Join Date: Sep 2006
Posts: 29
Thanks: 6
Thanked 11 Times in 4 Posts
you can do that with the "extra fields"
Reply With Quote
  #4 (permalink)  
Old 03-13-2007, 01:00 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
The bad thing with this is that some people might not want to get emails so there has to be a config option in their profile or something so ppl can turn this off.
__________________
I accept donations for my time helping users like you on the forum and IRC.

Last edited by kbeeveer46; 03-13-2007 at 01:31 PM..
Reply With Quote
  #5 (permalink)  
Old 03-13-2007, 10:00 PM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Option for turning it off would be really good idea.
Reply With Quote
  #6 (permalink)  
Old 03-27-2007, 03:50 PM
Casual Pligger
 
Join Date: Jul 2006
Posts: 73
Thanks: 2
Thanked 2 Times in 1 Post
i second that emotion...

perhaps rewritten as a module so that an admin can simply enable and then it will add the field using the other mod that allows mods to add extra fields?
Reply With Quote
  #7 (permalink)  
Old 09-14-2007, 08:49 PM
Casual Pligger
 
Join Date: May 2007
Posts: 87
Thanks: 9
Thanked 1 Time in 1 Post
Anyone implement something like this as a module, or with the ability to turn this feature on and off per user?

I really would love this, but Im not much of a developer.

Thanks in advance

JB
Reply With Quote
  #8 (permalink)  
Old 09-15-2007, 01:42 AM
davemackey's Avatar
Pligg Donor
Pligg Version: 9.9.
Pligg Template: siChunkBlue
 
Join Date: Aug 2007
Location: Langhorne, PA
Posts: 286
Thanks: 33
Thanked 18 Times in 14 Posts
Would be great to see this feature integrated into the main codebase.
Reply With Quote
  #9 (permalink)  
Old 09-15-2007, 03:32 AM
nzbullet's Avatar
Coder
 
Join Date: Jun 2007
Location: New Zealand
Posts: 133
Thanks: 17
Thanked 19 Times in 14 Posts
If this helps

Yankidank, A way to do this, not quite a check box, would be as follows:

1.For the code above, use this code instead If you are looking to change the send announcement module ONLY then skip this step:

Code:
if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			$authormail = $db->get_var("SELECT public_email FROM users WHERE `user_id` = '$link->author';");
			mail($authormail,"there is a new comment in your story","hello, bodytext!");
			insert_comment();
		}
	}
2.Then you need to go to "templates/yget/user_center.tpl" and remove this code from around line 289:

Code:
{if $user_publicemail ne ""}

				<tr>

				<td><strong>{#PLIGG_Visual_User_Profile_PublicEmail#}:</strong></td>

				<td>{$user_publicemail}</td>

				</tr>

				{/if}
This will remove the users public email from the users profile so others cannot see it.

3.Next go to Pligg Beta 9 Home » Admin » Modify Language and filter for "public email" Change this to something like "Email Communication"

4.The last step is Optional, but I recommend you add something here. I have shown below what I added due to the new legal requirements but you could change this to anything you want. Go to "templates/yget/profile_center.tpl" and do the following:

between:
Code:
<br />
Code:
<input type="submit" name="save_profile" value="{#PLIGG_Visual_Profile_Save#}" class="log2" tabindex="16"></p>
add:

Code:
<fieldset><legend>email communication:</legend>

		

<center>As you may know, from September 5th 2007 the Unsolicited Electronic
Messages Act 2007 will regulate the kinds of messages you can be sent by
email or text.
To allow Linka New Zealand Limited to send you occasional emails be sure to fill out the "Email Communication" field on your profile page.
We don't email you all that often but every now and then we may have something important to let you know about. 
By filling out this field you are consenting to Linka New Zealand Limited communicating with you by email. If you do NOT want to receive communications from us please leave this field blank. You can stop receiving emails from Linka New Zealand Limited at anytime by removing your email address from the "Email Communication" field.
</center>
</fieldset>		

<br/>

<br/>
this should then look like this

Code:
<br />

<fieldset><legend>email communication:</legend>

		

<center>As you may know, from September 5th this year the Unsolicited Electronic
Messages Act 2007 will regulate the kinds of messages you can be sent by
email or text.
To allow Linka New Zealand Limited to send you occasional emails be sure to fill out the "Email Communication" field on your profile page.
We don't email you all that often but every now and then we may have something important to let you know about. 
By filling out this field you are consenting to Linka New Zealand Limited communicating with you by email. If you do NOT want to receive communications from us please leave this field blank. You can stop receiving emails from Linka New Zealand Limited at anytime by removing your email address from the "Email Communication" field.
</center>
</fieldset>		

<br/>

<br/>

<input type="submit" name="save_profile" value="{#PLIGG_Visual_Profile_Save#}" class="log2" tabindex="16"></p>

I changed the way the site announcement works so that people could either subscribe to site wide emails or not. It is up to them. It is not auto switched on which is a pain, but.....it does mean that they can opt in if they want to. then when you send an announcement only those people will receive it. I did this due to a law change in NZ which requires the user to agree to receiving emails. It is the only way I could implement it.

To do this once you have completed above go to
"/modules/send_announcement/templates/sendannouncement.tpl"

search for "user_email" and change to "public_email"
__________________
Cheers

Dan

Last edited by nzbullet; 09-15-2007 at 05:53 PM..
Reply With Quote
  #10 (permalink)  
Old 09-19-2007, 01:50 PM
Casual Pligger
 
Join Date: May 2007
Posts: 87
Thanks: 9
Thanked 1 Time in 1 Post
I'd like to simply see the ability to subscribe (and maybe unsubscribe) to a particular post/article, and receive email notifications when comments are posted.

Anyone have a way to add this?
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Special character problems in RSS and mail subject ditto Bug Report 8 04-22-2008 04:28 PM
Having problems sending mail with Pligg? Running Postfix by chance? PolPligg General Help 13 03-14-2008 04:14 PM
Editing a reply to a comment? bbrian017 General Help 0 01-10-2008 04:30 PM
A proposal for a more robust way of comment deletion. sefs Bug Report 0 10-12-2007 04:30 PM
Comment Count Update Simon Bug Report 4 06-01-2007 09:45 PM


Search Engine Friendly URLs by vBSEO 3.2.0