function parse_num($xml, $tag) { $x = parse_element($xml, $tag); if (!$x) { return 0; } return $x; }
function show_totals() { $fn = "boinc_state.xml"; if (!file_exists($fn) || filemtime($fn) < time() - 86400) { $x = file_get_contents("http://boincstats.com/en/xml/boincState"); if ($x) { $f = fopen($fn, "w"); fwrite($f, $x); } else { return; } } $x = file_get_contents($fn); $users = parse_element($x, "<participants_active>"); $hosts = parse_element($x, "<hosts_active>"); $credit_day = parse_element($x, "<credit_day>"); $users = number_format($users); $hosts = number_format($hosts); $petaflops = number_format($credit_day / 200000000, 3); echo tra("Active:") . " {$users} " . tra("volunteers,") . " {$hosts} " . tra("computers.\n") . " <br>" . tra("24-hour average:") . " {$petaflops} " . tra("PetaFLOPS.") . "\n <hr size=1 width=\"80%\">\n "; }
$xmldoc = $resultunit->xml_doc_out; $nroffiles = 0; $cursor = 0; while ($tempfileinfo = parse_next_element($xmldoc, "<file_info>", &$cursor)) { $outputfiles[$nroffiles++] = parse_element($tempfileinfo, "<name>"); } if ($nroffiles >= 1) { $fanoutnr = parse_config($config, "<uldl_dir_fanout>"); row1("Output of this job"); row2("Number of output files of job: ", $nroffiles); for ($index = 0; $index < $nroffiles; ++$index) { $filename = $outputfiles[$index]; $url = "upload/" . fan_out_dir($filename, $fanoutnr) . "/" . $filename; $outputfilelink = '<a href="' . $url . '">' . $filename . '</a>'; row2("Output file " . ($index + 1) . ": ", $outputfilelink); } } $jobstderr = parse_element($resultunit->stderr_out, "<stderr_txt>"); if ($jobstderr) { row1("Error output of this job"); row2("", $jobstderr); } } } $max_jobs = max_nr_of_jobs_of_user($user); $njobs = nr_of_jobs_of_user($user); row1("Commands"); row2("", '<a href="queue_remove_job.php?workunitid=' . $workunit->id . '">Kill or Remove this job</a>'); row2("", '<a href="queue_show_queue.php">Go back to queue</a>'); end_table(); admin_page_tail();
$host = parse_element($thisxml, "<host>"); if ($host == "") { $host = $project_host; } $cmd = parse_element($thisxml, "<cmd>"); list($cmd) = explode(" ", $cmd); $log = parse_element($thisxml, "<output>"); if (!$log) { $log = $cmd . ".log"; } list($log) = explode(".log", $log); $pid = parse_element($thisxml, "<pid_file>"); if (!$pid) { $pid = $cmd . ".pid"; } $disabled = parse_element($thisxml, "<disabled>"); // surrogate for command list($c) = explode(".", $log); show_daemon_status($host, $pid, $c, $disabled); } $xmlstring = " </daemon_status>\n <database_file_states>\n"; if ($xml) { echo $xmlstring; } else { echo "\n <tr><td align=right><b>" . tra("Running:") . "</b></td>\n <td colspan=2>" . tra("Program is operating normally") . "</td></tr>\n <tr><td align=right><b>" . tra("Not Running:") . "</b></td>\n <td colspan=2>" . tra("Program failed or the project is down") . "</td></tr>\n <tr><td align=right><b>" . tra("Disabled:") . "</b></td>\n <td colspan=2>" . tra("Program is disabled") . "</td></tr>\n </table>\n </td>\n <td valign=top>\n <h2>" . tra("Computing status") . "</h2>\n "; } $retval = db_init_aux(); if ($retval) { echo tra("The database server is not accessible"); } else { if (!$xml) {
function parse_team($f) { while ($s = fgets($f)) { if (strstr($s, '</team>')) { $t->name = htmlspecialchars_decode($t->name); $t->url = htmlspecialchars_decode($t->url); $t->name_html = htmlspecialchars_decode($t->name_html); $t->description = htmlspecialchars_decode($t->description); $t->user_name = htmlspecialchars_decode($t->user_name); $t->user_country = htmlspecialchars_decode($t->user_country); $t->user_postal_code = htmlspecialchars_decode($t->user_postal_code); $t->user_url = htmlspecialchars_decode($t->user_url); return $t; } else { if (strstr($s, '<name>')) { $t->name = parse_element($s, '<name>'); } else { if (strstr($s, '<url>')) { $t->url = parse_element($s, '<url>'); } else { if (strstr($s, '<type>')) { $t->type = parse_element($s, '<type>'); } else { if (strstr($s, '<name_html>')) { $t->name_html = parse_element($s, '<name_html>'); } else { if (strstr($s, '<description>')) { while ($s = fgets($f)) { if (strstr($s, '</description>')) { break; } $t->description .= $s; } } else { if (strstr($s, '<country>')) { $t->country = parse_element($s, '<country>'); } else { if (strstr($s, '<id>')) { $t->id = parse_element($s, '<id>'); } else { if (strstr($s, '<user_email_munged>')) { $user_email_munged = parse_element($s, '<user_email_munged>'); $t->user_email = str_rot13($user_email_munged); } else { if (strstr($s, '<user_name>')) { $t->user_name = parse_element($s, '<user_name>'); } else { if (strstr($s, '<user_country>')) { $t->user_country = parse_element($s, '<user_country>'); } else { if (strstr($s, '<user_postal_code>')) { $t->user_postal_code = parse_element($s, '<user_postal_code>'); } else { if (strstr($s, '<user_url>')) { $t->user_url = parse_element($s, '<user_url>'); } } } } } } } } } } } } } } return null; }
function xmldb_hiperbook_upgrade($oldversion = 0) { /// This function does anything necessary to upgrade /// older versions to match current functionality global $CFG, $THEME, $db; ini_set('memory_limit', '300M'); // alter tables execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `template_main` TEXT NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `template_hw` TEXT NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `template_tips` TEXT NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `template_suggs` TEXT NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `template_css` TEXT NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_hotwords_top` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_tips_top` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_suggestions_top` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_links_top` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_hotwords_icon` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_tips_icon` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_suggestions_icon` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_links_icon` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `opentostudents` INT( 2 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_top_popup` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_page_next` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_page_prev` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_separador_toc` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_active_start` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_active_middle` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_active_end` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_inactive_start` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_inactive_middle` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook ADD `img_navpath_inactive_end` VARCHAR( 255 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters ADD `userid` INT( 11 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_hotword ADD `idhiperbook` INT( 11 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_hotword ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_hotword ADD `userid` INT( 11 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_hotword ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_links ADD `idpage` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_links ADD `idtargetpageid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_links ADD `target_navigation_chapter` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_pages ADD `idhiperbook` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_pages ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_pages ADD `userid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_pages ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_suggestions ADD `idhiperbook` INT( 11 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_suggestions ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_suggestions ADD `userid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_suggestions ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_tips ADD `idhiperbook` INT( 11 ) NULL'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_tips ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_tips ADD `userid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_chapters_tips ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_navigationpath ADD `groupid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_navigationpath ADD `userid` INT( 11 ) DEFAULT 0'); execute_sql('ALTER TABLE ' . $CFG->prefix . 'hiperbook_navigationpath ADD `opentostudents` INT( 1 ) DEFAULT 0'); execute_sql('CREATE TABLE IF NOT EXISTS `' . $CFG->prefix . 'hiperbook_pages_hotwords` ( `id` int(11) NOT NULL auto_increment, `idpage` int(11) NOT NULL, `idhotword` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 '); execute_sql('CREATE TABLE IF NOT EXISTS `' . $CFG->prefix . 'hiperbook_pages_suggestions` ( `id` int(11) NOT NULL auto_increment, `idpage` int(11) NOT NULL, `idsuggestion` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1'); execute_sql('CREATE TABLE IF NOT EXISTS `' . $CFG->prefix . 'hiperbook_pages_tips` ( `id` int(11) NOT NULL auto_increment, `idpage` int(11) NOT NULL, `idtip` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1'); // cria tabelas //if ($oldversion < 2008101625) { if (true) { $hiperlivros = get_records_select('hiperbook'); foreach ($hiperlivros as $hlivro) { $module = get_record('modules', 'name', 'hiperbook'); $cm = get_record('course_modules', 'instance', $hlivro->id, 'module', $module->id); $chapters = get_records_select('hiperbook_chapters', 'bookid=' . $hlivro->id); foreach ($chapters as $chapter) { echo 'Processando capitulo ' . $chapter->title . ' de ' . $hlivro->name; $paginas = get_records_select('hiperbook_chapters_pages', 'chapterid=' . $chapter->id); //var_dump($paginas); $links = get_records_select('hiperbook_chapters_links', 'chapterid=' . $chapter->id . ' and idtargetpageid=0'); $hotwords = get_records_select('hiperbook_chapters_hotword', 'chapterid=' . $chapter->id); $tips = get_records_select('hiperbook_chapters_tips', 'chapterid=' . $chapter->id); $suggestions = get_records_select('hiperbook_chapters_suggestions', 'chapterid=' . $chapter->id); foreach ($suggestions as $hotword) { execute_sql('update ' . $CFG->prefix . 'hiperbook_chapters_suggestions set idhiperbook = ' . $hlivro->id . ' where id =' . $hotword->id); } foreach ($hotwords as $hotword) { execute_sql('update ' . $CFG->prefix . 'hiperbook_chapters_hotword set idhiperbook = ' . $hlivro->id . ' where id =' . $hotword->id); } foreach ($tips as $hotword) { execute_sql('update ' . $CFG->prefix . 'hiperbook_chapters_tips set idhiperbook = ' . $hlivro->id . ' where id =' . $hotword->id); } foreach ($paginas as $page) { echo 'Processando página ' . $page->pagenum; foreach ($hotwords as $hotword) { // verifica se o titulo esta no conteudo da pagina // se estiver cria relacionamento page_hotword if (parse_element($page->content, $hotword->title)) { $ph->idpage = $page->id; $ph->idhotword = $hotword->id; $newchapterid = insert_record('hiperbook_pages_hotwords', $ph); } } foreach ($tips as $hotword) { // verifica se o titulo esta no conteudo da pagina // se estiver cria relacionamento page_hotword if (parse_element($page->content, $hotword->title)) { $ph->idpage = $page->id; $ph->idtip = $hotword->id; $newchapterid = insert_record('hiperbook_pages_tips', $ph); } } foreach ($suggestions as $hotword) { // verifica se o titulo esta no conteudo da pagina // se estiver cria relacionamento page_hotword if (parse_element($page->content, $hotword->title)) { $ph->idpage = $page->id; $ph->idsuggestion = $hotword->id; $newchapterid = insert_record('hiperbook_pages_suggestions', $ph); } } foreach ($links as $link) { // verifica se o link esta no conteudo na pagina atual // se estiver adidiona relacionamento page if (parse_element($page->content, $link->title)) { $link->idpage = $page->id; $target_page = get_record('hiperbook_chapters_pages', 'chapterid', $link->targetchapterid, 'pagenum', '1'); //var_dump($target_page); echo $target_page->id; $link->idtargetpageid = $target_page->id; $target_navigation_chapter = get_record('hiperbook_navigation_chapters', 'chapterid', $link->targetchapterid); $link->target_navigation_chapter = $target_navigation_chapter->id; $newchapterid = update_record('hiperbook_chapters_links', $link); } } execute_sql('update ' . $CFG->prefix . 'hiperbook_chapters_pages set idhiperbook = ' . $hlivro->id . ' where id =' . $page->id); //atualiza o esquema de background das paginas $conteudo = str_replace('background="' . $CFG->wwwroot . '/file.php//template_hiperbook' . $hlivro->id . '/template_hiperlivro.gif"', 'background="images/template_hiperlivro.gif"', $page->content); $conteudo = str_replace('background="images/template_hiperlivro.gif"', 'background="' . $CFG->wwwroot . '/file.php/' . $cm->course . '/template_hiperbook' . $hlivro->id . '/template_hiperlivro.gif"', $conteudo); $conteudo = addslashes($conteudo); execute_sql("update " . $CFG->prefix . "hiperbook_chapters_pages set content = '" . $conteudo . "' where id =" . $page->id); // update_record('hiperbook_chapters_pages', $page ); } // processou paginas do capitulo } // preocessou capitulo, apaga os links correspondentes iniciais com idtargetpageid= 0 // $links = get_records_select('hiperbook_chapters_links', 'chapterid=' . $chapter->id .' and idtargetpageid= 0'); // copia a pasta template_hiperbook para a pasta do curso //adiciona o template_css do hiperlivro echo 'COpiando template para' . $CFG->dataroot . '/' . $cm->course . '/template_hiperbook' . $hlivro->id; mkdir($CFG->dataroot . '/' . $cm->course); mkdir($CFG->dataroot . '/' . $cm->course . '/template_hiperbook' . $hlivro->id); $directory = opendir($CFG->dirroot . '/mod/hiperbook/template_libras/'); // Find all files while (false !== ($file = readdir($directory))) { if ($file == "." || $file == "..") { continue; } copy($CFG->dirroot . '/mod/hiperbook/template/' . $file, $CFG->dataroot . '/' . $cm->course . '/template_hiperbook' . $hlivro->id . "/" . $file); } $hlivro->template_css = "\r\n\r\nbody {\r\n\tmargin-left: 0px;\r\n\tmargin-top: 0px;\r\n\tmargin-right: 0px;\r\n\tmargin-bottom: 0px;\r\n}\r\n\r\n#mod-hiperbook-hotword #page{\r\n\tmargin-top:0px;\r\n\tpadding-top:0px;\r\n\tbackground-color:white;\r\n}\r\n\r\n#mod-hiperbook-tips #page #header,\r\n#mod-hiperbook-suggestions #page #header,\r\n#mod-hiperbook-hotwords #page #header {\r\n\tdisplay:none;\r\n\t\r\n\t\r\n}\r\n\r\n.hiperbook_content a, .hiperbook_content a:link, .hiperbook_content a:visited{\r\n\ttext-decoration:underline;\r\n color:#00477F;\r\n\r\n}\r\n\r\n#mod-hiperbook-bibliography #page{\r\n\t\r\n\t}\r\n\t\r\n\t#mod-hiperbook-bibliography #header{\r\n\t display:none;\r\n\t}\r\n\r\n\r\n#mod-hiperbook-popup #bookname{\r\n\tposition:absolute;\r\n\ttop:25px;\r\n\tleft:5px;\r\n\tfont-weight:bold;\r\n\tfont-style:italic;\t\r\n\tfont-size:14px;\r\n\ttext-align:left;\r\n} \r\n\r\n.mod-hiperbook #navpaths{\r\n\tmargin-top:10px;\r\n\tmargin-left:10px;\r\n\tdisplay:block;\r\n}\r\n\r\n.mod-hiperbook #navpaths #current{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\t\r\n\tfont-size:13px;\r\n\tcolor:white;\t\r\n\theight:22px;\r\n}\r\n.mod-hiperbook #navpaths #current #main{\r\n\tbackground-color:#233E54;\t\r\n\tdisplay:inline;\r\n\ttext-align:center;\r\n\tpadding:2px;\r\n\tpadding-bottom:3px;\r\n\tfont-weight:bold;\r\n}\r\n\r\n.mod-hiperbook #navpaths #current #start{\r\n\tbackground-position:center;\r\n\tbackground-repeat:no-repeat;\r\n\tdisplay:inline;\r\n\tpadding:2px;\t\r\n\tpadding-bottom:3px;\r\n}\r\n\r\n.mod-hiperbook #navpaths #current #end{\r\n\tbackground-repeat:no-repeat;\r\n\tdisplay:inline;\r\n\r\n}\r\n\r\n\r\n\t\r\n\t\r\n.mod-hiperbook #navpaths #past{\r\n\r\n\t\r\n}\r\n\t\r\n\t\r\n.mod-hiperbook #navpaths #past #main{\t\r\n\tbackground-position:center;\r\n\tbackground-repeat:repeat-x;\r\n background-color:#2C4F6B;\r\n\tdisplay:inline;\r\n\ttext-align:center;\r\npadding: 2px;\r\npadding-bottom: 3px;\r\n}\r\n\r\n.mod-hiperbook #navpaths #past #main a{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\ttext-decoration:none;\r\n\tfont-size:13px;\r\n\tcolor:#8FB4DF;\t\t\r\n\tbackground-position:center;\t\r\n}\r\n\r\n.mod-hiperbook #navpaths #past #start{\r\n\tbackground-position:center;\r\n\tbackground-repeat:no-repeat;\r\n\tdisplay:inline;\r\n\tpadding-right:0px\r\n\r\n\t\r\n}\r\n\r\n.mod-hiperbook #navpaths #past #end{\r\n\tbackground-position:center;\r\n\tbackground-repeat:no-repeat;\r\n\tdisplay:inline;\t\r\n\tpadding-left:0px\r\n\r\n}\r\n\r\n.mod-hiperbook #breadcrumbs{\r\n\theight:18px;\r\n\tmargin-left:10px;\r\n}\r\n\r\n.mod-hiperbook #breadcrumbs #current{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-weight:bold;\r\n\tfont-size:12px;\r\n}\r\n\r\n.mod-hiperbook #breadcrumbs #current #main{\r\n\tdisplay:inline;\r\n\ttext-align:center;\r\n\r\n}\r\n.mod-hiperbook #breadcrumbs #current #start{\r\n\tdisplay:inline;\r\n\tfont-weight:normal;\t\r\n}\r\n.mod-hiperbook #breadcrumbs #current #end{\r\n\tdisplay:inline;\r\n}\r\n\r\n.mod-hiperbook #breadcrumbs #past{\r\n\r\n\r\n}\r\n.mod-hiperbook #breadcrumbs #past a{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\ttext-decoration:none;\r\n\tfont-size:12px;\r\n\r\n\tcolor:#00477F;\r\n}\r\n\t\r\n\r\n.mod-hiperbook #breadcrumbs #past #main{\t\r\n\tdisplay:inline;\r\n\ttext-align:center;\r\n\tbackground-position:center;\r\n\t\r\n}\r\n.mod-hiperbook #breadcrumbs #past #start{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\ttext-decoration:none;\r\n\tfont-size:12px;\r\n\tdisplay:inline;\t\r\n\t\r\n}\r\n.mod-hiperbook #breadcrumbs #past #end{\r\n\tdisplay:inline;\r\n}\r\n\r\n\r\n\r\n.mod-hiperbook #page_navigation{\r\n\ttext-align:center;\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-size:12px;\r\n}\r\n.mod-hiperbook #page_navigation img{\r\n\ttext-align:center;\r\n\tcolor:black;\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-weight:bold;\r\n\tvertical-align:middle;\r\n}\r\n\r\n.mod-hiperbook #toc{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-weight:bold;\r\n\tfont-size:12px;\r\n\tpadding-left:18px;\r\n\tcolor:#00477F;\t\r\n\twidth:150px;\r\n\r\n}\r\n\r\n.mod-hiperbook #toc #item a{\r\n\ttext-align:left;\r\n\ttext-decoration:none;\r\n\tfont-weight:bold;\r\n color:#00477F;\r\n}\r\n\r\n.mod-hiperbook #toc #item a:visited{\r\n\tcolor:#8FB4DF;\r\n}\r\n\r\n.mod-hiperbook #toc #item{\t\r\n\r\n}\r\n\r\n.mod-hiperbook .hiperbook_content{\r\n\twidth:500px;\r\n\r\n}\r\n.hiperbook_content .hotwordslist{\r\n\t\r\n\tpadding-top:70px;\r\n}\r\n.mod-hiperbook .hiperbook_content #template_main{\r\n\tbackground-color:#efefef;\r\n}\r\n\r\n.mod-hiperbook .hiperbook_content #template_top_left{\r\n\tbackground-image:url(" . $CFG->wwwroot . "/file.php/" . $cm->course . "/template_hiperbook" . $hlivro->id . "/top_conteudo_left.png);\r\n\tbackground-repeat:no-repeat;\r\n}\r\n\r\n.mod-hiperbook .hiperbook_content #template_top_right{\r\n\tbackground-image:url(" . $CFG->wwwroot . "/file.php/" . $cm->course . "/template_hiperbook" . $hlivro->id . "/top_conteudo_right.png);\r\n\tbackground-repeat:no-repeat;\r\n\tbackground-position:right;\r\n\r\n}\r\n.mod-hiperbook .hiperbook_content #template_bottom_left{\r\n\tbackground-image:url(" . $CFG->wwwroot . "/file.php/" . $cm->course . "/template_hiperbook" . $hlivro->id . "/bottom_conteudo_left.png);\r\n\tbackground-repeat:no-repeat;\r\n\r\n}\r\n.mod-hiperbook .hiperbook_content #template_bottom_right{\r\n\tbackground-image:url(" . $CFG->wwwroot . "/file.php/" . $cm->course . "/template_hiperbook" . $hlivro->id . "/bottom_conteudo_right.png);\r\n\tbackground-repeat:no-repeat;\r\n\t\tbackground-position:right;\r\n\r\n}\r\n\r\n.hiperbook_content .hotwordslist{\r\n\twidth:100%;\r\n\tborder:0px;\r\n\tcolor:#003366;\r\n}\r\n\r\n.hiperbook_content .hotwordslist .title a{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-size:12px;\r\n\tfont-weight:bold;\r\n\tpadding-left:46px;\t\r\n}\r\n.hiperbook_content .hotwordslist .title {\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-size:12px;\r\n\tfont-weight:bold;\r\n\tpadding-top:23px;\r\n\tpadding-bottom:23px;\r\n}\r\n\r\n.hiperbook_content .hotwordslist .content{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tfont-size:12px;\r\n\tpadding-left:92px;\r\n\tpadding-right:46px;\r\n}\r\n\r\n\r\n#botoesLateral{\r\n\twidth:250px;\r\n\tmargin-left:170px;\r\n\tmargin-top:10px;\r\n}\r\n\r\n#mod-hiperbook-tips #page {\t\r\n\tpadding-top:0px;\r\n\tmargin-top:0px;\r\n\t\r\n}\r\n.book_chapter_title {\r\n font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;\r\n text-align: left;\r\n font-size: large;\r\n font-weight: bold;\r\n margin-left: 0px;\r\n margin-bottom: 0px;\r\n}\r\n\r\n.book_content {\r\n text-align: left;\r\n}\r\n.book_toc_none ul {\r\n margin-left: 0px;\r\n padding-left: 0px;\r\n}\r\n.book_toc_none ul ul {\r\n margin-left: 0px;\r\n padding-left: 0px;\r\n}\r\n.book_toc_none li {\r\n margin-top: 0px;\r\n list-style: none;\r\n}\r\n.book_toc_none li li {\r\n margin-top: 0px;\r\n list-style: none;\r\n}\r\n\r\n#mod-hiperbook-popup #page{\r\n\tmargin-top:0px;\r\n\tpadding-top:0px;\r\n\tbackground-color:white;\r\n}\r\n\r\n.mod-hiperbook #bookname{\r\n\tfont-weight:bold;\r\n\tfont-style:italic;\t\r\n\tfont-size:14px;\r\n\tmargin-bottom:15px;\r\n} \r\n.mod-hiperbook, a{\r\n\tcolor:#00477F;\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\tborder-collapse:collapse;\r\n\tborder:0px;\r\n}\r\n\r\n\r\n.mod-hiperbook a:link, .mod-hiperbook a:visited, .mod-hiperbook a{\r\n\tfont-family:Verdana, Arial, Helvetica, sans-serif;\r\n\ttext-decoration:underline;\r\n}\r\n\r\n.mod-hiperbook #breadcrumbs a:link, .mod-hiperbook #breadcrumbs a:visited, .mod-hiperbook #breadcrumbs a{\r\n\ttext-decoration:none;\r\n\tcolor:#00477F;\r\n}\r\n\r\ntable {\r\nborder-collapse:collapse;\r\nborder-spacing:0;\r\n}\r\n\r\n\r\n"; $hlivro->template_main = '<table width="540" height="268" border="0" background="' . $CFG->wwwroot . "/file.php/" . $cm->course . "/template_hiperbook" . $hlivro->id . '/template_hiperlivro.png"> <tbody> <tr height="20"> <td height="20" id="template_top_left"> </td> <td width="240" height="20" id="template_main"> </td> <td width="20" height="20" id="template_main"> </td> <td width="240" height="20" id="template_main"> </td> <td height="20" id="template_top_right"> </td> </tr> <tr id="template_main"> <td width="20" height="195"> </td> <td valign="top" colspan="3"> <div align="center"></div> <div align="center"></div><br /> </td> <td width="20"> </td> </tr> <tr id="template_main"> <td id="template_main"> </td> <td id="template_main"><br /> </td> <td id="template_main"> </td> <td id="template_main"> </td> <td id="template_main"> </td> </tr> <tr> <td height="20" id="template_bottom_left"> </td> <td height="20" id="template_main"> </td> <td height="20" id="template_main"> </td> <td height="20" id="template_main"> </td> <td height="20" id="template_bottom_right"> </td> </tr> </tbody> </table>'; $hlivro->template_hw = ''; $hlivro->template_tips = ''; $hlivro->template_suggs = ''; $hlivro->img_hotwords_top = 'title_hotwords.png'; $hlivro->img_tips_top = 'title_tips.png'; $hlivro->img_suggestions_top = 'title_suggestions.png'; $hlivro->img_links_top = 'title_links.png'; $hlivro->img_hotwords_icon = "icone_glossario.png"; $hlivro->img_tips_icon = "icone_dicas.png"; $hlivro->img_suggestions_icon = "icone_sugestoes_de_estudo.png"; $hlivro->img_links_icon = "icone_links.png"; $hlivro->img_top_popup = 'top.png'; $hlivro->img_page_next = 'next.png'; $hlivro->img_page_prev = 'back.png'; $hlivro->img_separador_toc = 'separador_toc.png'; $hlivro->img_navpath_active_start = 'navpath_current_start.png'; $hlivro->img_navpath_active_middle = 'navpath_current.png'; $hlivro->img_navpath_active_end = 'navpath_current_end.png'; $hlivro->img_navpath_inactive_start = 'navpath_past_start.png'; $hlivro->img_navpath_inactive_middle = 'navpath_past.png'; $hlivro->img_navpath_inactive_end = 'navpath_past_end.png'; $hlivro->opentostudents = 0; update_record('hiperbook', $hlivro); } // define target_navigation_chapter em chapters_links // target_navigation_chapter = primeiro navchapterid referente ao navigation_chapter com navchapter.chapterid = link.targetchapterid $links = get_records_select('hiperbook_chapters_links', 'targetchapterid!=0'); foreach ($links as $link) { $navchapterids = get_records_select('hiperbook_navigation_chapters', 'chapterid =' . $link->targetchapterid); $link->target_navigation_chapter = $navchapterids->id; // update_record('hiperbook_chapters_links', $link); } } return true; }
if (!$user) { echo "No such user"; } else { echo "<b>" . tra("This account will belong to the team %1 and will have the project preferences of its founder.", "<a href=\"team_display.php?teamid={$team->id}\">{$team->name}</a>") . "</b><p>"; echo "\n <input type=\"hidden\" name=\"teamid\" value=\"{$teamid}\">\n "; } } start_table(); // Using invitation codes to restrict access? // if (defined('INVITE_CODES')) { row2(tra("Invitation Code") . "<br><span class=\"description\">" . tra("A valid invitation code is required to create an account.") . "</span>", "<input type=\"text\" name=\"invite_code\" size=\"30\" >"); } row2(tra("Name") . "<br><span class=\"description\">" . tra("Identifies you on our web site. Use your real name or a nickname.") . "</span>", "<input type=\"text\" name=\"new_name\" size=\"30\">"); row2(tra("Email Address") . "<br><span class=\"description\">" . tra("Must be a valid address of the form 'name@domain'.") . "</span>", "<input type=\"text\" name=\"new_email_addr\" size=\"50\">"); $min_passwd_length = parse_element($config, "<min_passwd_length>"); if (!$min_passwd_length) { $min_passwd_length = 6; } row2(tra("Password") . "<br><span class=\"description\">" . tra("Must be at least %1 characters", $min_passwd_length) . "</span>", "<input type=\"password\" name=\"passwd\">"); row2(tra("Confirm password"), "<input type=\"password\" name=\"passwd2\">"); row2_init(tra("Country") . "<br><span class=\"description\">" . tra("Select the country you want to represent, if any.") . "</span>", "<select name=\"country\">"); print_country_select(); echo "</select></td></tr>\n"; row2(tra("Postal or ZIP Code") . "<br><span class=\"description\">" . tra("Optional") . "</span>", "<input type=\"text\" name=\"postal_code\" size=\"20\">"); // Check if we need reCaptcha for making more safe the creation of accounts $publickey = parse_config($config, "<recaptcha_public_key>"); if ($publickey) { row2(tra("Please enter the words shown in the image"), recaptcha_get_html($publickey)); } row2("", "<input type=\"submit\" value=\"" . tra("Create account") . "\">");
for ($index = 0; $index < $nrofresults; ++$index) { $resultunit = mysql_fetch_object($resultunitquery); $jobstderr = parse_element($resultunit->stderr_out, "<stderr_txt>"); if ($jobstderr) { row1("Error output of this job"); row2("", $jobstderr); } } } else { $resultunit = mysql_fetch_object(mysql_query("SELECT * FROM result WHERE id=" . $workunit->canonical_resultid)); $xmldoc = $resultunit->xml_doc_out; $jobstderr = parse_element($resultunit->stderr_out, "<stderr_txt>"); $nroffiles = 0; $cursor = 0; while ($tempfileinfo = parse_next_element($xmldoc, "<file_info>", &$cursor)) { $outputfiles[$nroffiles++] = parse_element($tempfileinfo, "<name>"); } if ($nroffiles >= 1) { $fanoutnr = parse_config($config, "<uldl_dir_fanout>"); row1("Output of this job"); row2("Number of output files of job: ", $nroffiles); for ($index = 0; $index < $nroffiles; ++$index) { $filename = $outputfiles[$index]; $url = "upload/" . fan_out_dir($filename, $fanoutnr) . "/" . $filename; $outputfilelink = '<a href="' . $url . '">' . $filename . '</a>'; row2("Output file " . ($index + 1) . ": ", $outputfilelink); } } if ($jobstderr) { row1("Error output of this job"); row2("", $jobstderr);
if ($confObj == null) { echo "1, 保存失败,配置文件为空"; return; } try { // parse the vars $varlist = $confObj["vars"]; $varObjlist = array(); foreach ($varlist as $element) { $var = new Varible(); $var->set($element[0], $element[1]); array_push($varObjlist, $var); } // parse steps and collects $stepObjlist = parse_element("step", $confObj); $collectObjlist = parse_element("collect", $confObj); $config = new Config($file_path); $config->varibles = $varObjlist; $config->steps = $stepObjlist; $config->collects = $collectObjlist; $config->write(); echo "0, 配置文件保存成功"; } catch (Exception $e) { echo "1, 配置文件保存失败:" + $e; } // 从字典confObj中将配置文件的step与collect信息写入到类Element当中 function parse_element($type, $confObj) { $elementlist = array(); if ("step" == $type) { $objlist = $confObj["steps"];
<?php // fix DB damage caused by a bug introduced in [21181]. // If you ran a server using code between this and [21812], run this script. $cli_only = true; require_once "../inc/db.inc"; set_time_limit(0); db_init_aux(); $config = get_config(); $mjd = parse_element($config, "daily_result_quota"); if (!$mjd) { $mjd = 100; } function do_query($query) { echo "Doing query:\n{$query}\n"; $result = mysql_query($query); if (!$result) { echo "Failed:\n" . mysql_error() . "\n"; } else { echo "Success.\n"; } } do_query("update host_app_version set turnaround_var=0, turnaround_q=0"); do_query("update host_app_version set max_jobs_per_day={$mjd} where max_jobs_per_day>{$mjd} or max_jobs_per_day<0"); do_query("update host_app_version set consecutive_valid=0 where consecutive_valid<0 or consecutive_valid>1000");