* insertmoderated - inserts the message into the table for moderation (forum_pending_messages)
* @param string The subject of the message.
* @param string The body of the message.
- * @param string BBCODE ID.
* @param int The thread_id of the message, if known.
* @param int The message_id of the parent message, if any.
* @param int The id of the user that is posting the message
* @return boolean success.
*/
- function insertmoderated($subject, $body, $bbcode_uid=-1, $thread_id='', $is_followup_to='',$user_id) {
+ function insertmoderated($subject, $body, $thread_id='', $is_followup_to='',$user_id) {
if (!$thread_id) {
$thread_id=$this->Forum->getNextThreadID();
$is_followup_to=0;
}
$sql="INSERT INTO forum_pending_messages (group_forum_id,posted_by,subject,
- body,post_date,is_followup_to,thread_id,most_recent_date,bbcode_uid)
+ body,post_date,is_followup_to,thread_id,most_recent_date)
VALUES ('". $this->Forum->getID() ."', '$user_id', '". htmlspecialchars($subject) ."',
- '". $body ."', '". time() ."','$is_followup_to','$thread_id','". time() ."','" . $bbcode_uid . "')";
+ '". $body ."', '". time() ."','$is_followup_to','$thread_id','". time() ."')";
$result=db_query($sql);
if (!$result || db_affected_rows($result) < 1) {
* @param string The subject of the message.
* @param string The body of the message.
* @param string The post date
- * @param string BBCODE ID.
* @param int The thread_id of the message
* @param int The message_id of the parent message, if any.
* @param int The id of the user that is posting the message
* @return boolean success.
*/
- function insertreleasedmsg($group_forum_id,$subject, $body,$post_date,$bbcode_uid, $thread_id, $is_followup_to,$posted_by,$has_followups,$most_recent_date) {
+ function insertreleasedmsg($group_forum_id,$subject, $body,$post_date, $thread_id, $is_followup_to,$posted_by,$has_followups,$most_recent_date) {
global $Language;
if ($is_followup_to != 0) {
db_begin();
$sql="INSERT INTO forum (group_forum_id,posted_by,subject,
- body,post_date,is_followup_to,thread_id,most_recent_date,bbcode_uid)
+ body,post_date,is_followup_to,thread_id,most_recent_date)
VALUES ('". $group_forum_id ."', '$posted_by', '". htmlspecialchars($subject) ."',
- '". $body ."', '". $post_date ."','$is_followup_to','$thread_id','". $most_recent_date ."','" . $bbcode_uid . "')";
+ '". $body ."', '". $post_date ."','$is_followup_to','$thread_id','". $most_recent_date ."')";
$result=db_query($sql);
if (!$result || db_affected_rows($result) < 1) {
* insertmsg - inserts the message into the main table (forum)
* @param string The subject of the message.
* @param string The body of the message.
- * @param string BBCODE ID.
* @param int The thread_id of the message, if known.
* @param int The message_id of the parent message, if any.
* @param int The id of the user that is posting the message
* @return boolean success.
*/
- function insertmsg($subject, $body, $bbcode_uid=-1, $thread_id='', $is_followup_to='',$user_id,$has_attach=false) {
+ function insertmsg($subject, $body, $thread_id='', $is_followup_to='',$user_id,$has_attach=false) {
global $Language;
if (!$thread_id) {
}
$sql="INSERT INTO forum (group_forum_id,posted_by,subject,
- body,post_date,is_followup_to,thread_id,most_recent_date,bbcode_uid)
+ body,post_date,is_followup_to,thread_id,most_recent_date)
VALUES ('". $this->Forum->getID() ."', '$user_id', '". htmlspecialchars($subject) ."',
- '". $body ."', '". time() ."','$is_followup_to','$thread_id','". time() ."','" . $bbcode_uid . "')";
+ '". $body ."', '". time() ."','$is_followup_to','$thread_id','". time() ."')";
$result=db_query($sql);
if (!$result || db_affected_rows($result) < 1) {
*
* @param string The subject of the message.
* @param string The body of the message.
- * @param string BBCODE ID.
* @param int The thread_id of the message, if known.
* @param int The message_id of the parent message, if any.
* @param boolean Whether the message has an attach associated. Defaults to false
* @return boolean success.
*/
- function create($subject, $body, $bbcode_uid=-1, $thread_id='', $is_followup_to='',$has_attach=false) {
+ function create($subject, $body, $thread_id='', $is_followup_to='',$has_attach=false) {
global $Language;
if (!$body || !$subject) {
$this->setError($Language->getText('forum_common_forummessage','error_required_fields'));
switch ($mod_level) {
case 0: {
//no moderation
- return $this->insertmsg($subject, $body,$bbcode_uid, $thread_id, $is_followup_to,$user_id,$has_attach);
+ return $this->insertmsg($subject, $body, $thread_id, $is_followup_to,$user_id,$has_attach);
}
case 1: {
//moderation for anonymous & non project users
if ($this->Forum->userIsModLvl1()) {
- return $this->insertmoderated($subject, $body,$bbcode_uid, $thread_id, $is_followup_to,$user_id);
+ return $this->insertmoderated($subject, $body, $thread_id, $is_followup_to,$user_id);
} else {
- return $this->insertmsg($subject, $body,$bbcode_uid, $thread_id, $is_followup_to,$user_id,$has_attach);
+ return $this->insertmsg($subject, $body, $thread_id, $is_followup_to,$user_id,$has_attach);
}
}
case 2: {
//moderation for anyone who can post (even project members). admins can always post...
if ($this->Forum->userIsModLvl2()) {
- return $this->insertmoderated($subject, $body,$bbcode_uid, $thread_id, $is_followup_to,$user_id);
+ return $this->insertmoderated($subject, $body, $thread_id, $is_followup_to,$user_id);
} else {
- return $this->insertmsg($subject, $body,$bbcode_uid, $thread_id, $is_followup_to,$user_id,$has_attach);
+ return $this->insertmsg($subject, $body, $thread_id, $is_followup_to,$user_id,$has_attach);
}
}
}
return true;
}
- /**
- * getBBCode_uid - get the BBCODE UID this ForumMessage is associated with.
- *
- * @return object The bbcode uid.
- */
- function &getBBCode_uid() {
- return $this->data_array['bbcode_uid'];
- }
-
/**
* getForum - get the Forum object this ForumMessage is associated with.
*
$body .= "\n";
}
$sanitizer = new TextSanitizer();
- //$text= strip_tags($this->removebbcode(util_line_wrap(util_unconvert_htmlspecialchars($this->getBody())))); #NOTE: UTF-8 does not work!
$text = $this->getBody();
- //echo "texto 1 : " . $text . "<br>";
$text = $sanitizer->convertNeededTagsForEmail($text);
- //echo "texto 2 : " . $text . "<br>";
$text= strip_tags($this->removebbcode(util_line_wrap($text)));
- //echo "texto 3 : " . $text . "<br>";
$text = $sanitizer->convertExtendedCharsForEmail($text);
- //echo "texto 4 : " . $text . "<br>";
$body .= $text .
"\n\n______________________________________________________________________".
"\nYou are receiving this email because you elected to monitor this forum.".
"\nBy: " . $this->getPosterRealName() . "\n\n";
$text = $this->getBody();
- //echo "texto 1 : " . $text . "<br>";
+ $sanitizer = new TextSanitizer();
$text = $sanitizer->convertNeededTagsForEmail($text);
- //echo "texto 2 : " . $text . "<br>";
$text= strip_tags($this->removebbcode(util_line_wrap($text)));
- //echo "texto 3 : " . $text . "<br>";
$text = $sanitizer->convertExtendedCharsForEmail($text);
- //echo "texto 4 : " . $text . "<br>";
$body .= $text .
"\n\n______________________________________________________________________".
"\nYou are receiving this email because the forum you administrate has a new moderated message awaiting your approval.";
* @param int The thread_id of the message, if known.
* @param int has followups?
* @param string The most recent date.
- * @param string BBCODE ID.
*
* @return boolean success.
*/
- function updatemsg($group_forum_id,$posted_by,$subject,$body,$post_date,$is_followup_to,$thread_id,$has_followups,$most_recent_date,$bbcode_uid) {
+ function updatemsg($group_forum_id,$posted_by,$subject,$body,$post_date,$is_followup_to,$thread_id,$has_followups,$most_recent_date) {
$subject = htmlspecialchars($subject);
$body = $body;
$msg_id = $this->getID();
$sql="UPDATE forum
SET group_forum_id='$group_forum_id' , posted_by='$posted_by' , subject='$subject',
body='$body', post_date='$post_date' , is_followup_to='$is_followup_to' ,
- thread_id='$thread_id',most_recent_date='$most_recent_date' , bbcode_uid='$bbcode_uid'
+ thread_id='$thread_id',most_recent_date='$most_recent_date'
WHERE msg_id='$msg_id'";
$res = db_query($sql);
if (!$res) {
require_once('www/news/news_utils.php');
require_once('www/forum/admin/ForumAdmin.class');
require_once('www/forum/include/AttachManager.class');
-require_once('www/include/TextSupport.class'); // bbcode, smilies support
function forum_header($params) {
global $HTML,$group_id,$forum_name,$forum_id,$sys_datefmt,$sys_news_group,$Language,$f,$sys_use_forum,$group_forum_id;
*/
function showPendingMessage ( &$msg) {
global $sys_datefmt,$Language,$HTML,$group_id;
- global $sys_bbcode_make_clickable,$sys_bbcode_smilie_on,$sys_bbcode_bbcode_on,$sys_bbcode_strip_html;//bbcode variables
$am = new AttachManager();
- $make_clickable=$sys_bbcode_make_clickable; //bbcode variables
- $smilie_on=$sys_bbcode_smilie_on;
- $bbcode_on=$sys_bbcode_bbcode_on;
- $strip_html=$sys_bbcode_strip_html;
- $text_support = new TextSupport();
$ret_val = $am->PrintHelperFunctions();
html_feedback_top($Language->getText('forum_admin_pending','view_pending_notice'));
$ret_val .= '
</tr>
<tr>
<td>
- '. $msg->getBody() /*$text_support->displayText($msg->getBody(), $make_clickable, $smilie_on, $bbcode_on, $msg->getBBCode_uid())*/ .'
+ '. $msg->getBody() .'
</td>
</tr>
</table>';
*/
global $sys_datefmt,$Language,$HTML,$group_id;
- global $sys_bbcode_make_clickable,$sys_bbcode_smilie_on,$sys_bbcode_bbcode_on,$sys_bbcode_strip_html,$sys_default_domain;//bbcode variables
/*
See if this message is new or not
If so, highlite it in bold
$bold_end='</strong>';
}
$am = new AttachManager();
- $make_clickable=$sys_bbcode_make_clickable; //bbcode variables
- $smilie_on=$sys_bbcode_smilie_on;
- $bbcode_on=$sys_bbcode_bbcode_on;
- $strip_html=$sys_bbcode_strip_html;
- $text_support = new TextSupport();
$fa = new ForumAdmin();
$msgforum =& $msg->getForum();
$ret_val =
</tr>
<tr>
<td>
- '//. $text_support->displayText($msg->getBody(), $make_clickable, $smilie_on, $bbcode_on, $msg->getBBCode_uid()) .'
- ;
+ ';
if (!strstr($msg->getBody(),'<')) {
$ret_val .= nl2br($msg->getBody()); //backwards compatibility for non html messages
} else {
if ($this->Forum->userCanPost()) { // minor control, but anyways it should be an admin at this point
echo notepad_func();
- $text_support = new TextSupport(); //for BBCODE
?>
<div align="center">
<form "enctype="multipart/form-data" action="/forum/admin/index.php" method="post">
- <?php $objid = $this->Forum->getID(); //$text_support->displayForm('form', 'body',"/forum/admin/index.php","enctype=\"multipart/form-data\""); ?>
+ <?php $objid = $this->Forum->getID();?>
<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
<input type="hidden" name="forum_id" value="<?php echo $objid; ?>" />
<input type="hidden" name="editmsg" value="<?php echo $msg_id; ?>" />
<input type="hidden" name="most_recent_date" value="<?php echo $most_recent_date;?>">
<input type="hidden" name="group_id" value="<?php echo $group_id;?>">
<fieldset class="fieldset"><table><tr><td valign="top">
- <?php //$text_support->displaySmiliesList(); ?>
</td><td valign="top">
- <?php //echo $text_support->displayBBCodeHelpTools(); ?>
<br>
<strong><?php echo $Language->getText('forum_utils','subject'); ?></strong><?php echo utils_requiredField(); ?><br />
<input type="text" name="subject" value="<?php echo $subject; ?>" size="45" maxlength="45" />
<br><br>
<strong><?php echo $Language->getText('forum_utils','message'); ?></strong><?php echo notepad_button('document.forms[1].body') ?><?php echo utils_requiredField(); ?><br />
- <?php //$text_support->displayTextField('body',$body); ?>
<?php
$params['body'] = $body;
$params['width'] = "800";
}
}
echo notepad_func();
- $text_support = new TextSupport(); //for BBCODE
?>
<div align="center">
<form "enctype="multipart/form-data" action="/forum/forum.php?forum_id=<?php echo $this->Forum->getID(); ?>&group_id=<?php echo $group_id; ?>" method="post">
- <?php $objid = $this->Forum->getID(); //$text_support->displayForm('form', 'body',"/forum/forum.php?forum_id=$objid","enctype=\"multipart/form-data\""); ?>
+ <?php $objid = $this->Forum->getID();?>
<input type="hidden" name="post_message" value="y" />
<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
<input type="hidden" name="msg_id" value="<?php echo $is_followup_to; ?>" />
<input type="hidden" name="is_followup_to" value="<?php echo $is_followup_to; ?>" />
<input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
<fieldset class="fieldset"><table><tr><td valign="top">
- <?php //$text_support->displaySmiliesList(); ?>
</td><td valign="top">
- <?php //echo $text_support->displayBBCodeHelpTools(); ?>
<br>
<strong><?php echo $Language->getText('forum_utils','subject'); ?></strong><?php echo utils_requiredField(); ?><br />
<input type="text" name="subject" value="<?php echo $subject; ?>" size="45" maxlength="45" />