include_once('../migration.conf.php');
include_once('../db_link.dbi.php');
include_once('../update_functions.php');

// time management for this script
$time_start = getmicrotime();

// add column "has_html" to table "files"
echo ('CommSy database, table files: insert file size.'."\n");
$success = true;

$count = array_shift(mysql_fetch_row(select('SELECT COUNT(files_id) FROM files WHERE size="0"')));
if ($count < 1) {
   echo "<br/>nothing to do.";
} else {
   init_progress_bar($count);

   $query  = "SELECT * FROM files WHERE size='0'";
   $success = select($query);

   $query  = 'SELECT files_id, files.context_id, filename, room.context_id AS portal_id FROM files INNER JOIN room ON files.context_id=room.item_id WHERE size="0"';
   $result = select($query);
   $row = mysql_fetch_row($result);
   $item_id = $row[0];
   $context_id = $row[1];
   $filename = $row[2];
   $portal_id = $row[3];
   while ($item_id) {
      $filename_on_disc = '../../var/'.$portal_id.'/'.$context_id.'/cid'.$context_id.'_'.$item_id.'_'.$filename;
      if (file_exists($filename_on_disc)) {
         $size = filesize($filename_on_disc);
include_once('../migration.conf.php');
include_once('../db_link.dbi.php');
include_once('../update_functions.php');

// time management for this script
$time_start = getmicrotime();

// move configuration of ads from cs_config to database
echo ('This script cleans up the ontology in the &lt;HOMECONF&gt;'."\n");
$success = true;

$count_project = array_shift(mysql_fetch_row(select("SELECT COUNT(room.item_id) FROM room WHERE extras LIKE '%ontology_%';")));
if ($count_project < 1) {
   echo "<br/>nothing to do.";
} else {
   init_progress_bar($count_project);

   // project projects
   $query  = "SELECT room.item_id,extras FROM room WHERE extras LIKE '%ontology_%' ORDER BY room.item_id;";
   $result = select($query);
   $row = mysql_fetch_row($result);
   $project_id = $row[0];
   $extra = $row[1];
   while ($project_id) {
      $treffer = array();
      $treffer2 = array();
      $home_conf_exist = preg_match('~(<HOMECONF>(.+)</HOMECONF>)~u', $extra, $treffer);
      if ($home_conf_exist == true) {
         if (mb_strpos($extra,'ontology_')!=false){
            $home_conf_string = str_replace(',ontology_short','',$treffer[2]);
            $home_conf_string = str_replace(',ontology_tiny','',$home_conf_string);
if ($do_it) {
   $result = mysql_query($query);
   if ($error = mysql_error() ) {
      echo $error.". QUERY: ".$query;
      $success = false;
   }
} else {
   echo ('<br /><br />QUERY: '.$query);
}

// first get all rooms not deleted
$count_rooms = array_shift(mysql_fetch_row(mysql_query("SELECT COUNT(room.item_id) FROM room WHERE room.deletion_date IS NULL;")));
if ($count_rooms < 1) {
   echo "<br />nothing to do.";
} else {
   init_progress_bar($count_rooms);
   $query  = "SELECT room.item_id FROM room WHERE room.deletion_date IS NULL ORDER BY room.item_id;";
   $result = mysql_query($query);
   if ( $error = mysql_error() ) {
      echo ('<hr>'.$error.". QUERY: ".$query.'<hr>');
   }
   $row = mysql_fetch_row($result);
   $room_id = $row[0];
   while ($room_id) {
      // get group all for room
      $query  = "SELECT labels.item_id FROM labels WHERE labels.context_id='".$room_id."' AND labels.name='ALL';";
      $result2 = mysql_query($query);
      if ( $error = mysql_error() ) {
         echo ('<hr>'.$error.". QUERY: ".$query.'<hr>');
      }
      $row2 = mysql_fetch_row($result2);
Example #4
0
   if ( !isset($translator) ) {
      $translator = $environment->getTranslationObject();
   }
   $text_converter = $environment->getTextConverter();
   echo($text_converter->encode(AS_HTML_SHORT,$translator->getMessage('FILE_ZIP_UPLOAD_PROCESS_TITLE',$file->getDisplayName())).BRLF);
   flush();
   #######################################
   # process-bar 1
   #######################################

   $namearray = listfilenames($pfad,2,$file,$environment,$namearray);

   #######################################
   # process-bar 2
   #######################################
   init_progress_bar(count_for_process($namearray),$translator->getMessage('FILE_ZIP_UPLOAD_PROCESS_DESC'));
   #######################################
   # process-bar 2
   #######################################

   replace_files($pfad,2,$file,$environment,$namearray);

   #######################################
   # process-bar 3
   #######################################
   echo('</div>'.LF);
   echo('<style type="text/css">'.LF.'div.process { display: none; }'.LF.'</style>'.LF);
   flush();
   #######################################
   # process-bar 3
   #######################################
Example #5
0
         global $c_pmwiki_absolute_path_file;
         $str = "<?php include('".$c_pmwiki_absolute_path_file."/pmwiki.php');?>";
         file_put_contents($directory.'/'.$entry,$str);
         update_progress_bar($count);
      }
   }
}

include_once('../migration.conf.php');
include_once('../db_link.dbi.php');
include_once('../update_functions.php');

// time management for this script
$time_start = getmicrotime();

// add column "has_html" to table "files"
echo ('wiki: change path in index.php'."\n");
$success = true;

@include_once('../../etc/commsy/pmwiki.php');
if ( !empty($c_pmwiki_absolute_path_file) ) {
   if ( is_dir($c_pmwiki_absolute_path_file) ) {
      $num = countWikis($c_pmwiki_absolute_path_file.'/wikis');
      init_progress_bar($num);
      changeWikis($c_pmwiki_absolute_path_file.'/wikis',$num);
   }
}

// end of execution time
echo(getProcessedTimeInHTML($time_start));
?>
   $sql_array = array();
   foreach (  $must_sort_father_array as $father_id ) {
      $sql = 'SELECT * FROM tag WHERE item_id IN ('.implode(',',$children_array[$father_id]).') ORDER BY title';
      $result = select($sql);
      $new_place_array = array();
      $place = 0;
      while ( $row = mysql_fetch_assoc($result) ) {
         $place++;
         $new_place_array[$row['item_id']] = $place;
      }
      foreach ($children_array[$father_id] as $child_id) {
         if ( !empty($new_place_array[$child_id]) ) {
            $sql = 'UPDATE tag2tag SET sorting_place='.$new_place_array[$child_id].' WHERE from_item_id='.$father_id.' AND to_item_id='.$child_id.';';
            $sql_array[] = $sql;
         }
      }
   }
   init_progress_bar(count(array_unique($sql_array)));
   foreach ( array_unique($sql_array) as $sql ) {
      $result = select($sql);
      update_progress_bar(count(array_unique($sql_array)));
   }
} else {
   echo('<br/>nothing to do'."\n");
}

// end of execution time
$time_end = getmicrotime();
$time = round($time_end - $time_start,3);
echo "<br/>Execution time: ".mb_sprintf("%02d:%02d:%02d", (int)($time/3600), (int)(fmod($time,3600)/60), (int)fmod(fmod($time,3600), 60))."\n";
?>
Example #7
0
echo(LINEBREAK);

$sql = 'SHOW TABLES;';
$result = select($sql,false,'utf8');
unset($sql);
$utf8_table_array = array();
while ($row = mysql_fetch_assoc($result) ) {
   if ( stristr($row['Tables_in_'.$DB_Name],'utf8_') ) {
      $utf8_table_array[] = $row['Tables_in_'.$DB_Name];
   }
}
mysql_free_result($result);
unset($result);
unset($row);

init_progress_bar(count($utf8_table_array));
foreach ( $utf8_table_array as $table ) {
   $sql = 'SHOW FULL COLUMNS FROM '.$table.';';
   $result = select($sql,false,'utf8');
   unset($sql);
   $column_array = array();
   while ($row = mysql_fetch_assoc($result) ) {
       $column_array[] = $row;
   }
   mysql_free_result($result);
   unset($result);
   unset($row);

   $sql  = 'DROP TABLE IF EXISTS '.str_replace('utf8_','',$table).';';
   $success_array[] = select($sql,false,'utf8');
   unset($sql);
Example #8
0
chdir('..');

include_once('../update_functions.php');

chdir('../..');

include_once('etc/cs_config.php');

echo('this script checks the php syntax<hr/>');
flush();

echo('count files: ');
flush();

$count_files = countFilesInDir('.');
echo($count_files);
echo('<br/>');
flush();

init_progress_bar($count_files);

$result_array = runFilesInDir('.');
if ( empty($result_array) ) {
   echo('<br/>'.'keinen Fehler gefunden');
} else {
   echo('<br/>'.'Fehler gefunden:');
   foreach ($result_array as $error) {
      echo('<br/>'.$error);
   }
}
?>