Ive been trying to change the default elgg comment box to look more like "river_comments" comment box.
ive got pretty far but i recieve this error afer posting a comment "Sorry, you need to actually put something in your comment before we can save it."
this is my code on views/comment/forms/edit.php
<?php
/**
* Elgg comments add form
*
* @package Elgg
*
* @uses $vars['entity']
*/
if (isset($vars['entity']) && isloggedin()) {
$form_body = "<div class=\"comment_box\">
<div class=\"comment_feed comment_add_box\">
<form action=\"http://www.fakepals.com/action/comment\" method=\"post\" >
" . elgg_view('input/securitytoken') . "
<input type=\"hidden\" name=\"guid\" value=\"" . $entity_guid . "\" />
<div class=\"comment_icon\"> " .
elgg_view("profile/icon",array(
'entity' => $user,
'size' => 'tiny',
'override' => true)
) ."
</div>
<textarea onclick=\"rcPrepareItems(); readyToWrite(this)\" name=\"river_comment_text\"> "
. elgg_echo('river_comments:writeacomment1') . "</textarea>
<input type=\"submit\" name=\"comment\" value=\"Comment\" />
</form>
</div>
</div>";
echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add"));
}
can anyone tell me whats wrong with my code? any help would be great! bear with me im a nobe coder.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
anyone?
anyone?
" need to actually put something... " comes from the action, not the form that you posted above
oh i see what your saying then how is my action not pulling from the form above?
Looks like u r tryin 2 code new stuff with perhaps lesser know-how of programming//Elgg/ PHP/ etc.. Is that so ? " got pretty far.." is q. v. very good ;-) but.. slow down some.. 2 pick up on some extras re: coding.. ;-o;O;X;P Something looks wrong with relationship between that form's fields and what the action expects.. The input field must be blank when the action gets to it.
yes your right. something is wrong with relationship between that form's fields and what the action expects. its a wrong action call but i dont know how to make it right.
I just need to know how to write the action.
i think i need to change this part
<textarea onclick=\"rcPrepareItems(); readyToWrite(this)\" name=\"river_comment_text\"> "
. elgg_echo('river_comments:writeacomment1') . "</textarea>
to
name=\"generic_comment\">
but now im getting another error.
I've not looked at the action form, but it seems to me that your textarea would need to have a name of some kind so that the action form can get it via get_input();
The text area has a name it's "name=generic_comment" I'm figuring it out but I'm still not there yet. I give respect to real coders like you both, this is hard work.
- Previous
- 1
- 2
- Next
You must log in to post replies.