function display_results($token)
{
    $rank = retrieve_results($token);
    $total_step = get_steps();
    $first = key($rank);
    $desc = get_description($first);
    echo '<p>Tu es donc <strong> ' . $first . '<strong><p><p class="hero_desc">' . $desc . '</p>';
    echo '<p>Plus de détails : </p>';
    foreach ($rank as $key => $profile) {
        $percent = round($profile / $total_step * 100);
        echo 'Tu es à ' . $percent . ' % ' . $key . '<br/>';
    }
}
Example #2
0
 public function index($slug)
 {
     $this->load->library('user_agent');
     $this->load->helper('meta');
     $data = $this->mongo_db->page->findOne(array('slug' => $slug));
     if (!isset($data['slug'])) {
         $this->redirect($slug, NULL, NULL, 'page/index/');
         show_404(uri_string(), FALSE);
     }
     if (!$this->agent->is_robot()) {
         $this->mongo_db->page->update(array('_id' => new MongoId($data['_id'])), array('$set' => array('counter' => ++$data['counter'])));
     }
     $this->template->set_keyword(get_keyword($data))->set_description(get_description($data))->set_title(get_title($data))->view('index', $data)->render();
 }
Example #3
0
function createOldHeaderData()
{
    global $gbl, $sgbl, $login, $ghtml;
    global $gdata;
    $homedesc = $login->getKeywordUc('home');
    $deskdesc = $login->getKeywordUc('desktop');
    $aboutdesc = $login->getKeywordUc('about');
    $domaindesc = get_plural(get_description('domain'));
    $clientdesc = get_plural(get_description('client'));
    $slavedesc = get_description('pserver');
    $ticketdesc = get_plural(get_description('ticket'));
    $ssessiondesc = get_description('ssession');
    $systemdesc = $login->getKeywordUc('system');
    $logoutdesc = $login->getKeywordUc('logout');
    $helpdesc = $login->getKeywordUc('help');
    $ffiledesc = get_plural(get_description("ffile"));
    $alldesc = $login->getKeywordUc('all');
    if ($login->isAdmin()) {
        $doctype = "admin";
        $domainclass = "domain";
    } else {
        $doctype = "client";
        $domainclass = "domain";
    }
    if (check_if_many_server()) {
        $serverurl = $ghtml->getFullUrl('a=list&c=pserver');
        $slavedesc = get_plural($slavedesc);
    } else {
        $serverurl = $ghtml->getFullUrl('k[class]=pserver&k[nname]=localhost&a=show');
    }
    if ($login->is__table('client')) {
        $ffileurl = $ghtml->getFullUrl('k[class]=ffile&k[nname]=/&a=show');
    } else {
        $ffileurl = $ghtml->getFullUrl('n=web&k[class]=ffile&k[nname]=/&a=show');
    }
    $gob = $login->getObject('general')->generalmisc_b;
    if (isset($gob->ticket_url) && $gob->ticket_url) {
        $url = $gob->ticket_url;
        $url = add_http_if_not_exist($url);
        $ticket_url = "javascript:window.open('{$url}')";
    } else {
        $ticket_url = "/display.php?frm_action=list&frm_o_cname=ticket";
    }
    $helpurl = "http://wiki.lxcenter.org";
    $gdata = array("desktop" => array($deskdesc, "/display.php?frm_action=desktop", "client_list.gif"), "home" => array($homedesc, "/display.php?frm_action=show", "client_list.gif"), "all" => array($alldesc, "/display.php?frm_action=list&frm_o_cname=all_domain", "client_list.gif"), "domain" => array($domaindesc, "/display.php?frm_action=list&frm_o_cname={$domainclass}", "domain_list.gif"), "system" => array($systemdesc, "/display.php?frm_action=show&frm_o_o[0][class]=pserver&frm_o_o[0][nname]=localhost", "pserver_list.gif"), "client" => array($clientdesc, "/display.php?frm_action=list&frm_o_cname=client", "client_list.gif"), "ffile" => array($ffiledesc, $ffileurl, "client_list.gif"), "pserver" => array($slavedesc, $serverurl, "pserver_list.gif"), "ticket" => array($ticketdesc, $ticket_url, "ticket_list.gif"), "ssession" => array($ssessiondesc, "/display.php?frm_action=list&frm_o_cname=ssessionlist", "ssession_list.gif"), "about" => array($aboutdesc, "/display.php?frm_action=about", "ssession_list.gif"), "help" => array($helpdesc, "javascript:window.open('{$helpurl}/')", "ssession_list.gif"), "logout" => array("<font color=red>{$logoutdesc}<font >", "javascript:top.mainframe.logOut();", "delete.gif"));
}
Example #4
0
 public function index()
 {
     $this->load->library('user_agent');
     $this->load->helper('meta');
     $slug = $this->uri->uri_string();
     $data = $this->mongo_db->post->findOne(array('slug' => $slug, 'status' => 'publish'));
     if (!isset($data['slug'])) {
         $this->redirect($slug, NULL, NULL, 'post/index/');
         $this->show_404();
         return;
     }
     if (!$this->agent->is_robot()) {
         $this->mongo_db->post->update(array('_id' => new MongoId($data['_id'])), array('$set' => array('counter' => ++$data['counter'])));
     }
     $related = $this->mongo_db->post->find(array('_id' => array('$ne' => $data['_id']), 'tags' => array('$in' => $data['tags'])))->limit(3);
     $data['related'] = iterator_to_array($related);
     $this->template->set_keyword(get_keyword($data))->set_description(get_description($data))->set_title(get_title($data))->view('index', $data)->render();
 }
