Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #61 (permalink)  
Old 06-18-2008, 02:49 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 914
Thanks: 169
Thanked 17 Times in 17 Posts
I never did get this to work!
Reply With Quote
  #62 (permalink)  
Old 06-18-2008, 03:25 PM
redwine's Avatar
Pligg Donor
Pligg Version: 9.8
Pligg Template: custom templat
 
Join Date: Jul 2007
Location: Canada
Posts: 216
Thanks: 20
Thanked 102 Times in 65 Posts
Weird

Quote:
Originally Posted by bbrian017 View Post
I never did get this to work!
It's really weird. I worked on your files and sent them back to you. Every other user tried it worked fine for them. Have you implemented the files I sent you? Otherwise, have you screwed something else while you were trying? I noticed from all your posts that nothing works with or for you!!
Reply With Quote
The Following User Says Thank You to redwine For This Useful Post:
  #63 (permalink)  
Old 06-20-2008, 08:06 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 914
Thanks: 169
Thanked 17 Times in 17 Posts
Quote:
Originally Posted by redwine View Post
It's really weird. I worked on your files and sent them back to you. Every other user tried it worked fine for them. Have you implemented the files I sent you? Otherwise, have you screwed something else while you were trying? I noticed from all your posts that nothing works with or for you!!
haha this is pretty funny... seems I do have issues with a lot of mods and like all those issues it's most likely the same thing here!

I bet it's something I didn't do right!

Thanks for all the help on this too redwine! It's very nice of you!
Reply With Quote
  #64 (permalink)  
Old 07-20-2008, 08:17 AM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
Thanks: 25
Thanked 18 Times in 11 Posts
I've noticed recently that notifications of replies to comments are empty in the email.

Main comments look like this:

Quote:
The following user 'username' commented on your post 'post name'

'comment content'

Here is the link to the story: url
But replies to comments look like this:

Quote:
The following user 'username' commented on your post 'post name'

' (just an opening quote)

Here is the link to the story: url
Is there an easy fix?
Reply With Quote
  #65 (permalink)  
Old 07-20-2008, 09:02 PM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
Thanks: 25
Thanked 18 Times in 11 Posts
I seem to have hacked together a fix for the "empty replies to comments" problem above, but I hope redwine or somebody else could double check this for me.

Open story.php and locate:

Code:
$authormail = $db->get_var("SELECT user_email FROM " .table_users ." WHERE user_id = $link->author;");
Copy and paste the following below that line:

Code:
if($_POST['comment_content'] != '') {
	$comment_content = $_POST['comment_content'];
}
else
{
	$this_comment_id = $_POST['comment_parent_id'];
	$reply_to_the_comment = 'reply_comment_content-' . $this_comment_id;
	$comment_content = $_POST[$reply_to_the_comment];
}
Then go to the line beginning with

Code:
$message = "The following user '". $current_user->user_login . "' commented on your post '"
and change

Code:
$_POST['comment_content']
to

Code:
$comment_content
Save and upload story.php, and cross your fingers.
Reply With Quote
  #66 (permalink)  
Old 07-21-2008, 11:04 AM
Casual Pligger
Pligg Version: 9.8
Pligg Template: yellow
 
Join Date: Dec 2007
Posts: 40
Thanks: 0
Thanked 1 Time in 1 Post
Please Fix what i am doing wrong

when a new comment is made by the user i am able to sent email to the user who submitted the story but i am not able to provide him with link on which user commented .any body help me
Reply With Quote
  #67 (permalink)  
Old 07-21-2008, 01:17 PM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
Thanks: 25
Thanked 18 Times in 11 Posts
Quote:
Originally Posted by valipe View Post
when a new comment is made by the user i am able to sent email to the user who submitted the story but i am not able to provide him with link on which user commented .any body help me
See the last step of redwine's post on page 3 of this thread. He modified it to include a link.
Reply With Quote
  #68 (permalink)  
Old 07-21-2008, 03:34 PM
Casual Pligger
Pligg Version: 9.8
Pligg Template: yellow
 
Join Date: Dec 2007
Posts: 40
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by longcountdown View Post
See the last step of redwine's post on page 3 of this thread. He modified it to include a link.
Thank you very much for the help ......reply was very quick .Thanks once again
Reply With Quote
  #69 (permalink)  
Old 07-23-2008, 12:20 PM
Casual Pligger
 
Join Date: Jun 2008
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Question

Quote:
Originally Posted by redwine View Post
Thanks to inggenia for the idea.

I came up with a fix for providing the user with an option to subscribe or not to a certain news/story that he or she posts. The user can always turn off/on this option by clicking on the “admin links” within the story post and then clicking on “Edit the title or description.”. I tested it thoroughly and it works with no problems.
Start by adding a new column to the links table in your database. This is needed to mark the stories that the user wants to receive emails whenever a comment is added to the story. It is “0” by default, meaning that this option was not selected. If selected, the value would be “1”.
Code:
 
ALTER TABLE `pligg_links` ADD COLUMN `link_subscribe` TINYINT( 1 ) NULL DEFAULT '0';
Open “/libs/lang.conf” and add the following under “SUBMIT - STEP 2” section:

