if ($api_response !== false) { $xml = simplexml_load_string($api_response); $this->responsetype = 'alert alert-success'; $this->responsecode = -1; $this->response = 'Data was uploaded with id: '; if (property_exists($xml->children('oml', true), 'code')) { $this->responsetype = 'alert alert-danger'; $this->responsecode = $xml->children('oml', true)->code; $this->response = 'Error ' . $this->responsecode . ': ' . $xml->children('oml', true)->message; if ($this->responsecode == '131') { $this->response .= ' Please fill in all required (red) fields, upload a file or give a URL (not both), and avoid spaces in the dataset name.'; } } else { if ($xml->children('oml', true)->id) { $this->response = '<h2><i class="fa fa-thumbs-o-up"></i> Thanks!</h2>Data was uploaded successfully (ID = ' . $xml->children('oml', true)->id . ')<br> You can now <b><a href="d/' . $xml->children('oml', true)->id . '"> follow your dataset on OpenML</a></b>, complete its description, track its impact, create OpenML tasks, and see all ensuing results.<br><br>You can also continue to add datasets below.'; sm($this->response); su('new/data'); } else { print "Something went wrong. Server says:<br>"; print $api_response; } } } else { $this->responsetype = 'alert alert-danger'; $this->response = 'Could not upload data. Please fill in all required (red) fields.'; } } elseif ($this->subpage == 'study') { $user_id = $this->ion_auth->user()->row()->id; $name = $this->input->post('study_name'); $description = $this->input->post('description'); $this->Study->create($name, $description, $user_id);
function main() { global $_PAGE; $s = isset($_GET["s"]) ? $_GET["s"] : 0; // web site only $k = isset($_GET["k"]) ? $_GET["k"] : 0; // _catid $n = isset($_GET["n"]) ? $_GET["n"] : $_PAGE; // per page, n-count $f = isset($_GET["f"]) ? $_GET["f"] : 0; // from $ww = isset($_GET["w"]) ? $_GET["w"] : ""; //word $fwght = isset($_GET["g"]) ? $_GET["g"] : 0; //max weight $np = $f; $tp = $f; $w = config_prep($ww); echo "<hr>"; echo "<table width='960px'><tr><td width='840px'>"; if (isset($_GET["sitemap"])) { sm($_GET["sitemap"]); } if (isset($_GET["sitasets"])) { sa($_GET["sitasets"], $_GET['sid']); } if (isset($_GET["wcount"])) { coutwords($_GET["wcount"]); } else { if (strlen($w)) { if (substr($w, 0, 4) == "http") { dbcontent($w); } if ($w == "xxx") { sites(); } else { $np = ex($w, $f, $n, $k, $s, $fwght); } } else { ads(); } } if ($np != $f) { if ($np > $n) { $x = $f - $n; echo "<a href='index.php?w={$ww}&f={$x}&n={$n}&s={$s}&g={$fwght}'><<-Prev</a> MITZA-1.0.0.1 <font color='red'>Mitzzzzzzzzzz</font><font color='blue'>z</font> <font color='green'>z </font> <font color='blue'>z</font> <font color='red'> i </font> <font color='yellow'>n </font> <font color='blue'>g</font>..."; } else { echo "X<-Prev MITZA-1.0.0.1 <font color='red'>Mitzzzzzzzzzz</font><font color='blue'>z</font> <font color='green'>z </font> <font color='blue'>z</font> <font color='red'> i </font> <font color='yellow'>n </font> <font color='blue'>g</font>..."; } if ($tp + $_PAGE == $np) { echo "<a href='index.php?w={$ww}&f={$np}&n={$n}&s={$s}&g={$fwght}'>Next->></a> "; } else { echo "Next->X"; } } global $CAT; echo "</td><td valign='top' class='fancy'><div align='center'>"; if ($CAT == 0) { echo "<a href='donate.html'>support</div><div><img src='include/logo.png'></a>"; } else { echo "Powered by<bt><a href='http://enjoydecor.com' title='Toronto home staging and interior decorating'><img src='http://enjoydecor.com/_themes/_simple3/llogo.jpg' width='110px' alt='home staging enjoydecor logo'></a>"; } echo "</div></td></tr></table>"; echo "<hr>"; return $f; }
$this->p['id'] = $this->user_id; try { $this->userinfo = $this->searchclient->get($this->p)['_source']; } catch (Exception $e) { } $this->is_owner = false; if (($this->ion_auth->logged_in() and $this->ion_auth->user()->row()->id == $this->user_id) || $this->ion_auth->is_admin()) { $this->is_owner = true; } // PROFILE EDIT FORM $this->message = validation_errors() ? validation_errors() : $this->session->flashdata('message'); if ($this->ion_auth->logged_in()) { $this->user = $this->ion_auth->user()->row(); $this->load->library('elasticSearch'); if ($this->user->external_source != false) { sm('Profile editing forbidden for social media users. '); redirect('frontend/page/home'); } $this->emailField = array('placeholder' => 'Change Email', 'data-hint' => 'You will occasionally receive account related emails. We promise not to share your email with anyone.', 'name' => 'email', 'id' => 'email', 'type' => 'email', 'value' => $this->user->email); $this->password_new = array('placeholder' => 'New Password', 'data-hint' => 'Your password needs at least 8 characters', 'name' => 'password', 'id' => 'password', 'type' => 'password'); $this->password_confirm = array('placeholder' => 'Confirm Password', 'data-hint' => 'Enter your password again to avoid mistakes', 'name' => 'password_confirm', 'id' => 'password_confirm', 'type' => 'password'); $this->password_old = array('placeholder' => 'Current Password (if you want to change it)', 'data-hint' => 'If you wish to change your password, please enter it first', 'name' => 'password_old', 'id' => 'password_old', 'type' => 'password'); $this->first_name = array('placeholder' => 'First name', 'data-hint' => 'Using your real name helps you connect to your social network (and your publications).', 'name' => 'first_name', 'id' => 'first_name', 'type' => 'text', 'value' => $this->user->first_name); $this->last_name = array('placeholder' => 'Last name', 'name' => 'last_name', 'id' => 'last_name', 'type' => 'text', 'value' => $this->user->last_name); $this->country = array('placeholder' => 'Country', 'name' => 'country', 'id' => 'country', 'type' => 'text', 'value' => $this->user->country); $this->bio = array('placeholder' => 'Bio', 'data-hint' => 'A short bio or catchphrase to let others know a little bit about you.', 'name' => 'bio', 'id' => 'bio', 'type' => 'text', 'value' => $this->user->bio); $this->affiliation = array('placeholder' => 'Affiliation', 'data-hint' => 'The organization where you work. This may help you connect to interesting people.', 'name' => 'affiliation', 'id' => 'affiliation', 'type' => 'text', 'value' => $this->user->affiliation); $this->image = array('placeholder' => 'Upload picture...', 'data-hint' => 'Upload a nice image or avatar.', 'name' => 'image', 'id' => 'image', 'type' => 'file'); } } elseif ($this->ion_auth->logged_in()) { header('Location: ' . str_replace('/u', '/u/' . $this->ion_auth->user()->row()->id, $_SERVER['REQUEST_URI']));
<?php } } } else { sm($s->e(), 'e'); } } ?> </div><br style="clear:both;"/> <?php $s->cl(); } else { if (isset($_SESSION['DB'])) { unset($_SESSION['DB']); } sm('Can\'t connect. ' . $s->e(), 'e'); } } } elseif (isset($_POST['nt'])) { $pf = empty($_POST['pf']) ? 0 : $_POST['pf']; $pl = empty($_POST['pl']) ? 65535 : $_POST['pl']; $sc = empty($_POST['sc']) ? 50 : $_POST['sc']; ?> <div class="ntwrk"> <fieldset><legend>Bind port</legend><form action="" method="post"><div>Port : <input type="text" name="pb" value=" <?php echo empty($_POST['pb']) ? '8888' : $_POST['pb']; ?> " style="width:42px"/> <button type="submit" name="nt" value="bp"/>></button></div></form></fieldset> <fieldset><legend>Back-connect</legend><div><form action="" method="post">To : <input type="text" name="hbc" value=" <?php echo empty($_POST['hbc']) ? $_SERVER['REMOTE_ADDR'] : $_POST['hbc']; ?>
if ($functions == false) { sm('Please select at least one function. '); su('frontend/page/meta_dataset'); } if (in_array($task_type, $legal_task_types) == false) { sm('Task type illegal. Please fill in the form correctly. '); su('frontend/page/meta_dataset'); } $functions = '"' . implode('", "', $functions) . '"'; // TODO: don't store evaluation stuff if type = qualities $md = array('request_date' => now(), 'type' => $type, 'task_type' => $task_type, 'datasets' => $dataset_ids ? implode(', ', $dataset_ids) : null, 'tasks' => $task_ids ? implode(', ', $task_ids) : null, 'flows' => $flow_ids ? implode(', ', $flow_ids) : null, 'setups' => $setup_ids ? implode(', ', $setup_ids) : null, 'functions' => $functions ? $functions : null, 'user_id' => $this->ion_auth->get_user_id()); if ($type == 'qualities') { unset($md['functions']); } $res = $this->Meta_dataset->insert($md); sm('Meta dataset will be created. It can take several minutes to be generated.'); su('frontend/page/meta_dataset#overview'); } elseif ($this->check) { $this->runs_done = 0; $this->runs_total = 0; $sql_setups = 'SELECT `s`.`sid`, `i`.`dependencies`, `i`.`name`, `s`.`setup_string` ' . 'FROM `algorithm_setup` `s`, `implementation` `i` ' . 'WHERE `s`.`implementation_id` = `i`.`id` ' . ($setup_ids ? 'AND `s`.`sid` IN (' . implode(',', $setup_ids) . ') ' : '') . ($flow_ids ? 'AND `i`.`id` IN (' . implode(',', $flow_ids) . ') ' : ''); $res_setups = $this->Algorithm_setup->query($sql_setups); $sql_tasks = 'SELECT `t`.*, d.name, tt.name AS task_type ' . 'FROM `task` `t`, `task_type` `tt`, `task_inputs` `i`, `dataset` `d` ' . 'WHERE `t`.`task_id` = `i`.`task_id` ' . 'AND `i`.`input` = "source_data" ' . 'AND `i`.`value` = `d`.`did` ' . 'AND `t`.`ttid` = `tt`.`ttid` ' . 'AND `t`.`ttid` = "' . $task_type . '" ' . ($dataset_ids ? 'AND `i`.`value` IN (' . implode(',', $dataset_ids) . ') ' : '') . ($task_ids ? 'AND `t`.`task_id` IN (' . implode(',', $task_ids) . ') ' : ''); $res_tasks = $this->Task->query($sql_tasks); // TODO: implementations $sql_runs = 'SELECT `r`.`task_id`,`r`.`setup` ' . 'FROM `run` `r`, `task_inputs` `d`, `task` `t` ' . 'WHERE `r`.`task_id` = `d`.`task_id` ' . 'AND `d`.`input` = "source_data" ' . 'AND `t`.`task_id` = `r`.`task_id` ' . ($dataset_ids ? 'AND `d`.`value` IN (' . implode(',', $dataset_ids) . ') ' : '') . ($task_ids ? 'AND `r`.`task_id` IN (' . implode(',', $task_ids) . ') ' : '') . ($setup_ids ? 'AND `r`.`setup` IN (' . implode(',', $setup_ids) . ') ' : '') . 'AND `t`.`ttid` = "' . $task_type . '" ' . 'GROUP BY `r`.`task_id`, `r`.`setup`;'; $res_runs = $this->Run->query($sql_runs); $this->data = array(); $this->runs_total = count($res_tasks) * count($res_setups); $this->runs_done = count($res_runs); if ($res_runs == false || $res_tasks == false || $res_setups == false) {
<?php if (!$this->ion_auth->logged_in()) { redirect('login'); } $this->form_validation->set_rules('title', 'Title', 'xss_clean'); $this->form_validation->set_rules('body', 'Body', 'required|xss_clean'); if ($this->form_validation->run() == true) { $thread = array('title' => gp('title'), 'activated' => 'y', 'body' => gp('body'), 'post_date' => now(), 'author_id' => $this->ion_auth->user()->row()->id, 'category_id' => 1); $id = $this->Thread->insert($thread); if ($id) { redirect('discuss/tid/' . $id); } else { sm('Failed to create thread. Please try again. '); redirect('discuss'); } } else { sm(validation_errors()); redirect('discuss'); }