BoonEx Home Trac
 
 

Changeset 7

Show
Ignore:
Timestamp:
10/18/07 04:58:09 (11 months ago)
Author:
SergeyZ
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/.htaccess

    r5 r7  
    33RewriteEngine on 
    44 
    5 # RewriteRule ^profile\.php rewrite_name.php [L] 
    65RewriteCond %{REQUEST_FILENAME} -f [OR] 
    76RewriteCond %{REQUEST_FILENAME} -d 
    87RewriteRule .+ - [L] 
    9 RewriteRule [A-Za-z0-9_-]+ rewrite_name.php [L] 
     8RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L] 
    109</IfModule> 
  • trunk/admin/basic_settings.php

    r5 r7  
    543543            </td> 
    544544        </tr> 
     545                <tr> 
     546                <td align="right" width="40%"> <?=getParamDesc("top_members_max_num") ?>: </td> 
     547            <td align="left"> 
     548                <input type="text" class="no" name="top_members_max_num" size="15" value="<?= htmlspecialchars(getParam('top_members_max_num')) ?>" /> 
     549            </td> 
     550        </tr> 
    545551    </table> 
    546552    <br> 
     
    559565    setParam('featured_mode', $_POST['featured_mode']); 
    560566    setParam('featured_num', $_POST['featured_num']); 
     567        setParam('top_members_max_num', $_POST['top_members_max_num']); 
    561568    ?> 
    562569    <div class="succ">Index page parameters successfully changed.</div><br /> 
  • trunk/admin/browseMusic.php

    r5 r7  
    156156        $sCode .= '</div>'; 
    157157        $sCode .= '<div class="clear_both"></div>'; 
    158         $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Approve"></div>'; 
     158        $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Change status"></div>'; 
    159159         
    160160        // generate pagination 
  • trunk/admin/browsePhoto.php

    r5 r7  
    157157        $sCode .= '</div>'; 
    158158        $sCode .= '<div class="clear_both"></div>'; 
    159         $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Approve"></div>'; 
     159        $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Change status"></div>'; 
    160160         
    161161        // generate pagination 
  • trunk/admin/browseVideo.php

    r5 r7  
    155155        $sCode .= '</div>'; 
    156156        $sCode .= '<div class="clear_both"></div>'; 
    157         $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Approve"></div>'; 
     157        $sCode .= '<div class="bottomPart"><input type="submit" name="Delete" value="Delete"><input type="submit" name="Approve" value="Change status"></div>'; 
    158158         
    159159        // generate pagination 
  • trunk/admin/db.php

    r5 r7  
    11<?php 
    2  
     2                 
    33/*************************************************************************** 
    44*                            Dolphin Smart Community Builder 
     
    2222require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    2323require_once( BX_DIRECTORY_PATH_INC . 'admin_design.inc.php' ); 
     24require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolDatabaseBackup.php'); 
    2425 
    2526$logged['admin'] = member_auth( 1 ); 
     
    2829$_page['header_text'] = "Manage Database"; 
    2930 
    30 $copyright =  '#############################################################################'; 
    31 $copyright =  '#                            Dolphin Web Community Software'; 
    32 $copyright =  '#     begin                : Mon Mar 23 2006'; 
    33 $copyright =  '#     copyright            : (C) 2007 BoonEx Group'; 
    34 $copyright =  '#     website              : http://www.boonex.com'; 
    35 $copyright =  '#'; 
    36 $copyright =  '#############################################################################'; 
    37 $copyright =  '#############################################################################'; 
    38 $copyright =  '#'; 
    39 $copyright =  '#   This is a free software; you can modify it under the terms of BoonEx '; 
    40 $copyright =  '#   Product License Agreement published on BoonEx site at http://www.boonex.com/downloads/license.pdf'; 
    41 $copyright =  '#   You may not however distribute it for free or/and a fee. '; 
    42 $copyright =  '#   This notice may not be removed from the source code. You may not also remove any other visible '; 
    43 $copyright =  '#   reference and links to BoonEx Group as provided in source code.'; 
    44 $copyright =  '#'; 
    45 $copyright =  '#############################################################################'; 
    46 $copyright .= "#        Default character set is: ".db_get_encoding()."\n"; 
    47 $copyright .= "#        MySQL client info: ".mysql_get_client_info()."\n"; 
    48 $copyright .= "#        MySQL host info: ".mysql_get_host_info()."\n"; 
    49 $copyright .= "#        MySQL protocol version: ".mysql_get_proto_info()."\n"; 
    50 $copyright .= "#        MySQL server version: ".mysql_get_server_info()."\n"; 
    51 $copyright .= "\n\n\n"; 
    52  
    5331set_time_limit( 36000 ); 
    5432 
    55 // backup type dependent data ouput 
    56 function output_backup_data( $data ) 
    57 
    58         global $fp; 
    59         global $status_text; 
    60  
    61         if ( 'server' == $_POST['savetype'] ) 
    62         { 
    63                 $fres = fwrite($fp, $data); 
    64                 if ( $fres === false ) 
    65                         $status_text .= "Cannot write to file!\n"; 
    66         } 
    67         elseif ( 'client' == $_POST['savetype'] ) 
    68         { 
    69                 print $data; 
    70         } 
    71         elseif ( 'show' == $_POST['savetype'] ) 
    72         { 
    73                 print htmlspecialchars($data); 
    74         } 
     33$status_text .= ''; 
     34if (isset($_POST['TablesBackup'])) { ##Block of table backup create 
     35                //echo "For: Tables Tools". $_POST['tbl_op'] . ' Table - ' . $_POST['tbl'] . ' Show param - ' . $_POST['savetype'] ;  
     36 
     37                $OutPutType  = preg_replace("/[^0-9]/", '', $_POST['tbl_op']); 
     38                $oNewBackup = new BxDolDatabaseBackup(); 
     39                $oNewBackup -> _getTableStruct($_POST['tbl'],  $OutPutType);  
     40                 
     41                if ($_POST['savetype'] == 'client') { 
     42                                $sqlfile = date("Y-m-d_H:i:s").'_'.$_POST['tbl'].'.sql'; 
     43                                header("Content-Type: text/plain"); 
     44                                header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); 
     45                                echo $oNewBackup -> sInputs; 
     46                                exit(); 
     47                        } 
     48                if ($_POST['savetype'] == 'server') { 
     49                                        $sqlfile = $dir['root'].'backup/'.date("Y-m-d_H-i-s").'_'.$_POST['tbl'].'.sql'; 
     50                                        $file = fopen($sqlfile, 'w'); 
     51                                        fputs($file, $oNewBackup -> sInputs); 
     52                                        $status_text .= "<hr size=1 /><font color='green'><center>Data succefully dumped into file <b>{$sqlfile}</b></center></font>\n"; 
     53                                        fclose($file); 
     54                        }        
     55                if ($_POST['savetype'] == 'show') { 
     56                                $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>"; 
     57                        }                
     58                 
     59         } 
     60 
     61if (isset($_POST['DatabasesBackup'])) { 
     62                $OutPutType  = preg_replace("/[^0-9]/", '', $_POST['db_op']);  
     63                $oNewBackup = new BxDolDatabaseBackup(); 
     64                $oNewBackup ->  _getAllTables($OutPutType);  
     65                 
     66                if ($_POST['savetype'] == 'show') { 
     67                                $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>"; 
     68                }                
     69                if ($_POST['savetype'] == 'server') { 
     70                                        $sqlfile = $dir['root'].'backup/'.date("Y-m-d_H-i-s").'_all.sql'; 
     71                                        $file = fopen($sqlfile, 'w'); 
     72                                        fputs($file, $oNewBackup -> sInputs); 
     73                                        $status_text .= "<hr size=1 /><font color='green'><center>Data succefully dumped into file <b>{$sqlfile}</b></center></font>\n"; 
     74                                        fclose($file); 
     75                }        
     76                if ($_POST['savetype'] == 'client') { 
     77                                $sqlfile = date("Y-m-d_H:i:s").'_all.sql'; 
     78                                header("Content-Type: text/plain"); 
     79                                header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); 
     80                                echo $oNewBackup -> sInputs; 
     81                                exit(); 
     82                } 
     83}        
     84 
     85 if (isset($_POST['DatabasesRestore'])) {  
     86        if ($_POST['savetype'] == 'delete') { 
     87                if(is_file($dir['root'].'backup/'.$_POST['dump_file'])) { 
     88                   @unlink($dir['root'].'backup/'.$_POST['dump_file']); 
     89                   $status_text .= "<hr size=1 /><font color='green'><center>Dump file  succefully deleted <b>{$sqlfile}</b></center></font>\n"; 
     90                } 
     91                else $status_text .= "<hr size=1 /><font color='red'><center>Please select dump file  <b>{$sqlfile}</b></center></font>\n";      
     92    } 
     93        if ($_POST['savetype'] == 'restore') { 
     94                 
     95                if(is_file($dir['root'].'backup/'.$_POST['dump_file'])) { 
     96                                $oNewBackup = new BxDolDatabaseBackup(); 
     97                                $oNewBackup ->  _restoreFromDumpFile($dir['root'].'backup/'.$_POST['dump_file']);  
     98                                $status_text .= "<hr size=1 /><font color='green'><center>Data succefully restored from server dump</center></font>\n"; 
     99                 } 
     100                 else  $status_text .= "<hr size=1 /><font color='red'><center>Please select dump file  <b>{$sqlfile}</b></center></font>\n"; 
     101                  
     102    } 
     103  }      
     104 
     105if (isset($_FILES['sqlfile'])) { 
     106          if (preg_match("/.sql/", $_FILES['sqlfile']['name'])) { #it is correct 
     107              $oNewBackup = new BxDolDatabaseBackup(); 
     108                  $oNewBackup ->        _restoreFromDumpFile($_FILES['sqlfile']['tmp_name'] );  
     109                  @unlink($_FILES['sqlfile']['tmp_name']); 
     110                  $status_text .= "<hr size=1 /><font color='green'><center>Data succefully restored from your PS </center></font>\n"; 
     111          } 
     112         else  $status_text .= "<hr size=1 /><font color='red'><center>Please select correct dump file (only *.sql)</center></font>\n"; 
    75113} 
    76  
    77 // make table or database backup 
    78 function make_backup() 
    79 
    80         // make table back 
    81         if ( "YES" == $_POST['TablesBackup'] ) 
    82         { 
    83                 if ( "0" == $_POST['tbl_op'] ) 
    84                 { 
    85                         backup_table_structure($_POST['tbl']); 
    86                 } 
    87                 elseif ( "1" == $_POST['tbl_op'] ) 
    88                 { 
    89                         backup_table_content($_POST['tbl']); 
    90                 } 
    91                 elseif ( "2" == $_POST['tbl_op'] ) 
    92                 { 
    93                         backup_table($_POST['tbl']); 
    94                 } 
    95         } 
    96  
    97         // make database backup 
    98         if ( "YES" == $_POST['DatabasesBackup'] ) 
    99         { 
    100                 if ( "0" == $_POST['db_op'] ) 
    101                 { 
    102                         backup_database_structure($_POST['tbl']); 
    103                 } 
    104                 elseif ( "1" == $_POST['db_op'] ) 
    105                 { 
    106                         backup_database($_POST['tbl']); 
    107                 } 
    108         } 
    109 
    110  
    111 $status_text = ''; 
    112 $db_backup = ("YES" == $_POST['DatabasesBackup']); 
    113 $table_backup = ("YES" == $_POST['TablesBackup']); 
    114 $table_show_flag = false; 
    115 $db_show_flag = false; 
    116 if ( !$demo_mode && ($db_backup || $table_backup) ) 
    117 
    118         if ( "server" == $_POST['savetype'] ) 
    119         { 
    120                 if ( $table_backup ) 
    121                         $sqlfile = $dir['root'].'backup/'.date("Y-m-d_H-i-s").'_'.$_POST['tbl'].'.sql'; 
    122                 else 
    123                         $sqlfile = $dir['root'].'backup/db_'.date("Y-m-d_H-i-s").'.sql'; 
    124                 if ( ($fp = @fopen($sqlfile, 'w')) === false ) 
    125                 { 
    126                         $status_text .= "Cannot open file <b>{$sqlfile}</b>!\n"; 
    127                 } 
    128                 else 
    129                 { 
    130                         output_backup_data( $copyright ); 
    131  
    132                         make_backup(); 
    133  
    134                         $status_text .= "Data succefully dumped into file <b>{$sqlfile}</b>\n"; 
    135                         fclose($fp); 
    136                 } 
    137         } 
    138         else if ( "client" == $_POST['savetype'] ) 
    139         { 
    140                 $sqlfile = date("Y-m-d_H:i:s").'_'.$_POST['tbl'].'.sql'; 
    141  
    142                 header("Content-Type: text/plain"); 
    143                 // header("Content-Length: ".filesize($file)); 
    144                 header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); 
    145  
    146                 output_backup_data( $copyright ); 
    147  
    148                 make_backup(); 
    149  
    150                 exit(); 
    151         } 
    152         else if ( "show" == $_POST['savetype']) 
    153         { 
    154                 if ( $table_backup ) 
    155                         $table_show_flag = true; 
    156                 else 
    157                         $db_show_flag = true; 
    158         } 
    159 
    160  
     114         
    161115TopCodeAdmin(); 
    162 /* 
    163 ContentBlockHead("Please Pay Attention"); 
    164 ?> 
    165 <b>Attention!!!</b> Before backup anything please read our manual.<br /> 
    166 You can find it here: <a href="http://www.aewebworks.com/login/howto.php?action=topic&amp;id=44">How To</a> 
    167 <? 
    168 ContentBlockFoot(); 
    169 */ 
    170 ContentBlockHead("Tables Tools"); 
    171  
    172  
    173 if ( strlen($status_text) && $table_backup ) 
    174         echo " 
     116 
     117ContentBlockHead('Tables backup tools'); 
     118?> 
     119 
    175120<center> 
    176         <div style=\"margin: 6px;\" class=\"err\">{$status_text}</div> 
    177 </center>"; 
    178 ?> 
    179  
    180 <center> 
    181 <form style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px" method="post" action="<? echo $_SERVER[PHP_SELF]; ?>"> 
     121 
     122<form style="padding: 0px; margin: 0px;" method="post" action="<?= $_SERVER['PHP_SELF'] ?>"> 
    182123        <input type="hidden" name="TablesBackup" value="YES" /> 
    183         <table width="100%" cellspacing="2" cellpadding="3" class="text"> 
    184                 <tr class="panel"> 
    185                         <td colspan="2">&nbsp;<b>Tables backup tools</b></td> 
    186                 </tr> 
    187                 <tr class="table"> 
    188                         <td colspan="2" align="center" width="50%">Choose operation and table:</td> 
     124        <table width="100%" border="0" cellspacing="2" cellpadding="3" class="text"> 
     125                <tr> 
     126                        <td align="center" colspan="2">Choose operation and table:</td> 
    189127                </tr> 
    190128                <tr class="table"> 
    191129                        <td align="right" width="50%"> 
    192130                                <select name="tbl_op"> 
     131                                        <option value="2">Backup structure and content</option> 
    193132                                        <option value="0">Backup structure only</option> 
    194133                                        <option value="1">Backup content only</option> 
    195                                         <option value="2">Backup structure and content</option> 
    196134                                </select> 
    197135                        </td> 
    198136                        <td align="left" width="50%"> 
    199137                                <select name="tbl"> 
    200 <?php 
    201 $tbls = db_list_tables(); 
    202 while ($tbl = mysql_fetch_row($tbls)) 
    203 
    204         echo " 
    205                                         <option value=\"{$tbl['0']}\">{$tbl['0']}</option>"; 
    206 
    207  
    208 ?> 
     138                                <?php 
     139                                $tbls = db_list_tables(); ##Draw aviable tables in Database 
     140                                while ($tbl = mysql_fetch_row($tbls)) echo "<option value=\"{$tbl['0']}\">{$tbl['0']}</option>"; 
     141                                ?>       
    209142                                </select> 
    210143                        </td> 
     
    217150                        </td> 
    218151                </tr> 
     152                <tr> 
     153                <td colspan="2" align="center"><input type="submit" value="Backup table" class="no" /></td> 
     154                </tr> 
     155                 
     156                <?php 
     157                if ($status_text and isset($_POST['TablesBackup'])) { 
     158                        ?> 
     159                <tr> 
     160                        <td colspan="2"><?= $status_text ?></td> 
     161