Code: Select all
define('IN_PHPBB', true);
Code: Select all
//Edit by Luc to support the quoting of attachments
Function isImage($filename) {
$ext = strtolower(substr($filename, strrpos($filename, ".") + 1));
switch($ext) {
case "jpg":
case "jpeg":
case "gif":
case "png":
case "tga":
case "tif":
case "tiff":
return true;
break;
default:
return false;
break;
}
}
function getPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
$pageURL = substr($pageURL, 0, strrpos($pageURL, "posting.php"));
return $pageURL;
}
//End of Edit
Code: Select all
$sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
AND (f.forum_id = t.forum_id
OR f.forum_id = $forum_id)" .
(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
Code: Select all
//Edit by Luc to support quoting attachments
$sql = 'SELECT a.real_filename, IFNULL(a.attach_id, 0) AS attach_id, p.post_id, f.forum_id, f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p
LEFT JOIN ' . ATTACHMENTS_TABLE . " a ON a.post_msg_id = p.post_id
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
AND (f.forum_id = t.forum_id
OR f.forum_id = $forum_id)" .
(($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND p.post_approved = 1');
//$sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
// FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u
// WHERE p.post_id = $post_id
// AND t.topic_id = p.topic_id
// AND u.user_id = p.poster_id
// AND (f.forum_id = t.forum_id
// OR f.forum_id = $forum_id)" .
// (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
//End of Edit
Code: Select all
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
Code: Select all
//Edit by Luc to support quoting attachments
if ($post_data['attach_id'])
{
if(isImage($post_data['real_filename'])){
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "\n[img]". getPageURL() . "download/file.$phpEx?id=" . $post_data['attach_id'] . "[/img][/quote]\n";
} else {
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "\n[url=". getPageURL() . "download/file.$phpEx?id=" . $post_data['attach_id'] . "]" . $post_data['real_filename'] . "[/url][/quote]\n";
}
}
else
{
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
//End of Edit
Code: Select all
$decoded_message = $message;
decode_message($decoded_message, $row['bbcode_uid']);
Code: Select all
//Edit by Luc for attachment quoting
if (!empty($attachments[$row['post_id']]))
{
foreach ($attachments[$row['post_id']] as $attachment)
{
if(isImage($attachment["real_filename"])){
$decoded_message .= "\n[img]" . getPageURL() . "download/file.
$phpEx?id=" . $attachment['attach_id'] . "[/img]";
}
else {
$decoded_message .= "\n[url=" . getPageURL() . "download/file.
$phpEx?id=" . $attachment['attach_id'] . "]" . $attachment["real_filename"] . "[/url]";
}
}
}
//End of Edit
Code: Select all
//Edit by Luc Breault to support quoting attachments
if ($post_data['attach_id'])
{
if(isImage($post_data['real_filename'])){
$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "\n[img]". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "[/img][/quote]\n";
} else {
$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "\n[url=". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "]" . $attachments['real_filename'] . "[/url][/quote]\n";
}
}
else
{
$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
//End of Edit
Code: Select all
//Edit by Luc Breault to support quoting attachments
if ($post_data['attach_id'])
{
$select = "SELECT a.real_filename, IFNULL(a.attach_id, 0) AS attach_id FROM " . ATTACHMENTS_TABLE . " a WHERE a.post_msg_id = $post_id";
$result = $db->sql_query($select);
$quotes = "";
while($attachments = $db->sql_fetchrow($result)){
if(isImage($attachments['real_filename'])){
$quotes = $quotes . "[img]". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "[/img]\n";
//$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "\n[img]". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "[/img][/quote]\n";
} else {
$quotes = $quotes . "[url=". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "]" . $attachments['real_filename'] . "[/url]\n";
//$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "\n[url=". getPageURL() . "download/file.$phpEx?id=" . $attachments['attach_id'] . "]" . $attachments['real_filename'] . "[/url][/quote]\n";
}
}
$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "\n" . $quotes . "[/quote]\n";
$db->sql_freeresult($result);
}
else
{
$message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
//End of Edit
Why? Does it dont work anymore?God knows wrote:I request you or any other member to work on it. It would atleast be nice!
Hey you! Order is very important as anything else in these forums. What if for example, phpbb decided to mix up all these posts so that it is not known who is replying who, would you be able to read the posts and understand???????????????ViolaF wrote:just a question of ordering, seems no big deal. in fact it works, so thats cosmetic