well, i guess i was on my own.
i successfully rewrote the code so that when a user presses reply, they pass the $id of the original message onto the next page. that id [i called it $reid] is passed to the pbSave function where i look up that id in the database and append it to the end of the $postercomment variable before it is written to the database. if anyone wants to see it, here it is:
[code:1] function pbSave($id, $tab, $reid) {
global $my, $database, $_SERVER;
if($reid != null) {
$query="SELECT postercomment"
. "\n FROM #__comprofiler_plug_profilebook"
. "\n WHERE id=".$reid
. "\n ";
$database->setQuery($query);
$retext = "\n\n".$database->loadResult()."";}
$postercomment = $this->_getReqParam("postercomments", null).$retext;
$postername = $this->_getReqParam("postername", null);
$posterlocation = $this->_getReqParam("posterlocation", null);
$posteremail = $this->_getReqParam("posteremail", null);
$posterurl = $this->_getReqParam("posterurl", null);
$posterid = $my->id;
$posterip = $database->getEscaped(implode(",",$this->_get_ip_list()));
$postervote = $this->_getReqParam("postervote", "NULL"«»);
$remessage = $this->_getReqParam("remessage", null);
//print($retext."<br />"«»);
//print($postercomment);
$userConfig = $this->pbGetUserConfig($id);
$autoPublish = strtolower($userConfig->cb_pb_autopublish);
if($autoPublish=='_ue_no') $published=0;
else $published = 1;
$query = "SELECT COUNT(*) FROM #__comprofiler_plug_profilebook WHERE postername='$postername' AND posteremail='$posteremail' AND postercomment='$postercomment' AND posterid='$posterid' AND userid='$id'";
$database->setQuery($query);
$count=$database->loadResult();
if ($count == 0) { // avoid double-posts on clicking reload !
$query = "INSERT INTO #__comprofiler_plug_profilebook SET postername='$postername', posteremail='$posteremail', posterlocation='$posterlocation', postercomment='$postercomment', postervote=$postervote, posterip='$posterip',posterid='$posterid',userid='$id',published='$published',date=NOW(),posterurl='$posterurl'";
$database->setQuery($query);
if (!$database->query()) {
print("<font color=\"red\">pbSave SQL error: " . $database->stderr(true)."</font><br />"«»);
return;
}
$notify = strtolower($userConfig->cb_pb_notifyme);
if($notify=='_ue_yes'){
$cbNotification = new cbNotification();
$res=$cbNotification->sendFromSystem($id,sprintf(_pb_MSGSUB,getLangDefinition($tab->title)),sprintf(_pb_MSGBODY,$postername,getLangDefinition($tab->title)).sprintf($autoPublish?_pb_MSGBODYAUTOAPPROVED:_pb_MSGBODYREVIEWAPPROVE, getLangDefinition($tab->title),$this->_getAbsURLwithParam(array())));
}
}
}[/code:1]
I also had to change alot of code to get the variable to the pbSave function.
Post edited by: redleader36, at: 2009/01/13 23:58