SMF Support > SMF 2.0.x Support
Modify part of the file
(1/1)
Rocks-HD:
hy for all
I'm try modify this code for smf 2.0, but is very hard.
--- Code: ---
function Add2()
{
global $db_prefix, $ID_MEMBER, $txt, $user_info, $smcFunc;
// Guests can't do this stuff
is_not_guest();
//isAllowedTo('pcomments_add');
@$subject = htmlspecialchars($_POST['subject'],ENT_QUOTES);
@$comment = htmlspecialchars($_POST['comment'],ENT_QUOTES);
@$userid = (int) $_POST['userid'];
// Uncomment if you want the subject required
if ($subject == '')
fatal_error($txt['pcomments_err_subject'],false);
if ($comment == '')
fatal_error($txt['pcomments_err_comment'],false);
if (empty($userid))
fatal_error($txt['pcomments_err_noprofile']);
$commentdate = time();
mysql_query("INSERT INTO smf_profile_comments
(ID_MEMBER, comment, subject, date, COMMENT_MEMBER_ID)
VALUES ($ID_MEMBER,'$comment','$subject', $commentdate, $userid)");
// Redirect back to the profile
redirectexit('action=profile;u=' . $userid);
--- End code ---
I can see and i can delete comment but I can't create (add) comment
this code is a part of the profile comment code. I can make this package work in my forum, but i don't know add comment, because this code is for 1.1.4.
the file is attached
ccbtimewiz:
Please refrain from bumping topics in 24 hours.
Someone whom knows this will get to you as soon as they can.
Rocks-HD:
--- Quote from: ccbtimewiz on July 27, 2008, 05:05:41 PM ---Please refrain from bumping topics in 24 hours.
Someone whom knows this will get to you as soon as they can.
--- End quote ---
sorry for my fault
Well, I have done many modifications and I can make this mod work very well in my smf 2.0. if anybody have the same problema that I to do it:
function Add2()
{
global $db_prefix, $ID_MEMBER, $txt, $user_info, $smcFunc;
// Guests can't do this stuff
is_not_guest();
//isAllowedTo('pcomments_add');
@$subject = htmlspecialchars($_POST['subject'],ENT_QUOTES);
@$comment = htmlspecialchars($_POST['comment'],ENT_QUOTES);
@$userid = (int) $_POST['userid'];
// Uncomment if you want the subject required
if ($subject == '')
fatal_error($txt['pcomments_err_subject'],false);
if ($comment == '')
fatal_error($txt['pcomments_err_comment'],false);
if (empty($userid))
fatal_error($txt['pcomments_err_noprofile']);
$commentdate = time();
$postador = $user_info['id'];
mysql_query("INSERT INTO smf_profile_comments (ID_MEMBER, comment, subject, date, COMMENT_MEMBER_ID)
VALUES ('$postador','$comment','$subject', $commentdate, $userid)");
// Redirect back to the profile
redirectexit('action=profile;u=' . $userid);
}
thanks for all
greyknight17:
You might want to post in that mod's support topic to see if the author or the users there have any ideas how to do this. Or you can post in the SMF Coding Discussion board for more assistance with the code.
Navigation
[0] Message Index
Go to full version