2 define( 'YOURLS_ADMIN', true );
\r
3 require_once( dirname(dirname(__FILE__)).'/includes/load-yourls.php' );
\r
4 yourls_maybe_require_auth();
\r
6 yourls_html_head( 'plugins' );
\r
14 $plugins = (array)yourls_get_plugins();
\r
15 $count = count( $plugins );
\r
18 <p>You currently have <strong><?php echo $count.' '.yourls_plural( 'plugin', $count ); ?></strong> activated on your setup.</p>
\r
20 <table id="tblUrl" class="tblSorter" cellpadding="0" cellspacing="1">
\r
23 <th>Plugin Name</th>
\r
25 <th>Description</th>
\r
32 foreach( $plugins as $location=>$plugin ) {
\r
34 // default fields to read from the plugin header
\r
36 'name' => 'Plugin Name',
\r
37 'uri' => 'Plugin URI',
\r
38 'desc' => 'Description',
\r
39 'version' => 'Version',
\r
40 'author' => 'Author',
\r
41 'author_uri' => 'Author URI'
\r
44 $location = str_replace( dirname( YOURLS_ABSPATH ) .'/', '', $location );
\r
46 // Loop through all default fields, get value if any and reset it
\r
47 foreach( $fields as $field=>$value ) {
\r
48 if( $plugin[ $value ] ) {
\r
49 $data[ $field ] = $plugin[ $value ];
\r
51 $data[ $field ] = '(no info)';
\r
53 unset( $plugin[$value] );
\r
56 // Other "Fields: Value" in the header? Get them too
\r
58 foreach( $plugin as $extra_field=>$extra_value ) {
\r
59 $data['desc'] .= "<br/>\n<em>$extra_field</em>: $extra_value";
\r
60 unset( $plugin[$extra_value] );
\r
64 $data['desc'] .= "<br/><small>plugin location: $location</small>";
\r
66 printf( "<tr><td><a href='%s'>%s</a></td><td>%s</td><td>%s</td><td><a href='%s'>%s</a></td></tr>",
\r
67 $data['uri'], $data['name'], $data['version'], $data['desc'], $data['author_uri'], $data['author']
\r
75 <script type="text/javascript">
\r
76 yourls_defaultsort = 0;
\r
77 yourls_defaultorder = 0;
\r
80 <p>To deactivate a plugin, simply delete its directory, or rename the plugin file to something different than <code>plugin.php</code>
\r
83 <?php yourls_html_footer(); ?>