diff -r 44302dd20d62 -r 94c1ff984286 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Mon Apr 13 17:28:24 2009 -0400 +++ b/plugins/SpecialUserFuncs.php Tue Apr 14 21:02:13 2009 -0400 @@ -1255,7 +1255,8 @@ $template->footer(); } -function page_Special_Contributions() { +function page_Special_Contributions() +{ global $db, $session, $paths, $template, $plugins; // Common objects global $lang; @@ -1274,158 +1275,8 @@ return; } - $user = $db->escape($user); - $q = 'SELECT log_type, time_id, action, date_string, page_id, namespace, author, edit_summary, minor_edit, page_id, namespace, ( action = \'edit\' ) AS is_edit FROM '.table_prefix.'logs WHERE author=\''.$user.'\' AND log_type=\'page\' AND is_draft != 1 ORDER BY is_edit DESC, time_id DESC;'; - $q = $db->sql_query($q); - if ( !$q ) - $db->_die('SpecialUserFuncs selecting contribution data'); - - echo '

' . $lang->get('userfuncs_contribs_heading_edits') . '

'; - - $cnt_edits = 0; - $cnt_other = 0; - $current = 'cnt_edits'; - $cls = 'row2'; - - while ( $row = $db->fetchrow($q) ) - { - if ( $current == 'cnt_edits' && $row['is_edit'] != 1 ) - { - // No longer processing page edits - split the table - if ( $cnt_edits == 0 ) - { - echo '

' . $lang->get('userfuncs_contribs_msg_no_edits') . '

'; - } - else - { - echo ''; - echo '

' . $lang->get('userfuncs_contribs_heading_other') . '

'; - } - $current = 'cnt_other'; - $cls = 'row2'; - } - if ( $$current == 0 ) - { - echo '
- '; - echo ' - '; - echo ' '; - if ( $current == 'cnt_edits' ) - { - echo ' '; - } - echo ' '; - if ( $current == 'cnt_other' ) - { - echo ' - - '; - } - echo ' - '; - } - $$current++; - $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; - - echo ''; - - // date & time - echo ' '; - - // page & link to said page - echo ' '; - - switch ( $row['action'] ) - { - case 'edit': - if ( $row['edit_summary'] == 'Automatic backup created when logs were purged' ) - { - $row['edit_summary'] = $lang->get('history_summary_clearlogs'); - } - else if ( empty($row['edit_summary']) ) - { - $row['edit_summary'] = '' . $lang->get('history_summary_none_given') . ''; - } - echo ' '; - if ( $row['minor_edit'] == 1 ) - { - echo ''; - } - else - { - echo ''; - } - break; - case 'prot': - echo ' '; - echo ' '; - echo ' '; - break; - case 'unprot': - echo ' '; - echo ' '; - echo ' '; - break; - case 'semiprot': - echo ' '; - echo ' '; - echo ' '; - break; - case 'rename': - echo ' '; - echo ' '; - echo ' '; - break; - case 'create': - echo ' '; - echo ' '; - echo ' '; - break; - case 'delete': - echo ' '; - echo ' '; - echo ' '; - break; - case 'reupload': - echo ' '; - echo ' '; - echo ' '; - break; - } - - // actions column - echo ' '; - - if ( $current == 'cnt_other' && $cnt_edits + $cnt_other >= $db->numrows($q) ) - { - echo '
' . $lang->get('history_col_datetime') . '' . $lang->get('history_col_page') . '' . $lang->get('history_col_summary') . '' . $lang->get('history_col_minor') . '' . $lang->get('history_col_action_taken') . '' . $lang->get('history_col_extra') . '' . $lang->get('history_col_actions') . '
' . enano_date('d M Y h:i a', $row['time_id']) . '' . get_page_title_ns($row['page_id'], $row['namespace']) . '' . $row['edit_summary'] . 'M' . $lang->get('history_log_protect') . '' . $lang->get('history_extra_reason') . ' ' . $row['edit_summary'] . '' . $lang->get('history_log_unprotect') . '' . $lang->get('history_extra_reason') . ' ' . $row['edit_summary'] . '' . $lang->get('history_log_semiprotect') . '' . $lang->get('history_extra_reason') . ' ' . $row['edit_summary'] . '' . $lang->get('history_log_rename') . '' . $lang->get('history_extra_oldtitle') . ' ' . htmlspecialchars($row['edit_summary']) . '' . $lang->get('history_log_create') . '' . $lang->get('history_log_delete') . '' . $lang->get('history_extra_reason') . ' ' . $row['edit_summary'] . '' . $lang->get('history_log_uploadnew') . '' . $lang->get('history_extra_reason') . ' ' . $row['edit_summary'] . ''; - if ( $row['is_edit'] == 1 ) - { - echo ' ' . $lang->get('history_action_view') . ' | '; - echo ' ' . $lang->get('history_action_restore') . ''; - } - else - { - echo ' ' . $lang->get('history_action_revert') . ''; - } - echo '
'; - } - } - - if ( $current == 'cnt_edits' ) - { - // no "other" edits, close the table - if ( $cnt_edits > 0 ) - echo ''; - else - echo '

' . $lang->get('userfuncs_contribs_msg_no_edits') . '

'; - echo '

' . $lang->get('userfuncs_contribs_heading_other') . '

'; - echo '

' . $lang->get('userfuncs_contribs_msg_no_other') . '

'; - } - - $db->free_result(); - $template->footer(); + $url = makeUrlNS("Special", "Log/user={$user}"); + redirect($url, '', '', 0); } function page_Special_ChangeStyle()