Code:
 
//<SECTION>SUBMIT - STEP 2</SECTION><ADDED>0.5</ADDED>
PLIGG_Visual_Submit2Subscribe_To = "Check this option if you want to receive emails whenever other users comment on your story."
Save and close.
Open “submit_step_2.tpl” in your template folder and add the following right before the “{checkActionsTpl location="submit_step_2_pre_extrafields"}” line:
Code:
 
<br />
<label for"subscribeto"><input type="checkbox" name="subscribeto" id="subscribeto"> {#PLIGG_Visual_Submit2Subscribe_To#}</label><br/>
Save and close.
Open “submit_step_3.tpl” in your template folder and search for “$linkres->category=” and place the following in the same section:
Code:
$linkres->subscribe=$_POST['subscribeto']; 

Search for “$main_smarty->assign('submit_content” and add the following to the same section:
Code:
$main_smarty->assign('submit_subscribe', $linkres->subscribe); 
 
Save and close.
Now we have to provide an option to turn on and off this option. To do so, we modify the “editlink_edit_center.tpl” in your template folder by adding a checkbox like we did in the “submit_step_2.tpl”. However, we have to check the database for the value of the link_subscribe to set the checkbox as CHECKED or not. Remember that the author of the story can edit/modify the story by clicking on the “admin links” within the story post and then clicking on “Edit the title or description.”.
Open “editlink_edit_center.tpl” in your template folder and add the following anywhere you want before the submit button:
Notice the conditions (in red) to accurately set the checkbox state.
Code:
 
<br />            
<label for"subscribeto">{if $submit_subscribe eq 1}<input type="checkbox" name="subscribeto" id="subscribeto" CHECKED> {else} <input type="checkbox" name="subscribeto" id="subscribeto">{/if}{#PLIGG_Visual_Submit2Subscribe_To#}</label>
<br/><br/>
Save and close.
Now, we have to edit the “/libs/link.php” file to accommodate the new changes we have made.
Open “/libs/link.php” and add the following code:
In the “class link {“ section.
Add:
Code:
var $subscribe = 0; 

Right after the global declaration in the store() function, add:
Code:
if(isset($_POST['subscribeto'])){
$this->subscribe = "1";
}
 
Within the same store() function:
anywhere before the “$sql = "UPDATE " line add:
Code:
$link_subscribe = $db->escape($this->subscribe); 

Add the following to the “$sql = "UPDATE " line right before the “WHERE” condition:
Code:
, link_subscribe='$link_subscribe'
 
Look for “if($link) {“ section and add:

Code:
$this->subscribe = $link->link_subscribe; 

Look for the “function fill_smarty” section and add the following (make sure not to add it within an IF statement:
Code:
$smarty->assign('subscribe', $this->subscribe); 

Save and close.
Now open the “editlink.php” and look for “$edit = false;” then go down few lines and add the following after the “$linkres->read();”:
Code:
$link_subscribe=$linkres->subscribe; 

Go down few more lines to where the “$main_smarty->assign” begin and add:
Code:
$main_smarty->assign('submit_subscribe', $link_subscribe); 

Save and close.

Now the last step is to add the code to send the email if the option is selected.

Open “story.php”

Change this:

Code:
if(isset($_POST['process'])){
         if ($_POST['process']=='newcomment') {
                     insert_comment();
         }
}
 
Change it to:

Code:
if(isset($_POST['process'])){
         if ($_POST['process']=='newcomment') {
                     if ($link->subscribe==1) {
//If you find that most users do not provide a public email, it would be safer to change the query below to "Select user_email FROM" instead.
$authormail = $db->get_var("SELECT public_email FROM " .table_users ." WHERE user_id = $link->author;");
 
$subject= 'You have a new comment about your story ' . $link->title;
$message = "The following user '". $current_user->user_login . "' commented on your impact '" . $link->title . "'\r\n\r\n\t" . "'".$_POST['comment_content']. "\r\n\r\nHere is the link to the story: " . my_base_url . my_pligg_base . "/story.php?title=". $link->title_url . "\r\n\r\nRegards,\r\nAdministrator";
                                 $headers = "From: admin@yoursite.com"  . "\r\nReply-To: admin@yoursite.com " . "\r\nX-Priority: 1\r\n";
                                             $to=$authormail;
                                             @mail($to, $subject, $message, $headers);
                                 }
 
                                 insert_comment();
                     }
         }
 
The files that you need to upload:
  1. /libs/lang.conf
  2. /libs/link.php
  3. story.php
  4. editlink.php
  5. /templates/yourtemplate/editlink_edit_center.tpl
  6. /templates/yourtemplate/submit_step_2.tpl
  7. /templates/yourtemplate/submit_step_3.tpl
can you explain about creating database about index name and so
please help me
__________________
Helping hands are Welcome
Reply With Quote
  #70 (permalink)  
Old 08-23-2008, 11:46 AM
New Pligger
Pligg Version: 9.9.5
Pligg Template: starnews
 
Join Date: Dec 2007
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
Can anybody tell me how to set that check box mark by default ?
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