');
- }
- elseif(isset($_POST['up'])) {
- // If there is only one theme or if the selected theme is already at the top, do nothing
- $q = 'SELECT theme_order FROM '.table_prefix.'themes ORDER BY theme_order;';
- $s = $db->sql_query($q);
- if(!$s) die('Error selecting order information: '.$db->get_error().' SQL: '.$q);
- $q = 'SELECT theme_order FROM '.table_prefix.'themes WHERE theme_id=\''.$db->escape($_POST['theme_id']).'\'';
- $sn = $db->sql_query($q);
- if(!$sn) die('Error selecting order information: '.$db->get_error().' SQL: '.$q);
- $r = $db->fetchrow_num($sn);
- if( /* check for only one theme... */ $db->numrows($s) < 2 || $r[0] == 1 /* ...and check if this theme is already at the top */ ) { echo('
This theme is already at the top of the list, or there is only one theme installed.
'); } else {
- // Get the order IDs of the selected theme and the theme before it
- $q = 'SELECT theme_order FROM '.table_prefix.'themes WHERE theme_id=\'' . $db->escape($_POST['theme_id']) . '\'';
- $s = $db->sql_query($q);
- if(!$s) die('Error selecting order information: '.$db->get_error().' SQL: '.$q);
- $r = $db->fetchrow_num($s);
- $r = $r[0];
- $rb = $r - 1;
- // Thank God for jEdit's rectangular selection and the ablity to edit multiple lines at the same time ;)
- $q = 'UPDATE '.table_prefix.'themes SET theme_order=0 WHERE theme_order='.$rb.''; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- $q = 'UPDATE '.table_prefix.'themes SET theme_order='.$rb.' WHERE theme_order='.$r.''; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- $q = 'UPDATE '.table_prefix.'themes SET theme_order='.$r.' WHERE theme_order=0'; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- echo('
Theme moved up.
');
- }
- $db->free_result($s);
- $db->free_result($sn);
- }
- elseif(isset($_POST['down'])) {
- // If there is only one theme or if the selected theme is already at the top, do nothing
- $q = 'SELECT theme_order FROM '.table_prefix.'themes ORDER BY theme_order;';
- $s = $db->sql_query($q);
- if(!$s) die('Error selecting order information: '.$db->get_error().' SQL: '.$q);
- $r = $db->fetchrow_num($s);
- if( /* check for only one theme... */ $db->numrows($s) < 2 || $r[0] == $db->numrows($s) /* ...and check if this theme is already at the bottom */ ) { echo('
This theme is already at the bottom of the list, or there is only one theme installed.
'); } else {
- // Get the order IDs of the selected theme and the theme before it
- $q = 'SELECT theme_order FROM '.table_prefix.'themes WHERE theme_id=\''.$db->escape($_POST['theme_id']).'\'';
- $s = $db->sql_query($q);
- if(!$s) die('Error selecting order information: '.$db->get_error().' SQL: '.$q);
- $r = $db->fetchrow_num($s);
- $r = $r[0];
- $rb = $r + 1;
- // Thank God for jEdit's rectangular selection and the ablity to edit multiple lines at the same time ;)
- $q = 'UPDATE '.table_prefix.'themes SET theme_order=0 WHERE theme_order='.$rb.''; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- $q = 'UPDATE '.table_prefix.'themes SET theme_order='.$rb.' WHERE theme_order='.$r.''; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- $q = 'UPDATE '.table_prefix.'themes SET theme_order='.$r.' WHERE theme_order=0'; /* Check for errors... */ $s = $db->sql_query($q); if(!$s) die('Error updating order information: '.$db->get_error().' SQL: '.$q);
- echo('
');
-}
+/*
+ * Admin:ThemeManager sources are in /plugins/admin/ThemeManager.php.
+ */
/*
* Admin:GroupManager sources are in /plugins/admin/GroupManager.php.