Page 1 of 1
Problem with Undo and redo using WYSIWYG
Posted: Mon Aug 28, 2006 7:49 am
by padmajam_dio
Hi,
I've installed serendipity on Windows XP system. The problem is when update my personal settings and enable WYSIWYG to Yes, I'm not able to redo and undo any operation using the toolbar. Only those two buttons in the toolbar are not functioning. Can I get a solution
Thanks in Advance.
Padmaja
Comment functionality
Posted: Mon Aug 28, 2006 7:51 am
by padmajam_dio
Hi,
I have one more question to ask. Can I get a brief description of how comment functionality works.
Thanks
Padmaja
Re: Comment functionality
Posted: Mon Aug 28, 2006 12:48 pm
by garvinhicking
Hi!
Hm, I'm sorry about the WYSIWYG editor, I don't know why these buttons don't work. Which browser are you using? Are you getting any javascript errors?
[quote]I have one more question to ask. Can I get a brief description of how comment functionality works.[/qoute]
Sure, I'd like to help - what do you want to know?
Best regards,
Garvin
Regarding comments
Posted: Mon Aug 28, 2006 1:36 pm
by padmajam_dio
Hi,
I'm able to save comments from index page. But the problem is i'm not getting the exact location where this save is called. I understood that whenever I submit comment it is being returned to index.php but after that which function or file is called to save that comment?
The other problem i faced is whenever I save the comment a notification must be sent to author of entry. Where is it happening? For me this notification is not being sent.
Please help.
Thanks,
Padmaja
Re: Regarding comments
Posted: Mon Aug 28, 2006 7:53 pm
by garvinhicking
Hi!
The comments are saved in index.php, function serendipity_saveComment(). That function should be declared in include/functions_comments.inc.php.
The other problem i faced is whenever I save the comment a notification must be sent to author of entry. Where is it happening? For me this notification is not being sent.
Check if you configured a valid From: E-Mail address in your serendipity configuration?
Best regards,
Garvin
Posted: Tue Aug 29, 2006 7:38 am
by padmajam_dio
Hi,
The following is the code from index.php in the location where serendipity_saveComment() is present. Is this the location you were mentioning. I placed echo statements before, after and inside IF condition. The echo statements before and after if were displayed when I saved a comment. The one inside the IF condition was not displayed. Can u tell me the reason.
serendipity_rememberComment();
echo "before code to save comment<br>";
if (!empty($serendipity['POST']['submit']) && !isset($_REQUEST['serendipity']['csuccess'])) {
echo "came here to saving ";
$comment['url'] = $serendipity['POST']['url'];
$comment['comment'] = trim($serendipity['POST']['comment']);
$comment['name'] = $serendipity['POST']['name'];
$comment['email'] = $serendipity['POST']['email'];
$comment['subscribe'] = $serendipity['POST']['subscribe'];
$comment['parent_id'] = $serendipity['POST']['replyTo'];
if (!empty($comment['comment'])) {
if (serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL')) {
$sc_url = $_SERVER['REQUEST_URI'] . (strstr($_SERVER['REQUEST_URI'], '?') ? '&' : '?') . 'serendipity[csuccess]=' . (isset($serendipity['csuccess']) ? $serendipity['csuccess'] : 'true');
if (serendipity_isResponseClean($sc_url)) {
header('Location: ' . $sc_url);
}
exit;
} else {
$serendipity['messagestack']['comments'][] = COMMENT_NOT_ADDED;
}
} else {
$serendipity['messagestack']['comments'][] = sprintf(EMPTY_COMMENT, '', '');
}
}
echo "after code to save comment<br>";
Coming to e-mail problem, the ID i provided was a valid one and internet facility is present on the system i am using.
Thanks
Padmaja
Posted: Tue Aug 29, 2006 9:33 am
by garvinhicking
Hi!
That is the right place. Did you check all variables why the IF might not come into effect? Maybe because a POST var is not set, or a comment has no text?
You could also check the serendipity_sendmail() function (in include/functions.inc.php) to see if that is getting called.
Regards,
Garvin
Posted: Tue Aug 29, 2006 10:51 am
by padmajam_dio
Hi,
Post variable is empty. I didnot make any modification to POST variable. I checked that the first condition in IF is not satisfied becoz POST array is empty. Even though this condition is not satisfied, comment is getting saved in database with proper e-mail ID and all other values which were provided in comment form.
In mysql.inc.php file's mysql_insert_id it is identified that maximum primary key value of table is being returned. If this is the case, what happens when concurrent users are using the blog simultaneously. Have u tested on this grounds any time.
Thanks
Padmaja
Posted: Tue Aug 29, 2006 10:57 am
by garvinhicking
Hi!
Which kind of webserver are you running? The commentform is submitted via POST variables. They should not be empty!
What does a print_r($_REQUEST) tell you? Do you see the post variables in there?
Post variable is empty. I didnot make any modification to POST variable. I checked that the first condition in IF is not satisfied becoz POST array is empty. Even though this condition is not satisfied, comment is getting saved in database with proper e-mail ID and all other values which were provided in comment form.
Maybe you can search the s9y code for other occurences of serendipity_saveComment()? MY development machine is dead, so I can't very well do that for you at the moment.
In mysql.inc.php file's mysql_insert_id it is identified that maximum primary key value of table is being returned. If this is the case, what happens when concurrent users are using the blog simultaneously. Have u tested on this grounds any time.
INSERT_ID is based on a per-connection thread. One client will always have a singular per-connection thread, so it is not possible that insert-ids overlap. No race condition can occur based on this, we have made sure of that.
Best regards,
Garvin
Posted: Wed Aug 30, 2006 10:40 am
by padmajam_dio
I am using Apache Web Server 2.0.46 and PHP 4.3.2
I tried for print_r($_REQUEST) , it is displaying the following array:-
Array ( [/archives/1-Test-Blog_html] => [serendipity] => Array ( [old_session] => a05d15e289c7b2d56853d6ee9923ec9c ) [PHPSESSID] => a05d15e289c7b2d56853d6ee9923ec9c )
Can you suggest something on this? Why the POST variable is not getting populated?
Thanks ,
Padmaja
Posted: Wed Aug 30, 2006 10:54 am
by garvinhicking
Hi!
Are you taking into consideration that the index.php does a header('Location...') redirect, after a comment is posted? You must place your code so that the redirect does either not take place, or you log your output to a file instead of to the browser to see whats going on?
Best regards,
Garvin
Posted: Wed Aug 30, 2006 12:49 pm
by padmajam_dio
Hi,
We are unable to locate the place you specified in index.php. Please tell me a bit clearly with some more explanation on the previous point.
Thanks a lot,
Padmaja
Posted: Wed Aug 30, 2006 12:53 pm
by garvinhicking
Hi!
When someone submits a comment, it gets POSTed to index.php. Then the piece of code you already found gets executed. The comment gets stored via serendipity_saveComment, a mail gets sent via serendpity_sendMail(). After that is done, serendipity emits a header('Location:') redirect call. This is also contained in your snippet of code. It then appends a variable to the URL which tells serendipity that a comment was made properly. The target page then displays the note "Comment added".
When you were emitting your own 'echo' stuff, it got sent to the browser, but then the browser immediately redirected to the next target page. So you only see the output of the target redirected page, not on the page you actually refer to.
Change your
to
Code: Select all
$fp = fopen('debug.log', 'a');
fwrite($fp, 'Came here: ' . $_SERVER['REQUEST_URI'] . "\n" . print_r($_REQUEST, true) . "\n");
fclose($fp);
do that for each echo you had, with specific content. Submit a comment. Look at the debug.log logfile, and you will see what gets executed where.
The notification might not be sent on your server because the php mail() command may not work at all? Did you write a test script? If it does not work it means that your PHP is not comipled with sendmail support, or your webserver has no SMTP setup. If the command works, it might be that the "From:" address of the email is invalid, and thus not sent. But this I already mentioned and you said you had setup a proper mail domain name.
HTH,
Garvin
regarding mail notification for comments
Posted: Tue Sep 05, 2006 12:32 pm
by manoj
I find that when we add a comment to an entry teh comment gets saved in database but no notification is sent. I have tested the php mail() method and its not working. Also can you please let me know how to set SMTP settings for the server.I use Apache 2.0.55 and PHP4.3.2.I am a friend of Padmajam.
when i ran the below test script
<?php
$to = '
manoj@yahoo.com';
$subject = 'the subject';
$message = 'hello';
echo " before call to mail <br>";
$val = mail($to, $subject, $message);
echo " after call to mail <br>";
if($val == TRUE)
{
echo " mail sent";
}
else
{
echo " mail bounced ";
}
?>
i get the following displayed in webpage.
before call to mail
after call to mail
mail bounced
Please help us.
thanks.
Re: regarding mail notification for comments
Posted: Tue Sep 05, 2006 12:37 pm
by garvinhicking
Hi!
Please ask your web provider about why the mail() function is failing... It can be related to 'sendmail' not being available on your server, or a wrong SMTP/MTA setup.
Sadly we can only support Serendipity here, not general web server problems. You might want to search at a webhosting forum to ask for help, since I don'T really know what you can do there? Maybe someone else can also help here, but I think you will have better luck on a forum created specifically for problems like this.
Good luck and best regards,
Garvin