637 */ |
637 */ |
638 |
638 |
639 function show_category_info() |
639 function show_category_info() |
640 { |
640 { |
641 global $db, $session, $paths, $template, $plugins; // Common objects |
641 global $db, $session, $paths, $template, $plugins; // Common objects |
|
642 global $lang; |
642 |
643 |
643 if ( $paths->namespace == 'Category' ) |
644 if ( $paths->namespace == 'Category' ) |
644 { |
645 { |
645 // Show member pages and subcategories |
646 // Show member pages and subcategories |
646 $q = $db->sql_query('SELECT p.urlname, p.namespace, p.name, p.namespace=\'Category\' AS is_category FROM '.table_prefix.'categories AS c |
647 $q = $db->sql_query('SELECT p.urlname, p.namespace, p.name, p.namespace=\'Category\' AS is_category FROM '.table_prefix.'categories AS c |
752 |
753 |
753 if ( $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
754 if ( $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
754 { |
755 { |
755 echo '<div class="mdg-comment" style="margin: 10px 0 0 0;" id="category_box_wrapper">'; |
756 echo '<div class="mdg-comment" style="margin: 10px 0 0 0;" id="category_box_wrapper">'; |
756 echo '<div style="float: right;">'; |
757 echo '<div style="float: right;">'; |
757 echo '(<a href="#" onclick="ajaxCatToTag(); return false;">show page tags</a>)'; |
758 echo '(<a href="#" onclick="ajaxCatToTag(); return false;">' . $lang->get('tags_catbox_link') . '</a>)'; |
758 echo '</div>'; |
759 echo '</div>'; |
759 echo '<div id="mdgCatBox">Categories: '; |
760 echo '<div id="mdgCatBox">' . $lang->get('catedit_catbox_lbl_categories') . ' '; |
760 |
761 |
761 $where = '( c.page_id=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND c.namespace=\'' . $db->escape($paths->namespace) . '\' )'; |
762 $where = '( c.page_id=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND c.namespace=\'' . $db->escape($paths->namespace) . '\' )'; |
762 $prefix = table_prefix; |
763 $prefix = table_prefix; |
763 $sql = <<<EOF |
764 $sql = <<<EOF |
764 SELECT c.category_id FROM {$prefix}categories AS c |
765 SELECT c.category_id FROM {$prefix}categories AS c |
784 while ( $row = $db->fetchrow() ); |
785 while ( $row = $db->fetchrow() ); |
785 echo implode(', ', $list); |
786 echo implode(', ', $list); |
786 } |
787 } |
787 else |
788 else |
788 { |
789 { |
789 echo '(Uncategorized)'; |
790 echo $lang->get('catedit_catbox_lbl_uncategorized'); |
790 } |
791 } |
791 |
792 |
792 $can_edit = ( $session->get_permissions('edit_cat') && ( !$paths->page_protected || $session->get_permissions('even_when_protected') ) ); |
793 $can_edit = ( $session->get_permissions('edit_cat') && ( !$paths->page_protected || $session->get_permissions('even_when_protected') ) ); |
793 if ( $can_edit ) |
794 if ( $can_edit ) |
794 { |
795 { |
795 $edit_link = '<a href="' . makeUrl($paths->page, 'do=catedit', true) . '" onclick="ajaxCatEdit(); return false;">edit categorization</a>'; |
796 $edit_link = '<a href="' . makeUrl($paths->page, 'do=catedit', true) . '" onclick="ajaxCatEdit(); return false;">' . $lang->get('catedit_catbox_link_edit') . '</a>'; |
796 echo ' [ ' . $edit_link . ' ]'; |
797 echo ' [ ' . $edit_link . ' ]'; |
797 } |
798 } |
798 |
799 |
799 echo '</div></div>'; |
800 echo '</div></div>'; |
800 |
801 |
881 */ |
882 */ |
882 |
883 |
883 function display_page_headers() |
884 function display_page_headers() |
884 { |
885 { |
885 global $db, $session, $paths, $template, $plugins; // Common objects |
886 global $db, $session, $paths, $template, $plugins; // Common objects |
|
887 global $lang; |
886 if($session->get_permissions('vote_reset') && $paths->cpage['delvotes'] > 0) |
888 if($session->get_permissions('vote_reset') && $paths->cpage['delvotes'] > 0) |
887 { |
889 { |
888 $delvote_ips = unserialize($paths->cpage['delvote_ips']); |
890 $delvote_ips = unserialize($paths->cpage['delvote_ips']); |
889 $hr = htmlspecialchars(implode(', ', $delvote_ips['u'])); |
891 $hr = htmlspecialchars(implode(', ', $delvote_ips['u'])); |
890 $is = 'is'; |
892 |
891 $s = ''; |
893 $string_id = ( $paths->cpage['delvotes'] == 1 ) ? 'delvote_lbl_votes_one' : 'delvote_lbl_votes_plural'; |
892 $s2 = 's'; |
894 $string = $lang->get($string_id, array('num_users' => $paths->cpage['delvotes'])); |
893 if ( $paths->cpage['delvotes'] > 1) |
895 |
894 { |
|
895 $is = 'are'; |
|
896 $s = 's'; |
|
897 $s2 = ''; |
|
898 } |
|
899 echo '<div class="info-box" style="margin-left: 0; margin-top: 5px;" id="mdgDeleteVoteNoticeBox"> |
896 echo '<div class="info-box" style="margin-left: 0; margin-top: 5px;" id="mdgDeleteVoteNoticeBox"> |
900 <b>Notice:</b> There '.$is.' '.$paths->cpage['delvotes'].' user'.$s.' that think'.$s2.' this page should be deleted.<br /> |
897 <b>' . $lang->get('etc_lbl_notice') . '</b> ' . $string . '<br /> |
901 <b>Users that voted:</b> ' . $hr . '<br /> |
898 <b>' . $lang->get('delvote_lbl_users_that_voted') . '</b> ' . $hr . '<br /> |
902 <a href="'.makeUrl($paths->page, 'do=deletepage').'" onclick="ajaxDeletePage(); return false;">Delete page</a> | <a href="'.makeUrl($paths->page, 'do=resetvotes').'" onclick="ajaxResetDelVotes(); return false;">Reset votes</a> |
899 <a href="'.makeUrl($paths->page, 'do=deletepage').'" onclick="ajaxDeletePage(); return false;">' . $lang->get('delvote_btn_deletepage') . '</a> | <a href="'.makeUrl($paths->page, 'do=resetvotes').'" onclick="ajaxResetDelVotes(); return false;">' . $lang->get('delvote_btn_resetvotes') . '</a> |
903 </div>'; |
900 </div>'; |
904 } |
901 } |
905 } |
902 } |
906 |
903 |
907 /** |
904 /** |