prepare files, last commit before committing initial attachment functionality - please see thread within development forum.

git-svn-id: file:///svn/phpbb/trunk@3695 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-03-20 13:21:58 +00:00
parent ab3209af48
commit 73ffe96e2e
3 changed files with 48 additions and 78 deletions

View file

@ -164,12 +164,6 @@ function decode_text(&$message)
return;
}
// Quote Text
function quote_text(&$message, $username = '')
{
$message = ' [quote' . ( (empty($username)) ? ']' : '="' . addslashes(trim($username)) . '"]') . trim($message) . '[/quote] ';
}
// Topic Review
function topic_review($topic_id, $is_inline_review = false)
{
@ -332,8 +326,9 @@ function update_last_post_information($type, $id)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($type == 'forum')
switch ($type)
{
case 'forum':
// Update forums: last post info, topics, posts ... we need to update
// each parent too ...
$forum_ids = $id;
@ -349,10 +344,10 @@ function update_last_post_information($type, $id)
}
$where_clause = 'forum_id IN (' . $forum_ids . ')';
}
else if ($type == 'topic')
{
break;
case 'topic':
$where_clause = 'topic_id = ' . $id;
break;
}
$update_sql = array(
@ -650,7 +645,8 @@ function submit_poll($topic_id, $mode, $poll)
if (sizeof($poll['poll_options']) < sizeof($cur_poll_options))
{
$sql = "DELETE FROM " . POLL_OPTIONS_TABLE . "
WHERE poll_option_id > " . sizeof($poll['poll_options']) . " AND topic_id = " . $topic_id;
WHERE poll_option_id > " . sizeof($poll['poll_options']) . "
AND topic_id = " . $topic_id;
$db->sql_query($sql);
}
}
@ -947,7 +943,6 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$sql = 'UPDATE ' . FORUMS_TABLE . ' SET ' . ( (count($forum_sql) > 0) ? $db->sql_build_array('UPDATE', $forum_sql) : '') .
( ($forum_update_sql != '') ? ((count($forum_sql) > 0) ? ', ' . $forum_update_sql : $forum_update_sql) : '') . '
WHERE forum_id = ' . $forum_id;
$db->sql_query($sql);
}
@ -956,7 +951,6 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . ( (count($topic_sql) > 0) ? $db->sql_build_array('UPDATE', $topic_sql) : '') .
( ($topic_update_sql != '') ? ((count($topic_sql) > 0) ? ', ' . $topic_update_sql : $topic_update_sql) : '') . '
WHERE topic_id = ' . $topic_id;
$db->sql_query($sql);
}
@ -965,7 +959,6 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . ( (count($user_sql) > 0) ? $db->sql_build_array('UPDATE', $user_sql) : '') .
( ($user_update_sql != '') ? ((count($user_sql) > 0) ? ', ' . $user_update_sql : $user_update_sql) : '') . '
WHERE user_id = ' . $post_data['user_id'];
$db->sql_query($sql);
}

View file

@ -31,7 +31,7 @@ class parse_message
$this->message_mode = $message_type;
}
function parse(&$message, $html, $bbcode, $uid, $url, $smilies, $attach = false)
function parse(&$message, $html, $bbcode, $uid, $url, $smilies, $attach)
{
global $config, $db, $user;

View file

@ -182,8 +182,7 @@ if ($sql != '')
$topic_id = intval($row['topic_id']);
$post_id = intval($row['post_id']);
@reset($forum_fields);
while (list($var, $type) = each($forum_fields))
foreach ($forum_fields as $var => $type)
{
switch ($type)
{
@ -198,8 +197,7 @@ if ($sql != '')
}
}
@reset($topic_fields);
while (list($var, $type) = each($topic_fields))
foreach ($topic_fields as $var => $type)
{
switch ($type)
{
@ -214,8 +212,7 @@ if ($sql != '')
}
}
@reset($post_fields);
while (list($var, $type) = each($post_fields))
foreach ($post_fields as $var => $type)
{
switch ($type)
{
@ -301,10 +298,6 @@ $perm = array(
'f_save' => $auth->acl_gets('f_save', 'm_', 'a_', $forum_id)
);
// DEBUG - Show Permissions
//debug_print_permissions($perm);
// DEBUG - Show Permissions
if ( (!$auth->acl_gets('f_' . $mode, 'm_', 'a_', $forum_id)) && ($forum_postable) )
{
trigger_error($user->lang['USER_CANNOT_' . strtoupper($mode)]);
@ -447,7 +440,7 @@ if (($submit) || ($preview))
if ($mode != 'edit' || $message_md5 != $post_checksum)
{
// Parse message
if (($result = $message_parser->parse($message, $enable_html, $enable_bbcode, $bbcode_uid, $enable_urls, $enable_smilies)) != '')
if (($result = $message_parser->parse($message, $enable_html, $enable_bbcode, $bbcode_uid, $enable_urls, $enable_smilies, false)) != '')
{
$err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $result;
}
@ -459,7 +452,7 @@ if (($submit) || ($preview))
$where_sql = ($user->data['user_id'] == ANONYMOUS) ? "poster_ip = '$user->ip'" : 'poster_id = ' . $user->data['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE $where_sql";
WHERE " . $where_sql;
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
@ -613,7 +606,7 @@ $poll_options = explode("\n", $poll_options_tmp);
if (($mode == 'quote') && (!$preview))
{
quote_text($post_text, $username);
$post_text = ' [quote' . ( (empty($username)) ? ']' : '="' . addslashes(trim($username)) . '"]') . trim($post_text) . '[/quote] ';
}
if ( (($mode == 'reply') || ($mode == 'quote')) && (!$preview) )
@ -642,8 +635,7 @@ if ( ($mode == 'post') || (($mode == 'edit') && ($post_id == $topic_first_post_i
// 'global_announce' => array('const' => POST_GLOBAL_ANNOUNCE, 'lang' => 'POST_GLOBAL_ANNOUNCE')
);
@reset($topic_types);
while (list($auth_key, $topic_value) = each($topic_types))
foreach ($topic_types as $auth_key => $topic_value)
{
if ($perm['f_' . $auth_key])
{
@ -797,19 +789,4 @@ if ($mode == 'reply' || $mode == 'quote')
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
function debug_print_permissions($perm)
{
global $forum_id;
@reset($perm);
echo '<span class="gensmall">Permission Settings -> Forum ID ' . $forum_id . ': <br />';
while (list($perm_key, $authed) = each($perm))
{
echo $perm_key . ' -> ' . (($authed) ? 'yes' : 'no') . '<br />';
}
echo '</span>';
}
?>