Skip to content

Commit bc761c0

Browse files
committed
Updated plugins to have class="plugin" and
Added the generate_admin_menu( $plugin ); just before the message so we can see the menu.
1 parent 14e995a commit bc761c0

10 files changed

+142
-39
lines changed

AMP_Global_topic.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@
2525
require PUN_ROOT.'include/search_idx.php';
2626

2727
if (empty($_POST['subject']) || empty($_POST['message']))
28+
{
29+
// Display the admin navigation menu
30+
generate_admin_menu( $plugin );
2831
message('Missing Fields');
32+
}
2933
if (!isset($_POST['forums']))
34+
{
35+
// Display the admin navigation menu
36+
generate_admin_menu( $plugin );
3037
message('No Forums Selected');
38+
}
3139

3240
$now = time();
3341
$i = 0;
@@ -156,7 +164,7 @@
156164
generate_admin_menu($plugin);
157165

158166
?>
159-
<div class="blockform">
167+
<div id="exampleplugin" class="plugin blockform">
160168
<h2><span>Global topic - <?php echo PLUGIN_VERSION ?></span></h2>
161169
<div class="box">
162170
<div class="inbox">

AMP_Remove_Users.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function EnableSubmit(s) {
129129
document.getElementById("btnSubmit").disabled = true;
130130
}
131131
</script>
132-
<div id="exampleplugin" class="blockform">
132+
<div id="exampleplugin" class="plugin blockform">
133133
<h2><span>Remove Users </span>v1.0</h2>
134134
<div class="box">
135135
<div class="inbox">

AP_Author_Update.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ function update_post_author($post_id, $user_id, $username)
130130
// Display the admin navigation menu
131131
generate_admin_menu($plugin);
132132
?>
133-
<div class="block">
133+
<div id="exampleplugin" class="plugin blockform">
134134
<h2><span>Author Update - v2.1</span></h2>
135135
<div class="box">
136136
<div class="inbox">
137137
<form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
138138
<p>This plugin modifies the author of one or more posts.
139-
<input type="submit" style="float: right; margin-top: -1.2em;" tabindex="1" <?php
139+
<input type="submit" style="float: right;" tabindex="1" <?php
140140
echo (isset($_POST['menu'])) ? 'name="menu_" value="Use Text Fields"' : 'name="menu" value="Use Menus"'; ?> />
141141
</p>
142142
</form>

AP_Backup.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function escape_keyword($str)
257257
generate_admin_menu($plugin);
258258

259259
?>
260-
<div id="exampleplugin" class="blockform">
260+
<div id="exampleplugin" class="plugin blockform">
261261
<h2><span><?php echo $lang_admin_plugin_backup['FluxBB Backup'] ?></span></h2>
262262
<div class="box">
263263
<div class="inbox">
@@ -284,7 +284,7 @@ function escape_keyword($str)
284284
<th scope="row"><?php echo $lang_admin_plugin_backup['Filesystem label'] ?></th>
285285
<td>
286286
<input type="radio" name="method" value="filesystem" />&#160;<?php echo $lang_admin_plugin_backup['Filesystem help'] ?>
287-
<span><?php echo $lang_admin_plugin_backu['Directory label'] ?>&#160;<input type="text" name="dir" size="50" value="<?php echo pun_htmlspecialchars(getcwd()); ?>" /></span>
287+
<span><?php echo $lang_admin_plugin_backup['Directory label'] ?>&#160;<input type="text" name="dir" size="50" value="<?php echo pun_htmlspecialchars(getcwd()); ?>" /></span>
288288
<span style="color:red"><?php echo $lang_admin_plugin_backup['Write access'] ?></span>
289289
</td>
290290
</tr>

AP_DB_management.php

+40-4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ function get_table_def_mysql($table, $crlf)
9898
$result = $db->query($field_query);
9999
if(!$result)
100100
{
101+
// Display the admin navigation menu
102+
generate_admin_menu( $plugin );
101103
message('Failed to get field list');
102104
}
103105