Example #5
0
function display_image($filename)
{
    // I need to know which picture this is, for navigation links
    $picture_files = list_picture_files();
    $current_picture_index = array_search($filename, $picture_files);
    // Actual image
    $img_tag = '<img src="' . $filename . '" alt="' . pretty_print_name(get_name_part($filename)) . '" />';
    // Overlay navigation
    $overlay_navigation_previous = '';
    $overlay_navigation_next = '';
    if ($current_picture_index !== count($picture_files) - 1) {
        $overlay_navigation_next .= link_to_picture($picture_files[$current_picture_index + 1]);
    }
    if ($current_picture_index !== 0) {
        $overlay_navigation_previous .= link_to_picture($picture_files[$current_picture_index - 1]);
    }
    $image_display = "<div id=\"image_display\">\n\t" . $overlay_navigation_previous . "\n" . $img_tag . "\n" . $overlay_navigation_next . "</div>\n";
    // Image title
    $title = pretty_print_name(get_name_part($filename));
    $image_display .= "<div id=\"image_name\">" . $title . "</div>\n";
    // Image date
    $date = pretty_print_timestamp(get_timestamp_part($filename));
    $image_display .= "<div id=\"image_date\">" . $date . "</div>\n";
    // Image description
    $description = get_description($filename);
    if (!is_null($description)) {
        $image_display .= "<div id=\"image_description\">" . $description . "</div>\n";
    }
    // links to previous, index and next image
    $links = "<div id=\"image_links\">\n\t";
    // Link to previous image
    if ($current_picture_index !== 0) {
        $link_to_previous = link_to_picture($picture_files[$current_picture_index - 1], false);
        $links .= "<span id=\"image_link_previous\" class=\"image_link\">" . $link_to_previous . "</span>\n\t";
    } else {
        $links .= "<span class=\"image_link\">&nbsp;</span>";
    }
    // Link to the image index
    $link_to_index = '<a href="?p=index">Images index</a>';
    $links .= "<span id=\"image_link_index\">" . $link_to_index . "</span>\n";
    // Links to next image
    if ($current_picture_index !== count($picture_files) - 1) {
        $link_to_next = link_to_picture($picture_files[$current_picture_index + 1], false);
        $links .= "<span id=\"image_link_next\" class=\"image_link\">" . $link_to_next . "</span>\n\t";
    } else {
        $links .= "<span class=\"image_link\">&nbsp;</span>";
    }
    $links .= "</div>\n";
    $image_display .= $links;
    return $image_display;
}
Example #6
0
function display_grid($prefix, $courseid, $students, $criteria)
{
    //print_r($criteria);
    $ok = array();
    if (count($criteria['P'])) {
        $ok['P'] = true;
    }
    if (count($criteria['M'])) {
        $ok['M'] = true;
    }
    if (count($criteria['D'])) {
        $ok['D'] = true;
    }
    //print_r($ok);
    $padding = array('P' => 0, 'M' => 0, 'D' => 0);
    $count['P'] = count($criteria['P']);
    $count['M'] = count($criteria['M']);
    $count['D'] = count($criteria['D']);
    if ($count['D'] < 6) {
        $padding['D'] = 6 - $count['D'];
        $count['D'] = 6;
    }
    $data = '<table id="grades" border="1">' . "\n";
    if (array_key_exists('P', $ok) && array_key_exists('M', $ok)) {
        $data .= '<tr><th colspan="3">&nbsp;</th>';
        if ($ok['P']) {
            $data .= '<th class="divider">&nbsp;</th><th class="left small" colspan="' . $count['P'] . '">' . get_string('pass', 'block_progress') . '</th>';
        }
        if ($ok['M']) {
            $data .= '<th class="divider">&nbsp;</th><th class="left small" colspan="' . $count['M'] . '">' . get_string('merit', 'block_progress') . '</th>';
        }
        if ($ok['D']) {
            $data .= '<th class="divider">&nbsp;</th><th class="left small" colspan="' . $count['D'] . '">' . get_string('distinction', 'block_progress') . '</th>';
        }
        $data .= '</tr>' . "\n";
    }
    $data .= '<tr><th colspan="3">&nbsp;</th>';
    foreach ($criteria as $l => $crit) {
        if (array_key_exists($l, $ok)) {
            $data .= '<th class="divider">&nbsp;</th>';
            foreach ($crit as $a => $c) {
                $data .= '<th class="centre small">' . $c . '</th>';
            }
        }
    }
    $data .= '<th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr>';
    foreach ($students as $student) {
        $data .= '<tr><td>' . strtoupper($student->lastname) . '</td><td>' . ucfirst(strtolower($student->firstname)) . '</td></td><td>&nbsp;</td>';
        foreach ($criteria as $letter => $crit) {
            if (array_key_exists($letter, $ok)) {
                $data .= '<td class="divider">&nbsp;</td>';
                foreach ($crit as $a => $c) {
                    $class = 'partial hide';
                    $title = '';
                    $desc = get_description($prefix, $courseid, $letter . $c);
                    if ($desc) {
                        $title = ' title="' . $desc . '"';
                    }
                    if (outcome_achieved($prefix, $courseid, $student->id, $letter . $c)) {
                        $class = 'achieved';
                    }
                    $data .= '<td' . $title . ' class="' . $class . '">' . $letter . $c . '</td>';
                }
            }
        }
        $data .= '</tr>';
    }
    $data .= '</table>' . "\n";
    return $data;
}
Example #7
0
    $voteid = explode(' ', $voteid);
}
if ($fromurl) {
    $fromurl = fix_link($fromurl);
}
$fileurl = $linkurl;
$linkurl = $MOD['linkurl'] . $linkurl;
$titles = array();
if ($subtitle) {
    $titles = explode("\n", $subtitle);
    $titles = array_map('trim', $titles);
}
$keytags = $tag ? explode(' ', $tag) : array();
$fee = get_fee($item['fee'], $MOD['fee_view']);
if ($fee) {
    $description = get_description($content, $MOD['pre_view']);
    $user_status = 4;
} else {
    $user_status = 3;
}
$pages = '';
$total = 1;
$subtitles = count($titles);
if (strpos($content, '[pagebreak]') !== false) {
    $contents = explode('[pagebreak]', $content);
    $total = count($contents);
    if ($total < $subtitles) {
        $subtitles = $total;
    }
}
$seo_file = 'show';
Example #8
0
    echo $curr_page;
    ?>
" />
					<h2><img src="inc/images/loading.gif" id="loading" alt="loading" style="display: none;" />Planet</h2>
					<a name="settings"></a>
					<h3>Planet settings</h3>
					<p class="settings">
						<label for="title">Planet title:</label>
						<input type="text" name="title" id="title" value="<?php 
    echo get_title();
    ?>
" />

						<label for="description">Planet description:</label>
						<textarea name="description" id="description"><?php 
    echo get_description();
    ?>
</textarea>
						<?php 
    $allow_reg = get_setting_value('show_reg_button');
    $notify = get_setting_value('reg_notify');
    if ($allow_reg == 'on') {
        $allow_reg = "checked=\"true\"";
    } else {
        $allow_reg = "";
    }
    if ($notify == 'on') {
        $notify = "checked=\"true\"";
    } else {
        $notify = "";
    }
