Exemplo n.º 1
0
    $show = $url['show'];
    if ($skip_it != 1) {
        $stripped = preg_replace("#^(http|ftp|https|news)://(\\S+)\$#i", "\\2", $url['show']);
        $uri_type = preg_replace("#^(http|ftp|https|news)://(\\S+)\$#i", "\\1", $url['show']);
        $show = $uri_type . '://' . substr($stripped, 0, 35) . '...' . substr($stripped, -15);
    }
    return $url['st'] . '<a href="' . $url['html'] . '" target="_blank">' . $show . '</a>' . $url['end'];
}
if (!$this->network->id) {
    $this->redirect('home');
}
if (!$this->user->is_logged) {
    $this->redirect('home');
}
$this->load_langfile('inside/api_documentation.php');
$D->page_title = $this->lang('api_doc_page_title', array('#SITE_TITLE#' => $C->SITE_TITLE));
if ($this->param('show')) {
    $D->choosen_param = intval($this->param('show'));
} else {
    $D->choosen_param = 1;
}
if ($D->choosen_param < 1 || $D->choosen_param > intval($this->lang('api_doc_cat_num'))) {
    $D->choosen_param = 1;
}
$D->cat = array();
for ($i = 1; $i <= intval($this->lang('api_doc_cat_' . $D->choosen_param . '_post_num')); $i++) {
    $D->cat[$i]['title'] = htmlspecialchars($this->lang('api_doc_cat_' . $D->choosen_param . '_post_' . $i . '_title', array('#SITE_TITLE#' => $C->SITE_TITLE)));
    $D->cat[$i]['text'] = $this->lang('api_doc_cat_' . $D->choosen_param . '_post_' . $i . '_text', array('#SITE_TITLE#' => $C->SITE_TITLE, '#SITE_URL#' => $C->SITE_URL));
    $D->cat[$i]['text'] = nl2br(bb_apply_tags($D->cat[$i]['text']));
}
$this->load_template('api_documentation.php');
Exemplo n.º 2
0
Arquivo: faq.php Projeto: chaobj001/tt
    $show = $url['show'];
    if ($skip_it != 1) {
        $stripped = preg_replace("#^(http|ftp|https|news)://(\\S+)\$#i", "\\2", $url['show']);
        $uri_type = preg_replace("#^(http|ftp|https|news)://(\\S+)\$#i", "\\1", $url['show']);
        $show = $uri_type . '://' . substr($stripped, 0, 35) . '...' . substr($stripped, -15);
    }
    return $url['st'] . '<a href="' . $url['html'] . '" target="_blank">' . $show . '</a>' . $url['end'];
}
$this->load_langfile('inside/global.php');
$this->load_langfile('inside/faq-pubnet.php');
$D->page_title = $this->lang('faq_page_title', array('#SITE_TITLE#' => $C->SITE_TITLE));
$data = array();
$num_cats = intval($this->lang('faqpb_cats_number'));
for ($i = 1; $i <= $num_cats; $i++) {
    $data[$i] = (object) array('title' => $this->lang('faqpb_c' . $i . '_title'), 'topics' => array());
    $num_topics = intval($this->lang('faqpb_c' . $i . '_posts_number'));
    for ($j = 1; $j <= $num_topics; $j++) {
        $data[$i]->topics[$i . '-' . $j] = (object) array('title' => $this->lang('faqpb_c' . $i . '_p' . $j . '_title', array('#SITE_TITLE#' => $C->SITE_TITLE)), 'text' => nl2br(bb_apply_tags($this->lang('faqpb_c' . $i . '_p' . $j . '_text', array('#SITE_URL#' => $C->SITE_URL, '#SITE_TITLE#' => $C->SITE_TITLE)))), 'image' => $this->lang('faqpb_c' . $i . '_p' . $j . '_image'), 'imgtxt' => $this->lang('faq_c' . $i . '_p' . $j . '_imgtxt'));
    }
}
$D->data_arr =& $data;
if ($this->param('show')) {
    $param = trim($this->param('show'));
    if (!preg_match('/^[0-9]*$/', $param) || ($param < 1 || $param > intval($this->lang('faqpb_cats_number')))) {
        $param = 1;
    }
} else {
    $param = 1;
}
$D->choosen_param = $param;
$this->load_template('faq.php');