@@ -98,6 +98,8 @@ function get_table_def_mysql($table, $crlf)
98
98
$ result = $ db ->query ($ field_query );
99
99
if (!$ result )
100
100
{
101
+ // Display the admin navigation menu
102
+ generate_admin_menu ( $ plugin );
101
103
message ('Failed to get field list ' );
102
104
}
103
105
@@ -133,6 +135,8 @@ function get_table_def_mysql($table, $crlf)
133
135
$ result = $ db ->query ($ key_query );
134
136
if (!$ result )
135
137
{
138
+ // Display the admin navigation menu
139
+ generate_admin_menu ( $ plugin );
136
140
message ('Failed to get Indexed Fields ' );
137
141
}
138
142
@@ -193,6 +197,8 @@ function get_table_content_mysql($table, $handler)
193
197
// Grab the data from the table.
194
198
if (!($ result = $ db ->query ("SELECT * FROM $ table " )))
195
199
{
200
+ // Display the admin navigation menu
201
+ generate_admin_menu ( $ plugin );
196
202
message ('Failed to get table content ' );
197
203
}
198
204
@@ -389,6 +395,8 @@ function split_sql_file($sql, $delimiter)
389
395
case 'mysqli ' :
390
396
break ;
391
397
default :
398
+ // Display the admin navigation menu
399
+ generate_admin_menu ( $ plugin );
392
400
message ('Sorry your database type is not yet supported ' );
393
401
}
394
402
//Start actual db stuff
@@ -492,6 +500,8 @@ function split_sql_file($sql, $delimiter)
492
500
$ backup_file_type = (!empty ($ HTTP_POST_FILES ['backup_file ' ]['type ' ])) ? $ HTTP_POST_FILES ['backup_file ' ]['type ' ] : "" ;
493
501
if ($ backup_file_tmpname == "" || $ backup_file_name == "" )
494
502
{
503
+ // Display the admin navigation menu
504
+ generate_admin_menu ( $ plugin );
495
505
message ('No file was uploaed or the upload failed, the database was not restored ' );
496
506
}
497
507
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)
518
528
}
519
529
else
520
530
{
531
+ // Display the admin navigation menu
532
+ generate_admin_menu ( $ plugin );
521
533
message ('Sorry the database could not be restored ' );
522
534
}
523
535
}
@@ -560,6 +572,8 @@ function split_sql_file($sql, $delimiter)
560
572
$ result = $ db ->query ($ sql );
561
573
if (!$ result )
562
574
{
575
+ // Display the admin navigation menu
576
+ generate_admin_menu ( $ plugin );
563
577
message ('Error imported backup file, the database probably has not been restored ' );
564
578
}
565
579
}
@@ -589,6 +603,8 @@ function split_sql_file($sql, $delimiter)
589
603
</div>
590
604
<?php
591
605
} else {
606
+ // Display the admin navigation menu
607
+ generate_admin_menu ( $ plugin );
592
608
message ('Restore Complete ' );
593
609
}
594
610
}
@@ -598,6 +614,8 @@ function split_sql_file($sql, $delimiter)
598
614
$ sql = 'SHOW TABLE STATUS ' ;
599
615
if (!$ result = $ db ->query ($ sql ))
600
616
{
617
+ // Display the admin navigation menu
618
+ generate_admin_menu ( $ plugin );
601
619
// This makes no sense, the board would be dead... :P
602
620
message ('Tables error, repair failed ' );
603
621
}
@@ -616,16 +634,22 @@ function split_sql_file($sql, $delimiter)
616
634
$ sql = 'REPAIR TABLE ' . $ tables [$ i ];
617
635
if (!$ result = $ db ->query ($ sql ))
618
636
{
637
+ // Display the admin navigation menu
638
+ generate_admin_menu ( $ plugin );
619
639
message ('SQL error, repair failed ' );
620
640
}
621
641
}
642
+ // Display the admin navigation menu
643
+ generate_admin_menu ( $ plugin );
622
644
message ('All tables repaired ' );
623
645
}
624
646
elseif (isset ($ _POST ['optimizeall ' ])) {
625
647
// Retrieve table list:
626
648
$ sql = 'SHOW TABLE STATUS ' ;
627
649
if (!$ result = $ db ->query ($ sql ))
628
650
{
651
+ // Display the admin navigation menu
652
+ generate_admin_menu ( $ plugin );
629
653
// This makes no sense, the board would be dead... :P
630
654
message ('Tables error, optimise failed ' );
631
655
}
@@ -644,9 +668,13 @@ function split_sql_file($sql, $delimiter)
644
668
$ sql = 'OPTIMIZE TABLE ' . $ tables [$ i ];
645
669
if (!$ result = $ db ->query ($ sql ))
646
670
{
671
+ // Display the admin navigation menu
672
+ generate_admin_menu ( $ plugin );
647
673
message ('SQL error, optimise failed ' );
648
674
}
649
675
}
676
+ // Display the admin navigation menu
677
+ generate_admin_menu ( $ plugin );
650
678
message ('All tables optimised ' );
651
679
}
652
680
elseif (isset ($ _POST ['submit ' ])) {
@@ -655,6 +683,8 @@ function split_sql_file($sql, $delimiter)
655
683
$ this_query = $ _POST ['this_query ' ];
656
684
if (empty ($ this_query ))
657
685
{
686
+ // Display the admin navigation menu
687
+ generate_admin_menu ( $ plugin );
658
688
//no query error
659
689
message ('No Query Duh! ' );
660
690
}
@@ -685,6 +715,8 @@ function split_sql_file($sql, $delimiter)
685
715
$ result = $ db ->query ($ query );
686
716
if (!$ result )
687
717
{
718
+ // Display the admin navigation menu
719
+ generate_admin_menu ( $ plugin );
688
720
//query error
689
721
message ('SQL Error ' );
690
722
}
@@ -694,6 +726,8 @@ function split_sql_file($sql, $delimiter)
694
726
if ($ db ->num_rows ($ result ))
695
727
{
696
728
if ($ db ->num_rows ($ result ) > 500 ) {
729
+ // Display the admin navigation menu
730
+ generate_admin_menu ( $ plugin );
697
731
message ('Query result too long to be displayed ' );
698
732
}
699
733
// Remember the number of fields (aka columns) and the number of rows:
@@ -743,7 +777,7 @@ function split_sql_file($sql, $delimiter)
743
777
else {
744
778
generate_admin_menu ($ plugin );
745
779
?>
746
- <div class="block ">
780
+ <div id="exampleplugin" class="plugin blockform ">
747
781
<h2><span>Database management - v<?php echo PLUGIN_VERSION ?> </span></h2>
748
782
<div class="box">
749
783
<div class="inbox">
@@ -775,6 +809,8 @@ function split_sql_file($sql, $delimiter)
775
809
$ sql = 'SHOW TABLE STATUS ' ;
776
810
if (!$ result = $ db ->query ($ sql ))
777
811
{
812
+ // Display the admin navigation menu
813
+ generate_admin_menu ( $ plugin );
778
814
message ('Tables error ' );
779
815
}
780
816
$ 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)
818
854
</div>
819
855
</fieldset>
820
856
</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>
822
858
</form>
823
859
<form enctype="multipart/form-data" method="post" action="<?php echo $ _SERVER ['REQUEST_URI ' ] ?> ">
824
860
<div class="inform">
@@ -835,7 +871,7 @@ function split_sql_file($sql, $delimiter)
835
871
</div>
836
872
</fieldset>
837
873
</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>
839
875
</form>
840
876
</div>
841
877
<h2 class="block2"><span>Additional options</span></h2>
@@ -856,7 +892,7 @@ function split_sql_file($sql, $delimiter)
856
892
</fieldset>
857
893
</div>
858
894
<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>
860
896
<fieldset>
861
897
<legend>Additional Functions</legend>
862
898
<div class="infldset">
0 commit comments