/**
  * Returns url for filename
  *
  * @param string $filename
  * @return string
  */
 protected function getFileUrl($filename)
 {
     // For url we need to cache it
     $cacheFile = $this->getCacheFile($filename);
     $file = pathinfo($cacheFile, PATHINFO_BASENAME);
     $dir = pathinfo($cacheFile, PATHINFO_DIRNAME);
     $dirs = explode('/', $dir);
     // Folder: cache/ab
     $dirs = array_slice($dirs, count($dirs) - 2);
     // Folder: cache/ab/filename.ext
     $path = implode('/', $dirs) . '/' . $file;
     // Create url
     $cacheUrl = $this->baseUrl . '/' . $path . '?' . gu(basename($filename));
     return $cacheUrl;
 }
Exemple #2
0
<?php

$this->load_javascript = array('js/libs/highcharts.js', 'js/libs/jquery.dataTables.min.js');
$this->load_css = array('css/jquery.dataTables.min.css', 'css/dataTables.colvis.min.css', 'css/dataTables.colvis.jqueryui.css', 'css/dataTables.responsive.min.css', 'css/dataTables.scroller.min.css', 'css/dataTables.tableTools.min.css');
/// SEARCH
$this->filtertype = 'task';
$this->sort = 'runs';
if ($this->input->get('sort')) {
    $this->sort = safe($this->input->get('sort'));
}
$this->active_tab = gu('tab');
if ($this->active_tab == false) {
    $this->active_tab = 'searchtab';
}
// task types
$this->tasktypes = array();
$types = $this->Implementation->query('SELECT tt.ttid, tt.name, tt.description, count(t.task_id) as tasks FROM task_type tt left join task t on t.ttid=tt.ttid group by tt.ttid order by tasks desc');
if ($types != false) {
    foreach ($types as $i) {
        $result = array('id' => $i->ttid, 'name' => $i->name, 'description' => $i->description, 'tasks' => $i->tasks);
        $this->tasktypes[] = $result;
    }
}
/// TYPE DETAIL
$this->record = array();
$this->taskio = array();
if (false !== strpos($_SERVER['REQUEST_URI'], '/t/type') || false !== strpos($_SERVER['REQUEST_URI'], '/t/search/type')) {
    $info = explode('/', $_SERVER['REQUEST_URI']);
    $this->id = explode('?', $info[array_search('t', $info) + 1])[0];
    $type = $this->Implementation->query('SELECT * FROM task_type WHERE ttid=' . $this->id);
    if ($type != false) {
<a class="btn btn-large btn-primary" href="frontend/page/community_create<?php 
if (gu('cid')) {
    echo '/cid/' . gu('cid');
}
?>
">Ask new question</a>
Exemple #4
0
<?php

$this->counter = 0;
$this->threadsPerCategory = $this->Category->threadsPerCategory();
$this->categories = $this->Category->get();
$this->threads = array();
$this->category_code = array('3200853' => 'general', '3353609' => 'data', '3353608' => 'flow', '3353607' => 'task', '3353606' => 'run', '3760343' => 'task_type');
$this->icons = array('general' => 'fa fa-circle-thin fa-lg', 'flow' => 'fa fa-cogs fa-lg', 'data' => 'fa fa-database fa-lg', 'run' => 'fa fa-star fa-lg', 'user' => 'fa fa-user fa-lg', 'task' => 'fa fa-trophy fa-lg', 'task_type' => 'fa fa-flask fa-lg', 'measure' => 'fa fa-bar-chart-o fa-lg');
$this->colors = array('general' => '#9c27b0', 'flow' => '#428bca', 'data' => '#3d8b3d', 'run' => '#d9534f', 'user' => '#e91e63', 'task' => '#fb8c00', 'task_type' => '#ff5722', 'measure' => '#9c27b0');
$this->activetab = 'recent';
foreach ($this->categories as $c) {
    $this->threads[$c->id] = $this->Thread->getByCategoryId($c->id, 0, 5, 'post_date DESC');
}
/// general topics
if (false !== strpos($_SERVER['REQUEST_URI'], '/tid/')) {
    $this->thread = $this->Thread->getById(gu('tid'));
    if ($this->thread) {
        $this->activetab = 'thread';
        $this->author = $this->Author->getById($this->thread->author_id);
    }
    //$this->category = $this->Category->getById( $this->thread->category_id );
}
if (false !== strpos($_SERVER['REQUEST_URI'], 'new')) {
    $this->activetab = 'new';
}
/// creating new topics
$this->title = array('name' => 'title', 'id' => 'title', 'type' => 'text', 'placeholder' => 'title or subject');
$this->body = array('name' => 'body', 'id' => 'body', 'type' => 'text', 'rows' => '5', 'style' => 'margin-top:20px;padding-top: 5px', 'placeholder' => 'Question, comment, feature request,...');
/// disqus API
/// Get Popular
$endpoint = 'https://disqus.com/api/3.0/threads/listPopular.json?api_secret=' . urlencode(DISQUS_API_SECRET) . '&forum=openml&interval=90d&limit=100';
Exemple #5
0
 public function index()
 {
     $this->page = gu('page') ? gu('page') : 'data';
     $this->page();
 }
Exemple #6
0
<?php

$tag_name = gu('tag') ? gu('tag') : $this->input->get('tag');
$tag_by = gu('u') ? gu('u') : $this->input->get('u');
$with_tag = '';
$where_tag_name = '';
$where_tag_by = '';
$tag_suffix = '';
$did_where = '';
if ($tag_name) {
    $where_tag_name = 'AND LOWER(tag.tag) = LOWER("' . $tag_name . '") ';
    $with_tag = ' tagged with ' . $tag_name . ' ';
    $tag_suffix .= '/tag/' . $tag_name;
}
if ($tag_by) {
    $where_tag_by = 'AND tag.uploader = ' . $tag_by . ' ';
    $tag_suffix .= '/u/' . $tag_by;
}
if ($tag_name || $tag_by) {
    $did_where = 'AND ( d.did IN (SELECT `id` FROM `dataset_tag` `tag` WHERE 1 = 1 ' . $where_tag_name . $where_tag_by . ') OR did IN (SELECT value FROM task_inputs i, task_tag tag WHERE i.task_id = tag.id AND i.input = "source_data" ' . $where_tag_name . $where_tag_by . ')) ';
}
$setup_sql = 'SELECT CONCAT("<a href=\'f/",i.id,"' . $tag_suffix . '\'>", sid, "</a>") AS id, CONCAT("<a href=\'f/",i.id,"' . $tag_suffix . '\'>", i.name, "</a>") AS name, s.setup_string ' . 'FROM `implementation` i, `algorithm_setup` s, `setup_tag` tag ' . 'WHERE s.sid = tag.id ' . $where_tag_name . $where_tag_by . 'AND i.id = s.implementation_id ' . 'GROUP BY s.sid;';
$this->setup_columns = array('id', 'name', 'setup_string');
$this->setup_items = $this->Algorithm_setup->query($setup_sql);
$this->setup_name = 'Setups' . $with_tag;
$task_sql = 'SELECT CONCAT("<a href=\'t/",task.task_id,"' . $tag_suffix . '\'>", task.task_id, "</a>") AS id, ' . 't.name AS task_type, ' . 'CONCAT("<a href=\'t/",task.task_id,"' . $tag_suffix . '\'>", d.name, "</a>") AS name, ' . 'inst.value AS instances, attr.value AS features ' . 'FROM task, task_type t, task_tag `tag`, task_inputs `i`, dataset d ' . 'LEFT JOIN data_quality inst ON d.did = inst.data AND inst.quality = "NumberOfInstances" ' . 'LEFT JOIN data_quality attr ON d.did = attr.data AND attr.quality = "NumberOfFeatures" ' . 'WHERE task.task_id = tag.id ' . 'AND task.ttid = t.ttid ' . 'AND i.input = "source_data" AND i.task_id = task.task_id ' . 'AND i.value = d.did ' . $where_tag_name . $where_tag_by . 'GROUP BY task.task_id;';
$this->task_columns = array('id', 'task_type', 'name', 'instances', 'features');
$this->task_items = $this->Algorithm_setup->query($task_sql);
$this->task_name = 'Tasks' . $with_tag;
$data_sql = 'SELECT d.did AS id, d.name, inst.value AS instances, attr.value AS features ' . 'FROM dataset_tag `tag`, dataset d ' . 'LEFT JOIN data_quality inst ON d.did = inst.data AND inst.quality = "NumberOfInstances" ' . 'LEFT JOIN data_quality attr ON d.did = attr.data AND attr.quality = "NumberOfFeatures" ' . 'WHERE 1=1 ' . $did_where . 'GROUP BY d.did;';
$this->data_columns = array('id', 'name', 'instances', 'features');
Exemple #7
0
<?php

$id = gu('id');
$code = gu('code');
if ($code !== false) {
    $activation = $this->ion_auth->activate($id, $code);
} else {
    if ($this->ion_auth->is_admin()) {
        $activation = $this->ion_auth->activate($id);
    }
}
if ($activation) {
    $this->elasticsearch->index('user', $id);
    //redirect them to the auth page
    $this->session->set_flashdata('message', $this->ion_auth->messages());
    redirect('login', 'refresh');
} else {
    //redirect them to the forgot password page
    $this->session->set_flashdata('message', $this->ion_auth->errors());
    redirect('login', 'refresh');
}
?>