@@ -133,6 +135,8 @@ function get_table_def_mysql($table, $crlf)
133135
$result = $db->query($key_query);
134136
if(!$result)
135137
{
138+
// Display the admin navigation menu
139+
generate_admin_menu( $plugin );
136140
message('Failed to get Indexed Fields');
137141
}
138142

@@ -193,6 +197,8 @@ function get_table_content_mysql($table, $handler)
193197
// Grab the data from the table.
194198
if (!($result = $db->query("SELECT * FROM $table")))
195199
{
200+
// Display the admin navigation menu
201+
generate_admin_menu( $plugin );
196202
message('Failed to get table content');
197203
}
198204

@@ -389,6 +395,8 @@ function split_sql_file($sql, $delimiter)
389395
case 'mysqli':
390396
break;
391397
default:
398+
// Display the admin navigation menu
399+
generate_admin_menu( $plugin );
392400
message('Sorry your database type is not yet supported');
393401
}
394402
//Start actual db stuff
@@ -492,6 +500,8 @@ function split_sql_file($sql, $delimiter)
492500
$backup_file_type = (!empty($HTTP_POST_FILES['backup_file']['type'])) ? $HTTP_POST_FILES['backup_file']['type'] : "";
493501
if($backup_file_tmpname == "" || $backup_file_name == "")
494502
{
503+
// Display the admin navigation menu
504+
generate_admin_menu( $plugin );
495505
message('No file was uploaed or the upload failed, the database was not restored');
496506
}
497507
if( preg_match("/^(text\/[a-zA-Z]+)|(application\/(x\-)?gzip(\-compressed)?)|(application\/octet-stream)$/is", $backup_file_type) )
@@ -518,6 +528,8 @@ function split_sql_file($sql, $delimiter)
518528
}
519529
else
520530
{
531+
// Display the admin navigation menu
532+
generate_admin_menu( $plugin );
521533
message('Sorry the database could not be restored');
522534
}
523535
}
@@ -560,6 +572,8 @@ function split_sql_file($sql, $delimiter)
560572
$result = $db->query($sql);
561573
if(!$result)
562574
{
575+
// Display the admin navigation menu
576+
generate_admin_menu( $plugin );
563577
message('Error imported backup file, the database probably has not been restored');
564578
}
565579
}
@@ -589,6 +603,8 @@ function split_sql_file($sql, $delimiter)
589603
</div>
590604
<?php
591605
} else {
606+
// Display the admin navigation menu
607+
generate_admin_menu( $plugin );
592608
message('Restore Complete');
593609
}
594610
}
@@ -598,6 +614,8 @@ function split_sql_file($sql, $delimiter)
598614
$sql = 'SHOW TABLE STATUS';
599615
if (!$result = $db->query($sql))
600616
{
617+
// Display the admin navigation menu
618+
generate_admin_menu( $plugin );
601619
// This makes no sense, the board would be dead... :P
602620
message('Tables error, repair failed');
603621
}
@@ -616,16 +634,22 @@ function split_sql_file($sql, $delimiter)
616634
$sql = 'REPAIR TABLE ' . $tables[$i];
617635
if (!$result = $db->query($sql))
618636
{
637+
// Display the admin navigation menu
638+
generate_admin_menu( $plugin );
619639
message('SQL error, repair failed');
620640
}
621641
}
642+
// Display the admin navigation menu
643+
generate_admin_menu( $plugin );
622644
message('All tables repaired');
623645
}
624646
elseif (isset($_POST['optimizeall'])) {
625647
// Retrieve table list:
626648
$sql = 'SHOW TABLE STATUS';
627649
if (!$result = $db->query($sql))
628650
{
651+
// Display the admin navigation menu
652+
generate_admin_menu( $plugin );
629653
// This makes no sense, the board would be dead... :P
630654
message('Tables error, optimise failed');
631655
}
@@ -644,9 +668,13 @@ function split_sql_file($sql, $delimiter)
644668
$sql = 'OPTIMIZE TABLE ' . $tables[$i];
645669
if (!$result = $db->query($sql))
646670
{
671+
// Display the admin navigation menu
672+
generate_admin_menu( $plugin );
647673
message('SQL error, optimise failed');
648674
}
649675
}
676+
// Display the admin navigation menu
677+
generate_admin_menu( $plugin );
650678
message('All tables optimised');
651679
}
652680
elseif (isset($_POST['submit'])) {
@@ -655,6 +683,8 @@ function split_sql_file($sql, $delimiter)
655683
$this_query = $_POST['this_query'];
656684
if (empty($this_query))
657685
{
686+
// Display the admin navigation menu
687+
generate_admin_menu( $plugin );
658688
//no query error
659689
message('No Query Duh!');
660690
}
@@ -685,6 +715,8 @@ function split_sql_file($sql, $delimiter)
685715
$result = $db->query($query);
686716
if (!$result)
687717
{
718+
// Display the admin navigation menu
719+
generate_admin_menu( $plugin );
688720
//query error
689721
message('SQL Error');
690722
}
@@ -694,6 +726,8 @@ function split_sql_file($sql, $delimiter)
694726
if ($db->num_rows($result))
695727
{
696728
if ($db->num_rows($result) > 500) {
729+
// Display the admin navigation menu
730+
generate_admin_menu( $plugin );
697731
message('Query result too long to be displayed');
698732
}
699733
// Remember the number of fields (aka columns) and the number of rows:
@@ -743,7 +777,7 @@ function split_sql_file($sql, $delimiter)
743777
else {
744778
generate_admin_menu($plugin);
745779
?>
746-
<div class="block">
780+
<div id="exampleplugin" class="plugin blockform">
747781
<h2><span>Database management - v<?php echo PLUGIN_VERSION ?></span></h2>
748782
<div class="box">
749783
<div class="inbox">
@@ -775,6 +809,8 @@ function split_sql_file($sql, $delimiter)
775809
$sql = 'SHOW TABLE STATUS';
776810
if (!$result = $db->query($sql))
777811
{
812+
// Display the admin navigation menu
813+
generate_admin_menu( $plugin );
778814
message('Tables error');
779815
}
780816
$pun_tables = array('bans', 'categories', 'censoring', 'config', 'forum_perms', 'forums', 'groups', 'online', 'posts', 'ranks', 'reports', 'search_cache', 'search_matches', 'search_words', 'subscriptions', 'topics', 'users');
@@ -818,7 +854,7 @@ function split_sql_file($sql, $delimiter)
818854
</div>
819855
</fieldset>
820856
</div>
821-
<p class="submitend"><input type="submit" name="backupstart" value="Start backup" class="mainoption" /></p>
857+
<p class="submittop"><input type="submit" name="backupstart" value="Start backup" class="mainoption" /></p>
822858
</form>
823859
<form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
824860
<div class="inform">
@@ -835,7 +871,7 @@ function split_sql_file($sql, $delimiter)
835871
</div>
836872
</fieldset>
837873
</div>
838-
<p class="submitend"><input type="submit" name="restore_start" value="Start restore" class="mainoption" /></p>
874+
<p class="submittop"><input type="submit" name="restore_start" value="Start restore" class="mainoption" /></p>
839875
</form>
840876
</div>
841877
<h2 class="block2"><span>Additional options</span></h2>
@@ -856,7 +892,7 @@ function split_sql_file($sql, $delimiter)
856892
</fieldset>
857893
</div>
858894
<div class="inform">
859-
<p class="submitend"><input type="submit" name="submit" value="Run query" /></p>
895+
<p class="submittop"><input type="submit" name="submit" value="Run query" /></p>
860896
<fieldset>
861897
<legend>Additional Functions</legend>
862898
<div class="infldset">

AP_Languages_and_styles.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ function RoundSigDigs($number, $sigdigs) {
3434
{
3535
// Do Post
3636
$db->query('UPDATE '.$db->prefix.'users SET language=\''.$_POST['form']['language'].'\' WHERE id>1') or error('Unable to set lang settings', __FILE__, __LINE__, $db->error());
37-
message('Languages Reset');
37+
redirect($_SERVER['REQUEST_URI'], 'Languages Reset');
3838
}
3939
elseif (isset($_POST['style']))
4040
{
4141
// Do Post
4242
$db->query('UPDATE '.$db->prefix.'users SET style=\''.$_POST['form']['style'].'\' WHERE id>1') or error('Unable to set style settings', __FILE__, __LINE__, $db->error());
43-
message('Styles Reset');
43+
redirect($_SERVER['REQUEST_URI'], 'Styles Reset');
4444
}
4545
else // If not, we show the form
4646
{
4747
// Display the admin navigation menu
4848
generate_admin_menu($plugin);
4949

5050
?>
51-
<div class="block">
51+
<div id="exampleplugin" class="plugin blockform">
5252
<h2><span>Language and style statistics/resetter - v<?php echo PLUGIN_VERSION ?></span></h2>
5353
<div class="box">
5454
<div class="inbox">

AP_Merge_Forums.php

+24-1
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,43 @@
2323

2424
// Make sure a forum was specified.
2525
if (trim($forum1) == '')
26+
{
27+
// Display the admin navigation menu
28+
generate_admin_menu( $plugin );
2629
message('You never specified a forum to merge from.');
30+
}
2731

2832
if (trim($forum2) == '')
33+
{
34+
// Display the admin navigation menu
35+
generate_admin_menu( $plugin );
2936
message('You never specified a forum to merge to.');
37+
}
3038

3139
//Make sure the forum specified exists
3240
$result = $db->query("SELECT * FROM ".$db->prefix."forums WHERE id=".$forum1);
3341
if ($db->num_rows($result) == '0')
42+
{
43+
// Display the admin navigation menu
44+
generate_admin_menu( $plugin );
3445
message('The forum you specified to merge from does not exist.');
46+
}
3547

3648
$result = $db->query("SELECT * FROM ".$db->prefix."forums WHERE id=".$forum2);
3749
if ($db->num_rows($result) == '0')
50+
{
51+
// Display the admin navigation menu
52+
generate_admin_menu( $plugin );
3853
message('The forum you specified to merge to does not exist.');
54+
}
3955

4056
//Make sure the forums being merged aren't the same
4157
if ($forum1 == $forum2)
58+
{
59+
// Display the admin navigation menu
60+
generate_admin_menu( $plugin );
4261
message('The forums you specified are the same.');
62+
}
4363

4464
//Run the update query.
4565
$db->query("UPDATE ".$db->prefix."topics set forum_id=".$forum2." where forum_id=".$forum1);
@@ -71,14 +91,17 @@
7191
generate_admin_menu($plugin);
7292

7393
?>
74-
<div id="mergeplugin" class="blockform">
94+
<div id="mergeplugin" class="plugin blockform">
7595
<h2><span>Merge Forums Plugin</span></h2>
7696
<div class="box">
7797
<div class="inbox">
7898
<p>This plugin merges two forums into one. It then deletes the old forum.</p>
7999
</div>
80100
</div>
101+
</div>
81102

103+
<div class="blockform">
104+
<h2 class="block2"><span>Merge Forums</span></h2>
82105
<div class="box">
83106
<form id="merge" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
84107
<div class="inform">

AP_PunBB_Shell.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
?>
2323

2424

25-
<div class="block">
25+
<div id="exampleplugin" class="plugin blockform">
2626
<h2><span>PunBB Shell</span></h2>
2727
<div class="box">
2828
<div class="inbox">

0 commit comments

Comments
 (0)