1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

fix some issues with oop, fixing small bugs and prepare the next steps...

NOTE TO DEVS: have a look at adm/admin_board.php (new config layout)


git-svn-id: file:///svn/phpbb/trunk@4883 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-05-02 13:06:57 +00:00
parent 67d2ac3667
commit 729c3abd02
58 changed files with 1693 additions and 3073 deletions

View File

@@ -502,6 +502,11 @@ class ucp_main extends module
break;
case 'drafts':
global $ucp;
$pm_drafts = ($ucp->name == 'pm') ? true : false;
$user->add_lang('posting');
$edit = (isset($_REQUEST['edit'])) ? true : false;
$submit = (isset($_POST['submit'])) ? true : false;
@@ -558,12 +563,24 @@ class ucp_main extends module
}
}
$sql = 'SELECT d.*, f.forum_name
FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f
WHERE d.user_id = ' . $user->data['user_id'] . ' ' .
(($edit) ? "AND d.draft_id = $draft_id" : '') . '
AND f.forum_id = d.forum_id
ORDER BY save_time DESC';
if (!$pm_drafts)
{
$sql = 'SELECT d.*, f.forum_name
FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f
WHERE d.user_id = ' . $user->data['user_id'] . ' ' .
(($edit) ? "AND d.draft_id = $draft_id" : '') . '
AND f.forum_id = d.forum_id
ORDER BY d.save_time DESC';
}
else
{
$sql = 'SELECT * FROM ' . DRAFTS_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . ' ' .
(($edit) ? "AND draft_id = $draft_id" : '') . '
AND forum_id = 0
AND topic_id = 0
ORDER BY save_time DESC';
}
$result = $db->sql_query($sql);
$draftrows = $topic_ids = array();
@@ -598,7 +615,7 @@ class ucp_main extends module
$row_count = 0;
foreach ($draftrows as $draft)
{
$link_topic = $link_forum = 0;
$link_topic = $link_forum = $link_pm = false;
$insert_url = $view_url = $title = '';
if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id']))
@@ -617,6 +634,11 @@ class ucp_main extends module
$insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id'];
}
else if ($pm_drafts)
{
$link_pm = true;
$insert_url = "ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id'];
}
$template_row = array(
'DATE' => $user->format_date($draft['save_time']),
@@ -635,6 +657,7 @@ class ucp_main extends module
'S_ROW_COUNT' => $row_count++,
'S_LINK_TOPIC' => $link_topic,
'S_LINK_FORUM' => $link_forum,
'S_LINK_PM' => $link_pm,
'S_HIDDEN_FIELDS' => $s_hidden_fields
);
@@ -643,7 +666,7 @@ class ucp_main extends module
if (!$edit)
{
$template->assign_vars('S_DRAFT_ROWS', $row_count);
$template->assign_var('S_DRAFT_ROWS', $row_count);
}
break;