# HG changeset patch
# User Dan
# Date 1280519351 14400
# Node ID 4264ace0855fc338c9a2d04bdcf7bb9e57cab34a
# Parent dac5fad7ad6a9da27d62084aef7ff37122221daa
Files now list what pages use them
diff -r dac5fad7ad6a -r 4264ace0855f includes/namespaces/file.php
--- a/includes/namespaces/file.php Fri Jul 30 15:01:06 2010 -0400
+++ b/includes/namespaces/file.php Fri Jul 30 15:49:11 2010 -0400
@@ -188,6 +188,34 @@
$html .= '
';
}
$db->free_result();
+ $html .= '' . $lang->get('onpage_filebox_lbl_pagesusing') . '
';
+ $q = $db->sql_query('SELECT t.page_id, t.namespace, p.name FROM ' . table_prefix . "page_text AS t\n"
+ . " LEFT JOIN enano_pages AS p\n"
+ . " ON ( t.page_id = p.urlname AND t.namespace = p.namespace )\n"
+ . " WHERE t.page_text REGEXP '\\\\[\\\\[:" .
+ addslashes(preg_quote($paths->nslist[$this->namespace])) .
+ addslashes(preg_quote($this->page_id)) .
+ "(\\\\||\\\\])';");
+ if ( !$q )
+ $db->_die();
+
+ if ( $db->numrows() < 1 )
+ {
+ $html .= '' . $lang->get('onpage_filebox_msg_no_inlinks') . '
';
+ }
+ else
+ {
+ $html .= '' . $lang->get('onpage_filebox_msg_pagesusing') . '
';
+ $html .= '';
+ }
+ $db->free_result();
$html .= '
';
return $html;
}
diff -r dac5fad7ad6a -r 4264ace0855f language/english/core.json
--- a/language/english/core.json Fri Jul 30 15:01:06 2010 -0400
+++ b/language/english/core.json Fri Jul 30 15:49:11 2010 -0400
@@ -333,6 +333,9 @@
filebox_btn_this_version: 'this ver',
filebox_btn_revert: 'restore',
filebox_btn_current: 'current',
+ filebox_lbl_pagesusing: 'Pages using this file',
+ filebox_msg_pagesusing: 'The following pages embed this file:',
+ filebox_msg_no_inlinks: 'There are no pages that embed this file.',
protect_heading: 'Protect page',
protect_msg_select_level: 'Select a protection level:',