Example #9
0
function __ajax_desc_tree()
{
    global $gbl, $sgbl, $login, $ghtml;
    $object = $gbl->__c_object;
    $icondir = get_image_path('/button/');
    $rclist = $object->getResourceChildList();
    $cid = $ghtml->node;
    if ($object->hasFileResource()) {
        $u = "a=show&k[class]=ffile&k[nname]=/";
        $u = $ghtml->getFullUrl($u);
        $v = createClName('ffile', '/');
        $ret[] = array('text' => "File", 'icon' => "{$icondir}/ffile_show.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$v}");
    }
    if ($ghtml->__resource_class) {
        $c = strfrom($ghtml->__resource_class, "__resource_");
        if (cse($c, "_l")) {
            $clname = $object->getChildNameFromDes($c);
            $list = $object->getList($clname, $totalcount);
            foreach ($list as $o) {
                $u = "a=show&k[class]={$o->getClass()}&k[nname]={$o->nname}";
                $u = $ghtml->getFullUrl($u);
                $ret[] = array('text' => basename($o->nname), 'icon' => "{$icondir}/{$o->getClass()}_list.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$o->getClName()}");
            }
        } else {
            if (cse($c, "_o")) {
                $clname = $object->getChildNameFromDes($c);
                $o = $object->getObject($clname);
                $u = "a=show&o={$o->getClass()}";
                $u = $ghtml->getFullUrl($u);
                $ret[] = array('text' => $o->getClass(), 'icon' => "{$icondir}/{$o->getClass()}_show.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$o->getClass()}");
            }
        }
        return $ret;
    }
    if ($ghtml->__title_function) {
        $t = $ghtml->__title_function;
        $alist = $object->createShowAlist($alist);
        foreach ($alist as $k => $v) {
            if (csb($k, "__title")) {
                if ($k !== $t) {
                    if ($insidetitle) {
                        $insidetitle = false;
                        break;
                    }
                    continue;
                }
                $insidetitle = true;
                continue;
            }
            if ($insidetitle) {
                $url = $ghtml->getFullUrl($v);
                if ($ghtml->is_special_url($url)) {
                    continue;
                }
                $urlinfo = $ghtml->getUrlInfo($url);
                $ret[] = array('text' => $urlinfo['description']['desc'], 'icon' => $urlinfo['image'], 'hrefTarget' => 'mainframe', 'leaf' => true, 'href' => $url, 'id' => "&end");
            }
        }
        return $ret;
    }
    if ($object->hasFunctions()) {
        $alist = $object->createShowAlist($alist);
        foreach ($alist as $k => $v) {
            if (!csb($k, "__title")) {
                continue;
            }
            $title = strfrom($k, "__title_");
            if ($title === 'mailaccount') {
                continue;
            }
            if ($title === 'custom') {
                continue;
            }
            $icon = "{$icondir}/__title_{$title}.gif";
            if (!lxfile_exists("__path_program_htmlbase/{$icon}")) {
                //lfile_put_contents("title.img", "$title.gif\n", FILE_APPEND);
                $icon = null;
            }
            $ret[] = array('text' => $v, 'icon' => $icon, 'hrefTarget' => '', 'href' => null, 'id' => "{$cid}&{$k}");
        }
    }
    foreach ($rclist as $c) {
        $clname = $object->getChildNameFromDes($c);
        $desc = get_description($clname);
        $desc = get_plural($desc);
        $url = $ghtml->getFullUrl("a=list&c={$clname}");
        $ret[] = array('text' => $desc, 'icon' => "{$icondir}/{$clname}_list.gif", 'hrefTarget' => 'mainframe', 'href' => $url, 'id' => "{$cid}&__resource_{$c}");
    }
    return $ret;
}
Example #10
0
            }
        } else {
            $user_status = 3;
        }
    } else {
        $inner = true;
        $user_status = $_userid ? 1 : 0;
    }
    if ($_username && $_username == $item['username']) {
        $user_status = 3;
    }
    if ($inner) {
        if ($user_status == 3 || $user_status == 2) {
            $best = $aid ? $db->get_one("SELECT * FROM {$DT_PRE}know_answer WHERE itemid={$aid}") : array();
            if ($user_status == 2 && $best) {
                $description = get_description($best['content'], $MOD['pre_view']);
            }
        }
        $content = strip_nr(ob_template('content', 'chip'), true);
        echo 'Inner("content", \'' . $content . '\');';
    }
    $update = '';
    include DT_ROOT . '/include/update.inc.php';
    echo 'Inner("hits", \'' . $item['hits'] . '\');';
    if ($MOD['show_html'] && $edittime > @filemtime(DT_ROOT . '/' . $MOD['moduledir'] . '/' . $item['linkurl'])) {
        tohtml('show', $module);
    }
} else {
    if ($html == 'list') {
        $catid or exit;
        if ($MOD['list_html'] && $task_list && $CAT) {
Example #11
0
function fleet_info()
{
    global $pid;
    global $uid;
    global $skin;
    $sth = mysql_query("select uid from planets where id={$pid} and uid={$uid}");
    if (!$sth) {
        show_error("Database failure!");
        return 0;
    }
    if (mysql_num_rows($sth) == 0) {
        show_error("Databaser failure!");
        return 0;
    }
    $fids = get_fids_by_pid($pid, $uid);
    if (!$fids) {
        show_message("You have no fleet on this planet");
    } else {
        table_start("center", "500");
        table_head_text(array("Ships in orbit"), "3");
        table_text_open("head");
        for ($i = 0; $i < sizeof($fids); $i++) {
            $fleet = new fleet($fids[$i]);
            table_text_open("head");
            table_text_design($fleet->name, "80", "", "", "head");
            table_text_design("Name", "300", "center", "", "smallhead");
            table_text_design("Count", "100", "center", "", "smallhead");
            table_text_close();
            while (list($prod_id, $ships_arr) = each($fleet->ships)) {
                $sth = mysql_query("select manual from production where prod_id={$prod_id}");
                if (!$sth) {
                    show_error("Database failure!");
                    return 0;
                }
                $manual = mysql_fetch_array($sth);
                table_text_open("text", "center");
                table_text_design("<a href='" . $manual["manual"] . "' target=\"_blank\"><img src='arts/" . get_pic($prod_id) . "' border='0' alt='" . get_description($prod_id) . "' align='center'></a><br><a href=\"" . $PHP_SELF . "?act=print_ship_info&prod_id=" . $prod_id . "\">Info</a>", "80", "", "", "text");
                table_text_design(get_name_by_prod_id($prod_id), "300", "", "", "text");
                table_text_design($ships_arr[0], "100", "", "", "text");
                table_text_close();
            }
        }
        table_end();
    }
    $sth3 = mysql_query("select * from s_production as sp,production as p where sp.planet_id='" . $pid . "' and p.prod_id=sp.prod_id order by sp.time,sp.prod_id");
    table_start("center", "500");
    fleet($sth3);
    table_end();
}
Example #12
0
 function getTitleWithSync($class = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($class) {
         $obj = $this->getObject($class);
     } else {
         $obj = $this;
         $class = $this->get__table();
     }
     $switch = null;
     if (isset($obj->olddeleteflag) && $obj->olddeleteflag === 'on') {
         $switch = "(Switching)";
     }
     $desc = get_description($class);
     $descr = null;
     $str = null;
     if (check_if_many_server()) {
         $descr = "on {$obj->syncserver}";
     }
     return "{$desc}  <span title=\"{$desc} is Configured {$descr}\">{$str} {$switch}</span>";
 }
}
?>
</tr>
<?php 
foreach ($criteria as $letter => $detail) {
    foreach ($detail as $num => $desc) {
        $n = $desc['shortname'];
        echo '<tr><td>' . $letter . $n . '</td><td>' . shorten_text($desc['description'], 40) . '</td>';
        foreach ($assignments as $key => $assignment) {
            $desc = '';
            $class = 'notenrolled';
            $content = '&nbsp;';
            if ($possible[$letter . $n][$key]) {
                $class = 'partial nobox';
                $content = $letter . $n;
                $d = get_description($_GET['course'], $letter . $n);
                if ($d) {
                    $desc = ' title="' . $d . '"';
                }
            }
            if ($achieved[$letter . $n][$key]) {
                $class = 'achieved';
            }
            //if ($achieved[$letter.$n][$key] == 'yes') $class = 'yes';
            echo '<td' . $desc . ' class="' . $class . '">' . $content . '</td>';
        }
        echo '</tr>';
    }
}
?>
</table>
Example #14
0
 function getTitleWithSync($class = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($class) {
         $obj = $this->getObject($class);
     } else {
         $obj = $this;
         $class = $this->get__table();
     }
     $switch = null;
     if (isset($obj->olddeleteflag) && $obj->olddeleteflag === 'on') {
         $switch = "(Switching)";
     }
     $desc = get_description($class);
     $path = get_image_path();
     $img = $ghtml->get_image($path, null, $obj->__driverappclass, '.gif');
     $descr = null;
     $str = null;
     if (check_if_many_server()) {
         $descr = "on {$obj->syncserver}";
         //$str = ":{$obj->syncserver}";
     }
     //<img src={$img} width=14 height=14>
     // Don't need this. Ruins the appearance <b> [</b>{$obj->getShowInfo()}<b>] </b>
     return "{$desc}  <span title=\"{$desc} is Configured {$descr} on {$obj->__driverappclass}\">  {$str} {$switch}: {$obj->__driverappclass}  </span>";
 }
Example #15
0
function do_addform($object, $class, $dttype = null, $notitleflag = false)
{
    global $gbl, $sgbl, $login, $ghtml;
    $gbl->setSessionV("lx_add_return_url", "/display.php?" . $ghtml->get_get_from_current_post(null));
    $cdesc = get_description($class);
    $cdesc = $dttype ? $dttype['val'] : $cdesc;
    if ($notitleflag) {
        $title = null;
    } else {
        $title = "Add {$cdesc}";
    }
    $string[] = $ghtml->object_variable_startblock($object, $class, $title);
    $string[] = $ghtml->object_inherit_classpath();
    $string[] = $ghtml->object_variable_hidden("frm_o_cname", $class);
    $string[] = $ghtml->object_variable_hidden("frm_dttype", $dttype);
    $ret = exec_class_method($class, 'addform', $object, $class, $dttype);
    if ($dttype) {
        $ret['variable'][$dttype['var']] = array('h', $dttype['val']);
    }
    $string[] = create_xml($object, $class, $ret);
    $vlist = $ret['variable'];
    $pre = $post = null;
    if (isset($vlist['__m_message_pre'])) {
        $pre = $vlist['__m_message_pre'];
    }
    if (isset($vlist['__m_message_post'])) {
        $post = $vlist['__m_message_post'];
    }
    $ghtml->print_information('pre', 'addform', $class, $dttype['val'], $pre);
    $ghtml->xml_print_page($string);
    $ghtml->print_information('post', 'addform', $class, $dttype['val'], $post);
}
Example #16
0
function display_key($prefix, $courseid, $criteria)
{
    $data = '<div id="key" class="printonly">';
    $data .= '<h2>Criteria</h2>';
    $data .= '<dl>';
    foreach ($criteria as $letter => $crit) {
        foreach ($crit as $c) {
            $data .= '<dt>' . $letter . $c . '</td>' . "\n";
            $data .= '<dd>' . get_description($prefix, $courseid, $letter . $c) . '</dd>' . "\n";
        }
    }
    $data .= '</dl></div>';
    return $data;
}
Example #17
0
<?php

include_once "/db/db_search.php";
include_once "search-item.php";
$search_results = \search\get_search_results($_GET['q']);
echo '<div id="search-results-number">' . count($search_results) . ' Results Found</div>';
foreach ($search_results as $search_item) {
    $search_item['description'] = get_description($search_item['id'], $search_item['type']);
    output_search_item($search_item['id'], $search_item['type'], $search_item['name'], $search_item['image'], $search_item['description']);
}
Example #18
0
    function printListAddForm($parent, $class)
    {
        global $gbl, $sgbl, $login, $ghtml;
        $vlist = exec_class_method($class, "addListForm", $parent, $class);
        if (!$vlist) {
            return;
        }
        $unique_name = "{$parent->getClName()}_{$class}";
        $showstring = "Show/Hide";
        $show_all_string = null;
        if ($login->getSpecialObject('sp_specialplay')->isOn('close_add_form')) {
            $visiblity = "visibility:hidden;display:none";
        } else {
            $visiblity = "visibility:visible;display:block";
        }
        $cdesc = get_description($class);
        $cdesc .= " for {$parent->nname}";
        $backgroundstring = "background:#fff;";
        $fontcolor = "black";
        $bordertop = "#d0d0d0";
        if ($sgbl->isBlackBackground()) {
            $backgroundstring = "background:#000;";
            $fontcolor = "#333333";
            $bordertop = "#444444";
        }
        ?>

	<table cellpadding="0" cellspacing="0" background="img/skin/kloxo/default/default/expand.gif">
		<tr>
			<td>
				<font align=left style='color:<?php 
        echo $fontcolor;
        ?>
;font-weight:bold'>
					<a style='color:<?php 
        echo $fontcolor;
        ?>
 ;font-weight:bold'
					   href="javascript:toggleVisibility('listaddform_<?php 
        echo $unique_name;
        ?>
');"> &nbsp; &nbsp; Click Here to
						Add <?php 
        echo $cdesc;
        ?>
 (<?php 
        echo $showstring;
        ?>
) </a> <?php 
        echo $show_all_string;
        ?>
				</font> &nbsp; &nbsp; &nbsp;
			</td>
		</tr>
	</table>

	<div id="listaddform_<?php 
        echo $unique_name;
        ?>
" style="<?php 
        echo $visiblity;
        ?>
">
		<table width="100%" border="0" cellpadding=0 style=' border: 0px solid '>
			<tr>
				<td width="10"></td>
				<td>
					<table cellpadding=0 align=center cellspacing=0 width=90%>
						<tr>
							<td>
								<?php 
        do_addform($parent, $class, null, true);
        ?>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
		<?php 
    }
Example #19
0
    function send_header($header = "", $options = array())
    {
        global $DBInfo;
        $plain = 0;
        $media = 'media="screen"';
        if (isset($options['action'][0]) and $options['action'] == 'print') {
            $media = '';
        }
        if (empty($options['is_robot']) && isset($this->pi['#redirect'][0]) && !empty($options['pi'])) {
            $options['value'] = $this->pi['#redirect'];
            $options['redirect'] = 1;
            $this->pi['#redirect'] = '';
            do_goto($this, $options);
            return true;
        }
        $header = !empty($header) ? $header : (!empty($options['header']) ? $options['header'] : null);
        if (!empty($header)) {
            foreach ((array) $header as $head) {
                $this->header($head);
                if (preg_match("/^content\\-type: text\\//i", $head)) {
                    $plain = 1;
                }
            }
        }
        $mtime = isset($options['mtime']) ? $options['mtime'] : $this->page->mtime();
        if ($mtime > 0) {
            $modified = $mtime > 0 ? gmdate('Y-m-d\\TH:i:s', $mtime) . '+00:00' : null;
            $lastmod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
            $meta_lastmod = '<meta http-equiv="last-modified" content="' . $lastmod . '" />' . "\n";
        }
        if (is_static_action($options) or !empty($DBInfo->use_conditional_get) and !empty($mtime) and empty($options['nolastmod']) and $this->page->is_static) {
            $this->header('Last-Modified: ' . $lastmod);
            $etag = $this->page->etag($options);
            if (!empty($options['etag'])) {
                $this->header('ETag: "' . $options['etag'] . '"');
            } else {
                $this->header('ETag: "' . $etag . '"');
            }
        }
        // custom headers
        if (!empty($DBInfo->site_headers)) {
            foreach ((array) $DBInfo->site_headers as $head) {
                $this->header($head);
            }
        }
        $content_type = isset($DBInfo->content_type[0]) ? $DBInfo->content_type : 'text/html';
        $force_charset = '';
        if (!empty($DBInfo->force_charset)) {
            $force_charset = '; charset=' . $DBInfo->charset;
        }
        if (!$plain) {
            $this->header('Content-type: ' . $content_type . $force_charset);
        }
        if (!empty($options['action_mode']) and $options['action_mode'] == 'ajax') {
            return true;
        }
        # disabled
        #$this->header("Vary: Accept-Encoding, Cookie");
        #if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') and function_exists('ob_gzhandler')) {
        #  ob_start('ob_gzhandler');
        #  $etag.= '.gzip';
        #}
        if (!empty($options['metatags'])) {
            $metatags = $options['metatags'];
        } else {
            $metatags = $DBInfo->metatags;
        }
        if (!empty($options['noindex']) || !empty($this->pi['#noindex']) || (!empty($mtime) and !empty($DBInfo->delayindex) and time() - $mtime < $DBInfo->delayindex)) {
            // delay indexing like as dokuwiki
            if (preg_match("/<meta\\s+name=('|\")?robots\\1[^>]+>/i", $metatags)) {
                $metatags = preg_replace("/<meta\\s+name=('|\")?robots\\1[^>]+>/i", '<meta name="robots" content="noindex,nofollow" />', $metatags);
            } else {
                $metatags .= '<meta name="robots" content="noindex,nofollow" />' . "\n";
            }
        }
        if (isset($DBInfo->metatags_extra)) {
            $metatags .= $DBInfo->metatags_extra;
        }
        $js = !empty($DBInfo->js) ? $DBInfo->js : '';
        if (!$plain) {
            if (isset($options['trail'])) {
                $this->set_trailer($options['trail'], $this->page->name);
            } else {
                if ($DBInfo->origin) {
                    $this->set_origin($this->page->name);
                }
            }
            # find upper page
            $up_separator = '/';
            if (!empty($this->use_namespace)) {
                $up_separator .= '|\\:';
            }
            $pos = 0;
            preg_match('@(' . $up_separator . ')@', $this->page->name, $sep);
            # NameSpace/SubPage or NameSpace:SubNameSpacePage
            if (isset($sep[1])) {
                $pos = strrpos($this->page->name, $sep[1]);
            }
            if ($pos > 0) {
                $upper = substr($this->page->urlname, 0, $pos);
            } else {
                if ($this->group) {
                    $upper = _urlencode(substr($this->page->name, strlen($this->group)));
                }
            }
            // setup keywords
            $keywords = '';
            if (!empty($this->pi['#keywords'])) {
                $keywords = _html_escape($this->pi['#keywords']);
            } else {
                $keys = array();
                $dummy = strip_tags($this->page->title);
                $keys = explode(' ', $dummy);
                $keys[] = $dummy;
                $keys = array_unique($keys);
                $keywords = implode(', ', $keys);
            }
            // add redirects as keywords
            if (!empty($DBInfo->use_redirects_as_keywords)) {
                $r = new Cache_Text('redirects');
                $redirects = $r->fetch($this->page->name);
                if ($redirects !== false) {
                    sort($redirects);
                    $keywords .= ', ' . _html_escape(implode(', ', $redirects));
                }
            }
            // add site specific keywords
            if (!empty($DBInfo->site_keywords)) {
                $keywords .= ', ' . $DBInfo->site_keywords;
            }
            $keywords = "<meta name=\"keywords\" content=\"{$keywords}\" />\n";
            # find sub pages
            if (empty($options['action']) and !empty($DBInfo->use_subindex)) {
                $scache = new Cache_text('subpages');
                if (!($subs = $scache->exists($this->page->name))) {
                    if (($p = strrpos($this->page->name, '/')) !== false) {
                        $rule = _preg_search_escape(substr($this->page->name, 0, $p));
                    } else {
                        $rule = _preg_search_escape($this->page->name);
                    }
                    $subs = $DBInfo->getLikePages('^' . $rule . '\\/', 1);
                    if ($subs) {
                        $scache->update($this->page->name, 1);
                    }
                }
                if (!empty($subs)) {
                    $subindices = '';
                    if (empty($DBInfo->use_ajax)) {
                        $subindices = '<div>' . $this->macro_repl('PageList', '', array('subdir' => 1)) . '</div>';
                        $btncls = 'class="close"';
                    } else {
                        $btncls = '';
                    }
                    $this->subindex = "<fieldset id='wikiSubIndex'>" . "<legend title='[+]' {$btncls} onclick='javascript:toggleSubIndex(\"wikiSubIndex\")'></legend>" . $subindices . "</fieldset>\n";
                }
            }
            if (!empty($options['.title'])) {
                $options['title'] = $options['.title'];
            } else {
                if (empty($options['title'])) {
                    $options['title'] = !empty($this->pi['#title']) ? $this->pi['#title'] : $this->page->title;
                    $options['title'] = _html_escape($options['title']);
                } else {
                    $options['title'] = strip_tags($options['title']);
                }
            }
            $theme_type = !empty($this->_newtheme) ? $this->_newtheme : '';
            if (empty($options['css_url'])) {
                $options['css_url'] = $DBInfo->css_url;
            }
            if (empty($this->pi['#nodtd']) and !isset($options['retstr']) and $theme_type != 2) {
                if (!empty($this->html5)) {
                    if (is_string($this->html5)) {
                        echo $this->html5;
                    } else {
                        echo '<!DOCTYPE html>', "\n", '<html xmlns="http://www.w3.org/1999/xhtml">', "\n";
                    }
                } else {
                    echo $DBInfo->doctype;
                }
            }
            if ($theme_type == 2 or isset($options['retstr'])) {
                ob_start();
            } else {
                echo "<head>\n";
            }
            echo '<meta http-equiv="Content-Type" content="' . $content_type . ';charset=' . $DBInfo->charset . "\" />\n";
            echo <<<JSHEAD
<script type="text/javascript">
/*<![CDATA[*/
_url_prefix="{$DBInfo->url_prefix}";
/*]]>*/
</script>
JSHEAD;
            echo $metatags, $js, "\n";
            echo $this->get_javascripts();
            echo $keywords;
            if (!empty($meta_lastmod)) {
                echo $meta_lastmod;
            }
            $sitename = !empty($DBInfo->title_sitename) ? $DBInfo->title_sitename : $DBInfo->sitename;
            if (!empty($DBInfo->title_msgstr)) {
                $site_title = sprintf($DBInfo->title_msgstr, $sitename, $options['title']);
            } else {
                $site_title = $options['title'] . ' - ' . $sitename;
            }
            // set OpenGraph information
            $act = !empty($options['action']) ? strtolower($options['action']) : 'show';
            $is_show = $act == 'show';
            $is_frontpage = $this->page->name == get_frontpage($DBInfo->lang);
            if (!$is_frontpage && !empty($DBInfo->frontpages) && in_array($this->page->name, $DBInfo->frontpages)) {
                $is_frontpage = true;
            }
            if (!empty($DBInfo->canonical_url)) {
                if (($p = strpos($DBInfo->canonical_url, '%s')) !== false) {
                    $page_url = sprintf($DBInfo->canonical_url, $this->page->urlname);
                } else {
                    $page_url = $DBInfo->canonical_url . $this->page->urlname;
                }
            } else {
                $page_url = qualifiedUrl($this->link_url($this->page->urlname));
            }
            if ($is_show && $this->page->exists()) {
                $oc = new Cache_text('opengraph');
                if ($this->refresh || ($val = $oc->fetch($this->page->name, $this->page->mtime())) === false) {
                    $val = array('description' => '', 'image' => '');
                    if (!empty($this->pi['#redirect'])) {
                        $desc = '#redirect ' . $this->pi['#redirect'];
                    } else {
                        $raw = $this->page->_get_raw_body();
                        if (!empty($this->pi['#description'])) {
                            $desc = $this->pi['#description'];
                        } else {
                            $cut_size = 2000;
                            if (!empty($DBInfo->get_description_cut_size)) {
                                $cut_size = $DBInfo->get_description_cut_size;
                            }
                            $cut = mb_strcut($raw, 0, $cut_size, $DBInfo->charset);
                            $desc = get_description($cut);
                            if ($desc !== false) {
                                $desc = mb_strcut($desc, 0, 200, $DBInfo->charset) . '...';
                            } else {
                                $desc = $this->page->name;
                            }
                        }
                    }
                    $val['description'] = _html_escape($desc);
                    if (!empty($this->pi['#image'])) {
                        if (preg_match('@^(ftp|https?)://@', $this->pi['#image'])) {
                            $page_image = $this->pi['#image'];
                        } else {
                            if (preg_match('@^attachment:("[^"]+"|[^\\s]+)@/', $this->pi['#image'], $m)) {
                                $image = $this->macro_repl('attachment', $m[1], array('link_url' => 1));
                                if ($image[0] != 'a') {
                                    $page_image = $image;
                                }
                            }
                        }
                    }
                    if (empty($page_image)) {
                        // extract the first image
                        $punct = '<>"\'}\\]\\|\\!';
                        if (preg_match_all('@(?<=\\b)((?:attachment:(?:"[^' . $punct . ']+"|[^\\s' . $punct . '?]+)|' . '(?:https?|ftp)://(?:[^\\s' . $punct . ']+)\\.(?:png|jpe?g|gif)))@', $raw, $m)) {
                            foreach ($m[1] as $img) {
                                if ($img[0] == 'a') {
                                    $img = substr($img, 11);
                                    // strip attachment:
                                    $image = $this->macro_repl('attachment', $img, array('link_url' => 1));
                                    if ($image[0] != 'a' && preg_match('@\\.(png|jpe?g|gif)$@i', $image)) {
                                        $page_image = $image;
                                        break;
                                    }
                                } else {
                                    $page_image = $img;
                                    break;
                                }
                            }
                        }
                    }
                    if (empty($page_image) && $is_frontpage) {
                        $val['image'] = qualifiedUrl($DBInfo->logo_img);
                    } else {
                        if (!empty($page_image)) {
                            $val['image'] = $page_image;
                        }
                    }
                    $oc->update($this->page->name, $val, time());
                }
                if (empty($this->no_ogp)) {
                    // for OpenGraph
                    echo '<meta property="og:url" content="' . $page_url . '" />', "\n";
                    echo '<meta property="og:site_name" content="' . $sitename . '" />', "\n";
                    echo '<meta property="og:title" content="' . $options['title'] . '" />', "\n";
                    if ($is_frontpage) {
                        echo '<meta property="og:type" content="website" />', "\n";
                    } else {
                        echo '<meta property="og:type" content="article" />', "\n";
                    }
                    if (!empty($val['image'])) {
                        echo '<meta property="og:image" content="', $val['image'], '" />', "\n";
                    }
                    if (!empty($val['description'])) {
                        echo '<meta property="og:description" content="' . $val['description'] . '" />', "\n";
                    }
                }
                // twitter card
                echo '<meta name="twitter:card" content="summary" />', "\n";
                if (!empty($DBInfo->twitter_id)) {
                    echo '<meta name="twitter:site" content="', $DBInfo->twitter_id, '">', "\n";
                }
                echo '<meta name="twitter:domain" content="', $sitename, '" />', "\n";
                echo '<meta name="twitter:title" content="', $options['title'], '">', "\n";
                echo '<meta name="twitter:url" content="', $page_url, '">', "\n";
                if (!empty($val['description'])) {
                    echo '<meta name="twitter:description" content="' . $val['description'] . '" />', "\n";
                }
                if (!empty($val['image'])) {
                    echo '<meta name="twitter:image:src" content="', $val['image'], '" />', "\n";
                }
                // support google sitelinks serachbox
                if (!empty($DBInfo->use_google_sitelinks)) {
                    if ($is_frontpage) {
                        if (!empty($DBInfo->canonical_url)) {
                            $site_url = $DBInfo->canonical_url;
                        } else {
                            $site_url = qualifiedUrl($this->link_url(''));
                        }
                        echo <<<SITELINK
<script type='application/ld+json'>
{"@context":"http://schema.org",
 "@type":"WebSite",
 "url":"{$site_url}",
 "name":"{$sitename}",
 "potentialAction":{
  "@type":"SearchAction",
  "target":"{$site_url}?goto={search_term}",
  "query-input":"required name=search_term"
 }
}
</script>

SITELINK;
                    }
                }
                echo <<<SCHEMA
<script type='application/ld+json'>
{"@context":"http://schema.org",
 "@type":"WebPage",
 "url":"{$page_url}",
 "dateModified":"{$modified}",
 "name":"{$options['title']}"
}
</script>

SCHEMA;
                if (!empty($val['description'])) {
                    echo '<meta name="description" content="' . $val['description'] . '" />', "\n";
                }
            }
            echo '  <title>', $site_title, "</title>\n";
            echo '  <link rel="canonical" href="', $page_url, '" />', "\n";
            # echo '<meta property="og:title" content="'.$options['title'].'" />',"\n";
            if (!empty($upper)) {
                echo '  <link rel="Up" href="', $this->link_url($upper), "\" />\n";
            }
            $raw_url = $this->link_url($this->page->urlname, "?action=raw");
            $print_url = $this->link_url($this->page->urlname, "?action=print");
            echo '  <link rel="Alternate" title="Wiki Markup" href="', $raw_url, "\" />\n";
            echo '  <link rel="Alternate" media="print" title="Print View" href="', $print_url, "\" />\n";
            $css_html = '';
            if ($options['css_url']) {
                $stamp = '?' . filemtime(__FILE__);
                $css_url = _html_escape($options['css_url']);
                $css_html = '  <link rel="stylesheet" type="text/css" ' . $media . ' href="' . $css_url . "\" />\n";
                if (!empty($DBInfo->custom_css) && file_exists($DBInfo->custom_css)) {
                    $css_html .= '  <link rel="stylesheet" media="screen" type="text/css" href="' . $DBInfo->url_prefix . '/' . $DBInfo->custom_css . "{$stamp}\" />\n";
                } else {
                    if (file_exists('./css/_user.css')) {
                        $css_html .= '  <link rel="stylesheet" media="screen" type="text/css" href="' . $DBInfo->url_prefix . "/css/_user.css{$stamp}\" />\n";
                    }
                }
            }
            echo kbd_handler(!empty($options['prefix']) ? $options['prefix'] : '');
            if (isset($this->_newtheme) and $this->_newtheme == 2 or isset($options['retstr'])) {
                $ret = ob_get_contents();
                ob_end_clean();
                if (isset($options['retstr'])) {
                    $options['retstr'] = $ret;
                }
                $this->header_html = $ret;
                $this->css_html = $css_html;
            } else {
                echo $css_html;
                echo "</head>\n";
            }
        }
        return true;
    }
Example #20
0
 function createShowAlist(&$alist, $subaction = null)
 {
     //$alist[] = "a=show";
     global $gbl, $sgbl, $login, $ghtml;
     $alist['__title_main'] = $login->getKeywordUc('config');
     if ($this->isLocalhost('nname')) {
         $alist[] = "a=show&o=lxupdate";
     }
     $alist['property'][] = "a=updateform&sa=password";
     //$this->getCPToggleUrl($alist);
     $alist[] = "a=updateform&sa=showused";
     //$alist[] = "a=list&c=component";
     $cnl = array('ipaddress', 'dbadmin');
     foreach ($cnl as $cn) {
         $alist = $this->getListActions($alist, $cn);
     }
     $alist['__title_next'] = get_plural(get_description('service'));
     $cnl = array('service', 'cron', 'process', 'uuser');
     foreach ($cnl as $cn) {
         $alist = $this->getListActions($alist, $cn);
     }
     $this->driverApp->createShowAlist($alist);
     //$alist[] = "a=updateform&sa=phpsmtp";
     $alist[] = "a=show&l[class]=ffile&l[nname]=";
     //$alist[] = "a=list&c=firewall";
     //$alist[] = "a=show&o=proxy";
     //$alist[] = "a=updateform&sa=update&c=serverspam";
     $alist['__title_nnn'] = 'Machine';
     $alist[] = "a=show&o=driver";
     //$alist[] = "a=update&sa=loaddriverinfo";
     $alist[] = "a=updateForm&sa=reboot";
     $alist[] = "a=updateForm&sa=poweroff";
     return $alist;
 }
  <!-- Top Content Section -->
  <div class="wrapper top">
    <div class="subwrapper">
      <div class="inner start">
        <?php 
get_title('h1', false);
?>
        <?php 
get_image_main('220x', false, false, '660x', 'divImgRight');
?>
            
        <?php 
get_description('', false);
?>
        <div class="clear"></div>
      </div>  
    </div>
  </div>
  <!-- Content Section -->
  <div class="wrapper content">
    <div class="subwrapper">
      <div class="inner start">
        <?php 
get_pages_overview();
?>
        <div class="clear"></div>
      </div>  
    </div>
  </div>        
       
<?php 
Example #22
0
 function createShowAlist(&$alist, $subaction = null)
 {
     //$alist[] = "a=show";
     global $gbl, $sgbl, $login, $ghtml;
     $alist['__title_security'] = "Security";
     $alist[] = "a=show&o=sshconfig";
     $alist[] = "a=show&o=lxguard";
     $alist[] = "a=list&c=hostdeny";
     $alist[] = "a=list&c=sshauthorizedkey";
     $alist['__title_main'] = $this->getTitleWithSync();
     //$alist['property'][] = "a=updateForm&sa=update";
     //$this->getCPToggleUrl($alist);
     //$alist[] = "a=list&c=vps";
     $alist[] = "a=show&o=dirlocation";
     $alist[] = "a=updateform&sa=savevpsdata";
     $alist[] = "a=updateform&sa=importhypervmvps";
     $alist[] = "a=updateform&sa=commandcenter";
     //$alist[] = "a=updateform&sa=backupconfig";
     //$alist[] = "a=list&c=component";
     if ($sgbl->isDebug()) {
         $alist[] = 'a=updateform&sa=ssl_key';
         $alist[] = "a=show&o=kloxo";
     }
     $alist[] = "a=updateform&sa=mysqlpasswordreset";
     $alist[] = 'a=list&c=ipaddress';
     $alist[] = 'a=updateform&sa=centralbackupconfig';
     $alist['__title_next'] = get_plural(get_description('service'));
     $cnl = array('service', 'cron', 'process');
     foreach ($cnl as $cn) {
         $alist = $this->getListActions($alist, $cn);
     }
     //$this->driverApp->createShowAlist($alist);
     $alist[] = "a=show&o=sshclient";
     $alist[] = "a=show&o=llog";
     //$alist[] = "a=updateform&sa=phpsmtp";
     $alist[] = "a=show&l[class]=ffile&l[nname]=";
     //$alist[] = "a=list&c=firewall";
     //$alist[] = "a=show&o=proxy";
     //$alist[] = "a=updateform&sa=update&c=serverspam";
     $alist['__title_nnn'] = 'Machine';
     $alist[] = "a=updateform&sa=importvps";
     $alist[] = "a=show&o=driver";
     //$alist[] = "a=update&sa=loaddriverinfo";
     $alist[] = "a=updateForm&sa=reboot";
     //$alist[] = "a=updateForm&sa=poweroff";
     return $alist;
 }
Example #23
0
     if (quiz_outcome_achieved($CFG->prefix, $course['course']->id, $student->id, 'M' . $c)) {
         $class = 'achieved';
     }
     //echo "\n".'<td class="'.$class.'">'.$c.'</td>';
     echo "\n" . '<td' . $title . ' class="' . $class . '">' . $c . '</td>';
 }
 $padding_p = $max['M'] - $course['possible']['summary']['M'];
 for ($i = 0; $i < $padding_p; $i++) {
     echo "\n" . '<td class="notenrolled">&nbsp;</td>';
 }
 // DISTINCTION
 echo "\n" . '<td class="divider">&nbsp;</td>';
 foreach ($course['possible']['detail']['D'] as $c) {
     $class = 'partial nobox';
     $title = '';
     $desc = get_description($CFG->prefix, $course['course']->id, 'D' . $c);
     if ($desc) {
         $title = ' title="' . $desc . '"';
     }
     if (outcome_achieved($CFG->prefix, $course['course']->id, $student->id, 'D' . $c)) {
         $class = 'achieved';
     }
     //		if (quiz_outcome_achieved($CFG->prefix, $course['course']->id, $student->id, 'D'.$c)) $class = 'achieved';
     //echo "\n".'<td class="'.$class.'">'.$c.'</td>';
     echo "\n" . '<td' . $title . ' class="' . $class . '">' . $c . '</td>';
 }
 $padding_p = $max['D'] - $course['possible']['summary']['D'];
 for ($i = 0; $i < $padding_p; $i++) {
     echo "\n" . '<td class="notenrolled">&nbsp;</td>';
 }
 echo "\n" . '</tr>';
Example #24
0
function get_static_sub_post($static, $sub_static)
{
    $posts = get_static_sub_pages($static);
    $tmp = array();
    if (!empty($posts)) {
        foreach ($posts as $index => $v) {
            if (stripos($v, $sub_static . '.md') !== false) {
                $post = new stdClass();
                // Replaced string
                $replaced = substr($v, 0, strrpos($v, '/')) . '/';
                // The static page URL
                $url = str_replace($replaced, '', $v);
                $post->url = site_url() . $static . "/" . str_replace('.md', '', $url);
                $post->file = $v;
                // Get the contents and convert it to HTML
                $content = file_get_contents($v);
                // Extract the title and body
                $post->title = get_content_tag('t', $content, $sub_static);
                $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
                $post->views = get_views($post->file);
                $post->description = get_content_tag("d", $content, get_description($post->body));
                $tmp[] = $post;
            }
        }
    }
    return $tmp;
}
function process_data($skus, $avail = 1)
{
    global $allowed_tags;
    if (!empty($skus) && is_array($skus)) {
        foreach ($skus as $sku) {
            // Get the description.
            $description = strip_tags(get_description($sku), $allowed_tags);
            // Add it to an array.
            $record = array('sku' => $sku, 'avail' => $avail, 'desc' => $description);
            // Add it to the table.
            scraperwiki::save_sqlite(array('sku'), array($record), "techmanual", 2);
        }
    }
}